Compare commits
760 Commits
Author | SHA1 | Date | |
---|---|---|---|
7e978593d2 | |||
0466115a6d | |||
5168b9e7d8 | |||
329c84a65f | |||
7c5fa5dea7 | |||
3ed262bd61 | |||
f159889f5d | |||
e1f517595d | |||
6fbe6be74e | |||
d443b99f27 | |||
b977e2b2af | |||
3dda56688c | |||
4b62576a0a | |||
5c48f3ed70 | |||
8ebf5dedd2 | |||
1d181b61a3 | |||
c5b9f668b2 | |||
cc1be262d1 | |||
ae2288a982 | |||
7e1765c26b | |||
4955986c3e | |||
aacaa528fb | |||
dc4f9a30bd | |||
a2ea4dad11 | |||
725097392a | |||
f267161c29 | |||
794cc4f3dc | |||
9373b3db93 | |||
9dfb6dc916 | |||
98c35f6f9d | |||
2f488a5daf | |||
1622f864fc | |||
08d3201cee | |||
bc996df3d8 | |||
3f5c79dd05 | |||
296b4164a7 | |||
ed260b6b37 | |||
5f1604aece | |||
7ddca4aec7 | |||
d286674cee | |||
1d96a4807b | |||
02bedad2ed | |||
1876907bac | |||
07398456c1 | |||
58414affe8 | |||
1a89871aa9 | |||
10fcedf537 | |||
c4d89faa33 | |||
a912b4aeef | |||
0b5ca8ddb3 | |||
2932427ab0 | |||
3b4625961f | |||
46d5608dfe | |||
1b44f35967 | |||
ecd758220a | |||
28e03cbf8e | |||
e51601a8bd | |||
6667b9e4cb | |||
93fe11728a | |||
c83f7c8d94 | |||
1ef8c99c43 | |||
f4bb812fd4 | |||
81963979d1 | |||
da6d73d9bf | |||
d91c4f4cf2 | |||
f3aeb9f61b | |||
20dcb4a475 | |||
0bf0fd9f27 | |||
17bfa4b260 | |||
73f1a9c31f | |||
c74c6f6f5d | |||
28e2d3df08 | |||
62914b2dfd | |||
46c1beed88 | |||
9f499b8e8f | |||
33c15d2444 | |||
7116d5c805 | |||
c4ccb4f072 | |||
fe1ac8e324 | |||
6049531de5 | |||
ed52202017 | |||
b90eb1fc8f | |||
f9a1183993 | |||
63585661ae | |||
711ec58419 | |||
bbeb80600b | |||
15d4124d89 | |||
87acd01273 | |||
8d83e51947 | |||
b19032da9b | |||
b4b977ffc5 | |||
d82d07bf2c | |||
3a87d2957a | |||
8aa7f34fd2 | |||
79f3177a60 | |||
c468147db0 | |||
c19fbf40a0 | |||
55193a958d | |||
bb92a8a8d4 | |||
e0a3b6db70 | |||
c860834f17 | |||
8544fe806e | |||
a14f648cb3 | |||
56171f94cf | |||
2e08fa5745 | |||
0afcdcc1f6 | |||
e7d71e3607 | |||
2d068cfd79 | |||
ee0c22e37c | |||
925e82e5c5 | |||
0cdfc253d2 | |||
9e6e72c0a1 | |||
63def5530f | |||
c206a40e62 | |||
2889923940 | |||
3deabdbf36 | |||
89c8e6a194 | |||
19a5216373 | |||
f274ba9caa | |||
5a36db2366 | |||
9003d3c738 | |||
d06a32311e | |||
63fb0e0ff9 | |||
4e14801db6 | |||
926db6007a | |||
cf0e001cfc | |||
ee6370bb0b | |||
33ba50a7b4 | |||
29e8b00656 | |||
ff175c0c8f | |||
a015593971 | |||
fdbf42ad1a | |||
61583447b6 | |||
33ab63c1bc | |||
5b3a013766 | |||
69f8b79fc4 | |||
60d283f931 | |||
f41dd51dc7 | |||
a7173adc22 | |||
bbef34d125 | |||
277b10b155 | |||
6a69d4eaac | |||
4d3c1cacc9 | |||
2ed26bc8d9 | |||
52e55a24fa | |||
98b85435ac | |||
3903c5630f | |||
ac7ef77a8d | |||
c80ca295c6 | |||
19a9c305ce | |||
dca7b4a694 | |||
357d18fbe0 | |||
251623acf0 | |||
4caa5a6ab0 | |||
d1b11c0630 | |||
36b25e1c9f | |||
6a2407a07c | |||
cd623065e7 | |||
2b462bfecb | |||
9353ea93c1 | |||
853cce4a66 | |||
2d944b276c | |||
b4299ef066 | |||
64799d2e14 | |||
ead54fce3f | |||
ae93efb17a | |||
d95dfb18fd | |||
4e3c397ce5 | |||
4e6126405f | |||
8cdec543e1 | |||
4810cbe138 | |||
8ec7fbb49e | |||
7d52ed8802 | |||
9d44d063eb | |||
d5eb9ed478 | |||
40afb6cdc2 | |||
74234476ab | |||
82c71a3bd8 | |||
5161e1c045 | |||
40052dbf3f | |||
e73d92754e | |||
6df1b80941 | |||
a9e5963b74 | |||
95671966cd | |||
a8ce7216e1 | |||
5c6829165b | |||
91eebfd895 | |||
72cc04342f | |||
75267294f9 | |||
f81d302c9a | |||
c3ab0406e4 | |||
fdcaf4e596 | |||
ca7b3eff29 | |||
f1eb640564 | |||
194ca2d380 | |||
976e90f0a0 | |||
2c836f473d | |||
f834b6046e | |||
e6087f3818 | |||
20c3df6be2 | |||
b914e4b548 | |||
f336489609 | |||
4ce2e88568 | |||
a917a6a9cd | |||
a01eabea91 | |||
605f0da751 | |||
6bd0c10ef2 | |||
a9032602bf | |||
8c03601bd2 | |||
afc4c0ca1f | |||
e0ee8a7040 | |||
e32336aff8 | |||
0edbba5625 | |||
eec5350926 | |||
20f0b3f782 | |||
5cf4128c49 | |||
47768acf5c | |||
f88d2177c3 | |||
9373f10d68 | |||
4f3bb6ac93 | |||
5f224a077c | |||
14cdeb0b5a | |||
b02137c216 | |||
7c90103af4 | |||
903af03d15 | |||
b57ca4d207 | |||
2fe58941ea | |||
04f734bebe | |||
a0d43ebe0e | |||
6d80dce66d | |||
3d765dd701 | |||
2b42c64160 | |||
7928131112 | |||
9cb1f9647c | |||
6d6daa60b6 | |||
81a454c29c | |||
6f245d9b7f | |||
05c001067e | |||
fea57a4034 | |||
00eebf9260 | |||
cde18c8d35 | |||
0b2c3fa96e | |||
8f631cfe4b | |||
f10b25c07f | |||
77a959fe29 | |||
d8db111d30 | |||
c2811f2818 | |||
b258a3ff9c | |||
02029d22b0 | |||
1f7f1c170d | |||
a13a4a5695 | |||
0b9dcaa8f1 | |||
9c7030f80e | |||
d8112550f5 | |||
4eb662d314 | |||
8e06ffc3b1 | |||
98c5c052de | |||
95fe0c9516 | |||
2908b1449c | |||
454b461e89 | |||
0a8d2ad233 | |||
35e34e44ee | |||
b6ce1f62e0 | |||
55eaa85979 | |||
b3f5c532dd | |||
0821565a75 | |||
d187ad43f3 | |||
b5aff6a8eb | |||
a6291b3ee2 | |||
f1f86e04e6 | |||
06898ca0af | |||
305f8317fe | |||
d7d13dd523 | |||
84dd9dbcea | |||
a345fa8874 | |||
5780d3ca21 | |||
4c220cbb36 | |||
942f9296a0 | |||
fb50f2783f | |||
a50ddd25b2 | |||
4b6d5a86b2 | |||
fbada0c4be | |||
6a8459cc4e | |||
fce9e9a73f | |||
8ab3c937b6 | |||
f8e431cc2e | |||
3f7c069ce0 | |||
21895d307b | |||
38b0eec741 | |||
2496f19bee | |||
21932dc329 | |||
35fc287d55 | |||
3a3623859b | |||
f623e78bdc | |||
2bcc14888c | |||
7bee6cf1ea | |||
eea264a099 | |||
b99d872c53 | |||
f09d1b5da1 | |||
9e3ff74b98 | |||
2e64e31a8f | |||
150f9d6c08 | |||
a6565aae53 | |||
ac268c0672 | |||
94902c661f | |||
0a90e1fe4a | |||
9f1a09689f | |||
af68d9b0cf | |||
d75b7de20b | |||
f968e618ac | |||
fb9717a00f | |||
0acdf41fa3 | |||
f5fddd0369 | |||
660f801afd | |||
da66118d20 | |||
93d1de941c | |||
94106a11c0 | |||
76f0ee3ef0 | |||
712792ac9f | |||
56424cf0d1 | |||
9230bd8115 | |||
ab0d34599f | |||
0c4ee6a033 | |||
f5b80b6e63 | |||
63f4a8310e | |||
53176a9a26 | |||
8422243465 | |||
91317b7a41 | |||
cbcc6f812a | |||
a53a3d595c | |||
d741035707 | |||
bab02110b0 | |||
1db4e10dc8 | |||
d6a87bc426 | |||
d8096a3695 | |||
0927695261 | |||
97380e9833 | |||
2c64581a2c | |||
05a00e8ce0 | |||
d056bd0bd2 | |||
fa187be88a | |||
357ccca819 | |||
993f49c0a0 | |||
3b180cda83 | |||
1a877bbfa1 | |||
c3bbd75c65 | |||
03a6e537b8 | |||
401a1480d6 | |||
5c75b2cb38 | |||
2137043c8c | |||
a919f51fc0 | |||
16d85a5a41 | |||
0ccf46456a | |||
2f20961395 | |||
f3318e0dd0 | |||
7843090907 | |||
29ceca055e | |||
076f64788a | |||
b9dca52e52 | |||
2ac306ec15 | |||
999bfae344 | |||
0994743fd8 | |||
8b0070efd4 | |||
82ed352c1d | |||
2a975123fc | |||
5d6a66dcac | |||
8c1197e8e1 | |||
6db4ba7082 | |||
609bccefe1 | |||
ff35e480f2 | |||
b32ccb48be | |||
db6c6de8e9 | |||
6f69fe2545 | |||
05a4491bb2 | |||
27334858c9 | |||
a8bdfef271 | |||
b59d64682e | |||
d3d4add5a2 | |||
fa4dd48955 | |||
dce50b226f | |||
a0aa04e036 | |||
2670bb8f6d | |||
b0642aafb7 | |||
3901a2a281 | |||
2403881a7c | |||
758907a660 | |||
70a511a141 | |||
86aa453093 | |||
be6fb7bd75 | |||
0ab5b873f1 | |||
06dbc71a1d | |||
a51b25208f | |||
cb00ff7c5d | |||
43b762dd2a | |||
ba40b74230 | |||
da9425228e | |||
2ba4233ac7 | |||
1545bf39ee | |||
ff4496be24 | |||
bf7e602e4a | |||
a66430c255 | |||
689d7bf0a9 | |||
6d1417ab73 | |||
a60edfdd37 | |||
a28c088c06 | |||
acb57bffb4 | |||
35c2e07261 | |||
14a2313e5f | |||
1f75ba41cf | |||
77109fd3cc | |||
21570ea5ec | |||
2b8ed2192b | |||
1e5cf55521 | |||
87db7ddd98 | |||
09d7bd4fae | |||
38e56254ff | |||
c5246e73ca | |||
120da86904 | |||
02f1ab0e4a | |||
9465cf03ac | |||
7168b874aa | |||
67f2eec4eb | |||
50a23afe7a | |||
d57c07affd | |||
d5c975d0b6 | |||
febf9f2c3e | |||
cfadede201 | |||
9988c4daf6 | |||
6b4feb3b91 | |||
b4625335b6 | |||
0d7bae5be8 | |||
11b4aaad6e | |||
589a7da53b | |||
71ce8597e5 | |||
7ef1ba10a9 | |||
b8df7e9603 | |||
73d2d4a95d | |||
0f68d2d0fc | |||
9083fc65d4 | |||
9604869639 | |||
0c0238ee20 | |||
0763168367 | |||
9490952d6c | |||
9a576d70e4 | |||
0530b450ce | |||
17e90c4761 | |||
200d476462 | |||
e7d1044716 | |||
44df84e286 | |||
f8738c64b7 | |||
fdfeb2a90b | |||
2804400910 | |||
9d2fc5bc6e | |||
536aea6c48 | |||
c64ca0c814 | |||
86c9ac93d5 | |||
e1f25475b1 | |||
6cd4b6c549 | |||
81f7a5f25b | |||
a10064c205 | |||
f1b9be44f4 | |||
14ca2b6687 | |||
e78dacd029 | |||
87b420e21e | |||
da3374a484 | |||
b151eed4b6 | |||
f0513c19b8 | |||
ee0219b39a | |||
a93d334b1f | |||
59803d547c | |||
8dcee29952 | |||
53d5a09fb4 | |||
acdfae1608 | |||
4442931dd4 | |||
1aeab0aef5 | |||
e9600fa5ec | |||
42a5b67386 | |||
58e6940bad | |||
3b685fe164 | |||
a531e8ee19 | |||
a51a1458be | |||
f029b9034d | |||
7c1766825b | |||
8ac2fa3334 | |||
6c64246ca8 | |||
57968875f0 | |||
009b1cddcd | |||
8f52ae6f0c | |||
54247b8b90 | |||
762fa93c23 | |||
2e025ebf20 | |||
833c089a27 | |||
a410c2a2f6 | |||
fae791ff71 | |||
729b410d63 | |||
b9bb17dd69 | |||
03286a44b9 | |||
1cff350fed | |||
f191ed42da | |||
46ba62d346 | |||
dd07501c5c | |||
68e48205f3 | |||
3aaeafbfc0 | |||
a34e9637fe | |||
4af259ffed | |||
6165b80147 | |||
33fd9c1b4d | |||
c442aac0a9 | |||
081f51dfd2 | |||
27b6d068ed | |||
b4adf42644 | |||
527d4670d4 | |||
17c6b7d282 | |||
2a729ffcc2 | |||
3ffbf556f2 | |||
5f04ac3bee | |||
bd05860f11 | |||
3887dce508 | |||
651b66198f | |||
77fac967bc | |||
c8375ca138 | |||
34c5824255 | |||
abcbbe9ae2 | |||
fb06df8578 | |||
d71721ab87 | |||
93e6cd36a7 | |||
ca3873f055 | |||
ba14699dfb | |||
e3dae698d9 | |||
b8eee58b01 | |||
344d2f3dac | |||
bc863a3345 | |||
6ffe47b2d8 | |||
30ecfd4370 | |||
48e3e39514 | |||
909fd9d68c | |||
b9ccc083ae | |||
42549d9bb9 | |||
ce93a83305 | |||
08f6e5d3d9 | |||
dfa597f2d0 | |||
ea917c470e | |||
945f310eae | |||
ea005587de | |||
eb545f3763 | |||
378d373a04 | |||
6bcbc655ed | |||
8bea1859c8 | |||
8b10bf7242 | |||
3949ae5185 | |||
ac2b9c6a1e | |||
126ec7a881 | |||
90999fc3d6 | |||
9d2615c221 | |||
28d5c2d5d7 | |||
d250d3dcb6 | |||
207e38e619 | |||
61084d6526 | |||
ea15edd45c | |||
4c118e161b | |||
4430aff718 | |||
5cd8e8a834 | |||
20a01c8c52 | |||
0a5822e64e | |||
977dcb7dc3 | |||
9296ef5333 | |||
49c96963f8 | |||
934744362f | |||
e1b79af4a5 | |||
9b89612edb | |||
196a965aea | |||
aad538ecfc | |||
1c51225277 | |||
766879d47c | |||
d52a7ae08c | |||
803a84638e | |||
d163cd60f5 | |||
ec895f3e12 | |||
41c9bcc6ce | |||
325db8ab3c | |||
f31a7b736b | |||
c2c79ca9ec | |||
0e96ed1519 | |||
d43f5f5320 | |||
4b51126239 | |||
a21d0f8a73 | |||
0e83d1e39f | |||
bb500779d9 | |||
815bd4b49e | |||
619595fd65 | |||
127207414c | |||
ba72e80279 | |||
4b5d271ab4 | |||
7f2956e47a | |||
36a199946e | |||
d79f29d237 | |||
0d440fafa7 | |||
353a487ded | |||
a0c4ad6af4 | |||
f16576c03c | |||
0144a5787a | |||
ed624f5bf1 | |||
2699feada5 | |||
1affb38cd5 | |||
2feb5bc6ff | |||
2f175f5529 | |||
cf4971a6c4 | |||
65e253a538 | |||
5f010b68af | |||
e04d098527 | |||
24b5e279db | |||
26f4c0bcff | |||
b82c94bf51 | |||
6f9a5ce8d2 | |||
e0eb0eefce | |||
641921537b | |||
52f892f35f | |||
15e4c19f04 | |||
cca89f9260 | |||
bbee451f2c | |||
51f7daba6c | |||
7fa35f18e4 | |||
217765254d | |||
c747be2743 | |||
2d60e2b461 | |||
69cd540329 | |||
ad57be052e | |||
5cded5f27c | |||
39d1663fa1 | |||
6ddea35dec | |||
f3e8a3024f | |||
7d35facdaf | |||
7ba24f7a54 | |||
feb3215745 | |||
ba5d734a05 | |||
bb26d45f1d | |||
1a79e7149c | |||
4bdd2b3894 | |||
5d804b2d8e | |||
4a83edf3bc | |||
d0de4ac677 | |||
49530b8d0c | |||
3aa5a27268 | |||
88518338f1 | |||
965f14e249 | |||
c91e04b4d8 | |||
8fa8267e04 | |||
73fa9532b5 | |||
04102677f2 | |||
331636b9f4 | |||
8c1d9c3fe2 | |||
c655e23cb3 | |||
26b78eecf6 | |||
08484d9807 | |||
13b19fec75 | |||
6fb70a5b32 | |||
317aea7492 | |||
0936ae6fb6 | |||
6bf29a45db | |||
b00668e758 | |||
6941f26e97 | |||
71a15a24bc | |||
964ff00520 | |||
856b2527e3 | |||
92158f2496 | |||
2a5a184662 | |||
d45bfb0eeb | |||
314a615b68 | |||
e77276ae52 | |||
72348008a2 | |||
3e43f67ee2 | |||
d1fd6d1861 | |||
c7743fccb9 | |||
ee75c6a53d | |||
fc637e553c | |||
fc76b3929b | |||
0e83c7368d | |||
0b8e1a1a0d | |||
6d6a801a01 | |||
ba2ba9bc58 | |||
268138d726 | |||
7fe615a7ee | |||
d4fa723155 | |||
ae5ec93b53 | |||
ead1f186f0 | |||
2c6704ae9e | |||
e2a2758f6d | |||
3973b57413 | |||
f1ce4b834a | |||
69346bfaa1 | |||
9df49c354b | |||
444d506359 | |||
65815113d5 | |||
53196b5dda | |||
03f73564da | |||
9fd845c424 | |||
f079907a9e | |||
ee308fb5aa | |||
4900b67882 | |||
4ae167e461 | |||
4491a600f3 | |||
c8927e0b60 | |||
50355abdda | |||
f190b7651e | |||
38c394581c | |||
00d7cf48af | |||
740ae124f9 | |||
17977d2a88 | |||
ed29923d2e | |||
6228e7229b | |||
677f92af68 | |||
ce43d8b30e | |||
09470e85ce | |||
bab896aba1 | |||
519381684d | |||
a66b35190f | |||
5b655d7889 | |||
e22839168d | |||
7036f5c5ca | |||
a943da1812 | |||
2426ed782e | |||
8caf879b5c | |||
972702a1c6 | |||
438e2fb494 | |||
d66db99241 | |||
a8bebc2808 | |||
23ecd43fc0 | |||
fe7a085c39 | |||
194b4f9bdc | |||
5099ac9621 | |||
70a3f2fff3 | |||
ed49bcca00 | |||
4918c74d49 | |||
e528aa1eec | |||
f5608576c9 | |||
d00e8cf64f | |||
42c8d9bbb7 | |||
dc88d68a6c | |||
b278c8cde9 | |||
47bab9d2c4 | |||
6ef97389a0 | |||
7bac05e63b | |||
e8e8dd91bc | |||
ba31b40d9b | |||
8d9082235b | |||
2b9aa467bd | |||
4df4e620c1 | |||
d269888edc | |||
f46033cac5 | |||
b9af6ced83 | |||
f30a099bf4 | |||
24140f9e42 | |||
68e659d751 | |||
2cf9ee3c46 | |||
06c3fb58a7 | |||
5ac17087f4 | |||
8e8922b78e | |||
1981093293 | |||
6634ed8e4c | |||
336a331c52 |
4
.gitignore
vendored
4
.gitignore
vendored
@@ -1,3 +1,4 @@
|
||||
*.py.bak
|
||||
*.pyc
|
||||
*~
|
||||
src/config/
|
||||
@@ -6,4 +7,5 @@ src/oggenc2.exe
|
||||
src/bootstrap.exe
|
||||
src/Microsoft.VC90.CRT
|
||||
src/Microsoft.VC90.MFC
|
||||
src/documentation/
|
||||
src/documentation/
|
||||
src/com_cache/
|
99
.gitlab-ci.yml
Normal file
99
.gitlab-ci.yml
Normal file
@@ -0,0 +1,99 @@
|
||||
# Jobs to build the two channels in Socializer.
|
||||
# Currently using python 3.7.7
|
||||
variables:
|
||||
PYTHON3_32: "C:\\python37-32\\python.exe"
|
||||
PYTHON3_64: "C:\\python37-64\\python.exe"
|
||||
NSIS: "C:\\nsis\\makensis.exe"
|
||||
|
||||
.configure_environment: &configure_environment
|
||||
tags:
|
||||
- windows10
|
||||
before_script:
|
||||
- '&$env:PYTHON3_32 -V'
|
||||
- '&$env:PYTHON3_32 -m pip install --upgrade pip'
|
||||
- '&$env:PYTHON3_32 -m pip install --upgrade -r requirements.txt'
|
||||
- '&$env:PYTHON3_32 -m pip uninstall enum34 -y'
|
||||
|
||||
# Create documentation in all available languages so we'll have it at http://socializer.su/documentation
|
||||
# this job is triggered on every commit to master, so we always will display the latest available version of the documentation in the website.
|
||||
documentation:
|
||||
type: deploy
|
||||
tags:
|
||||
- windows10
|
||||
script:
|
||||
### Dependencies.
|
||||
- '&$env:PYTHON3_32 -m pip install --upgrade babel markdown'
|
||||
# generate all html documents first.
|
||||
- copy changelog.md doc\changelog.md
|
||||
- cd doc
|
||||
- '&$env:PYTHON3_32 documentation_importer.py'
|
||||
- cd ..\src
|
||||
- '&$env:PYTHON3_32 ..\doc\generator.py'
|
||||
- 'move documentation ..\'
|
||||
# Update interface and documentation translation catalogs.
|
||||
- '&$env:PYTHON3_32 setup.py extract_messages -F babel.cfg --input-dirs . --output-file socializer.pot'
|
||||
- '&$env:PYTHON3_32 setup.py update_catalog --no-fuzzy-matching --domain socializer --output-dir locales --input-file socializer.pot'
|
||||
- cd ..\doc
|
||||
- '&$env:PYTHON3_32 translate.py'
|
||||
- cd ..\src
|
||||
- 'move locales ..\'
|
||||
only:
|
||||
- master
|
||||
artifacts:
|
||||
paths:
|
||||
- documentation
|
||||
- locales
|
||||
name: socializer_documentation
|
||||
expire_in: 30 days
|
||||
|
||||
alpha32:
|
||||
<<: *configure_environment
|
||||
type: deploy
|
||||
script:
|
||||
- copy changelog.md doc\changelog.md
|
||||
- cd doc
|
||||
- '&$env:PYTHON3_32 documentation_importer.py'
|
||||
- cd ..\src
|
||||
- '&$env:PYTHON3_32 ..\doc\generator.py'
|
||||
- '&$env:PYTHON3_32 write_version_data.py'
|
||||
- '&$env:PYTHON3_32 setup.py build'
|
||||
- '&$env:NSIS installer_alpha.nsi'
|
||||
- cd ..
|
||||
- move src\socializer* .
|
||||
- cd scripts
|
||||
- '&$env:PYTHON3_32 prepare_zipversion.py'
|
||||
- cd ..
|
||||
- move src\socializer.zip socializer_x86_alpha.zip
|
||||
- '&$env:PYTHON3_32 scripts/generate_update_file.py'
|
||||
- '&$env:PYTHON3_32 scripts/upload.py'
|
||||
- move socializer_x86_alpha.zip socializer_x86.zip
|
||||
only:
|
||||
- schedules
|
||||
artifacts:
|
||||
paths:
|
||||
- socializer_x86.zip
|
||||
name: socializer_alpha
|
||||
expire_in: 1 day
|
||||
|
||||
# Generates a new stable version of the application every tag.
|
||||
stable:
|
||||
<<: *configure_environment
|
||||
type: deploy
|
||||
script:
|
||||
- copy changelog.md doc\changelog.md
|
||||
- cd doc
|
||||
- '&$env:PYTHON3_32 documentation_importer.py'
|
||||
- cd ..\src
|
||||
- '&$env:PYTHON3_32 ..\doc\generator.py'
|
||||
- '&$env:PYTHON3_32 write_version_data.py'
|
||||
- '&$env:PYTHON3_32 setup.py build'
|
||||
- '&$env:NSIS installer.nsi'
|
||||
- cd ..
|
||||
- move src\socializer* .
|
||||
- cd scripts
|
||||
- '&$env:PYTHON3_32 prepare_zipversion.py'
|
||||
- cd ..
|
||||
- move src\socializer.zip socializer_x86.zip
|
||||
- '&$env:PYTHON3_32 scripts/upload.py'
|
||||
only:
|
||||
- tags
|
94
README.md
94
README.md
@@ -1,98 +1,28 @@
|
||||
# socializer
|
||||
|
||||
[](https://code.manuelcortez.net/manuelcortez/socializer/commits/master)
|
||||
|
||||
> Note: this project has two different main repositories. [Here is the official repository, hosted in my Gitlab Instance,](https://code.manuelcortez.net/manuelcortez/socializer) [Here is a mirror repository hosted in GitHub.](https://github.com/manuelcortez/socializer) Github repository will accept pull requests and issues reported by github users, while Gitlab's repository will provide the wiki, documentation, and support for user reported issues.
|
||||
|
||||
A desktop application for handling [vk.com](http://vk.com) in an easy way.
|
||||
|
||||
## weekly builds
|
||||
[See Socializer's website](http://socializer.su)
|
||||
|
||||
Socializer's functionality is far to be perfect, in fact there are lots of methods of the VK API that this application doesn't support right now, but if you are curious enough, and you want to help by giving me your impressions and making tests for fixing bugs, you can download the last source code, compiled as an application. This is the weekly build of socializer. This version is only for testing purposes, never think that it can be used for everyday use. This version does not include any documentation, Only the changelog, because it's build with an authomatic process. This weekly build is built every week, depending in the updates that the repository has receibed.
|
||||
## dependencies not installed by PIP
|
||||
|
||||
Before downloading, take in to account the following: This source code is completely experimental. The current functionality in this application is not very useful. If you decide to use nightly build versions, take into account that this doesn't work as an application for everyday use yet.
|
||||
For other dependencies, do pip install --upgrade -r requirements.txt
|
||||
|
||||
Version: 2016.05.25
|
||||
Build date: May 25 2016
|
||||
[Download socializer weekly build](https://github.com/manuelcortez/socializer/blob/master/nightly/socializer-nightly-build.zip?raw=true)
|
||||
* [Python,](http://python.org) version 3.7.2
|
||||
|
||||
I have started this effort as an open source project on Feb 13, 2016. Pull requests and bug reports are welcome. Socializer is not a definitive name for this project, it could be changed in future.
|
||||
## Documentation
|
||||
|
||||
## dependencies
|
||||
I am trying to write an updated manual for socializer. It can be found in the documentation folder once the program zip file is uncompressed, or in the manual.md file (in markdown). The idea of this manual is to be updated as socializer receives new features or improvements.
|
||||
|
||||
* [Python,](http://python.org) version 2.7.11
|
||||
* [wxPython](http://www.wxpython.org) for Python 2.7, version 3.0.2.0
|
||||
* [Python windows extensions (pywin32)](http://www.sourceforge.net/projects/pywin32/) for python 2.7, build 220
|
||||
* [PyEnchant,](http://pythonhosted.org/pyenchant/) version 1.6.6.
|
||||
* [VK API bindings for Python](https://github.com/dimka665/vk) (already included in the SRC directory)
|
||||
* If you want to build your own versions, [Pandoc](http://pandoc.org/installing.html) make sure you have pandoc.exe in your path variable. If not, edit scripts/build.sh.
|
||||
* pypubsub
|
||||
* configobj
|
||||
* requests-oauthlib
|
||||
* future
|
||||
* arrow==0.6
|
||||
* microsofttranslator
|
||||
|
||||
## Running
|
||||
|
||||
Just open the main.py file with the python interpreter. This file is located in the src directory. If you haven't configured your VK account, you will see a dialogue, just press yes and a new dialogue will prompt for an user email or phone number and the password for your account. Take into account that the provided information will be saved in a config file as plain text. This application will need your information for renegotiating the access token when it expires.
|
||||
|
||||
Note: Every time you grant access to socializer, probably You will receive an email from VK by telling you that someone has accessed to your account. It means that a new token has been negotiated between VK and socializer by using an authomatic process, you should ignore those advices, unless you receive an email when you are not logged in VK with socializer or other application. You can see your authorised applications in the configuration section in the VK website. New tokens are renegotiated every 24 hours.
|
||||
|
||||
## Main interface
|
||||
|
||||
If you have used [TWBlue](https://github.com/manuelcortez/twblue) before, the socializer's interface is quite similar. Once you have authorised your account, you will see a window with the following elements:
|
||||
|
||||
* A tree view at the left of the window, where you will see the list of buffers (at the moment, there are only five of these: news feed, my wall, my audios, populars and recommended). These buffers are divided in two categories, posts and music. You could expand each category for seeing the child buffers. There are some additional buffers, timelines and chats, wich will be filled with timelines for your friends or with chats, when you start or receive a chat session.
|
||||
* A button for making a post to your wall.
|
||||
* In audio buffers, Two buttons: Play and play all.
|
||||
* A list where you will see the posts for the currently selected buffer.
|
||||
* A status bar where the program will put some useful information about what it's doing at the moment.
|
||||
* And a menu bar, which could be used for making a search for audio files in VK, or check for updates.
|
||||
|
||||
When socializer starts, it will try to load your news items, wall and audios. At the moment there are only a few supported actions for these items:
|
||||
|
||||
* Audio files: You can play the currently selected song, view the song's details (including lyrics, if available), add or remove from your library, and download it to a desired place in your hard drive. You can find audio files in your news feed or in your own audios buffers.
|
||||
* News feed's post: In your news feed buffer, you can press return in any post and socializer will open a new dialogue which can be different, depending in the kind of post you are when the return key was pressed.
|
||||
* At the moment you can't open your wall posts.
|
||||
|
||||
### Making a post
|
||||
|
||||
When you press the post button, a new dialogue will show up. This dialogue allows you to post something in your wall. In this dialogue you have to write a message. You can translate your message and fix your spelling mistakes. Also you can post an URL address, socializer will try to add it as an attachment, so you will not have to worry about this. When you're ready, just press the send button and it'll be done.
|
||||
|
||||
### Working with posts in news feed
|
||||
|
||||
You can press the return key in any post in your news feed for opening a new dialogue with some information. The information and dialogue will be different if you are viewing a friendship's notification (when someone has added some friends), an audio file, or a regular post.
|
||||
|
||||
If you open a regular post in your newsfeed, you will be able to see the comments in a list, indicate if you do like or dislike the post, or add a new comment.
|
||||
|
||||
For friend notifications, you can only view the new added friends in a list and there are some kind of posts that aren't handled. It should be improved.
|
||||
|
||||
### Working with songs
|
||||
|
||||
If you want to play or view audio's details, you'll have to navigate to the tree view, and, using the down arrow, look for "my audios", "populars" or "Recommendations". You will see two more buttons, play and play all. The play button will play the currently selected audio, and the play all button will play audios in the current buffer, starting with the current selected item. You can go to the song's list, look for a desired song and press the play button, or Ctrl+return, which is a keyboard shorcut. Take in to account that there are some keyboard shorcuts that only work in the list of items.
|
||||
|
||||
You can play audio from any buffer, just press ctrl+return for making the audio playback possible.
|
||||
|
||||
If someone has added multiple audios at once to his library, you will see something like this in your newsfeed: "(friend) has added 4 audios: audio 1, audio2, audio3 and audio4". You can press return in the post for opening the audio's details dialogue, where you will be able to see a list with these audios. By default the first detected song is selected, which means that you could read its details by pressing tab, download or add it to your library. If you change the audio in the list, the information will be updated and you will see details and actions will take effect in the new selected audio.
|
||||
|
||||
When an audio file is playing, you can press f5 and f6 for decreasing and increasing volume, respectively, or control+shift+return for play/pause.
|
||||
|
||||
If you want to see some details for the selected audio file, you can do it by pressing the return key. You will be able to read some useful information (title, artist, duration and the lyric, if available). Also you will be able to download the song to your hard drive, you have to press the download button in the details' dialogue.
|
||||
|
||||
When the download starts, you can close the details dialogue and check the status bar in the main window for seeing the current progress.
|
||||
|
||||
## menu Bar
|
||||
|
||||
You can go to the menu bar by pressing ALT. Right now, there are only two menus, buffer and help:
|
||||
|
||||
### Buffer menu
|
||||
|
||||
* New buffer: This submenu allows you to create a new buffer, at the moment, you can create only a kind of buffer, an audio search. The audio search will be located in the music category and will have the last 299 results of your query. It isn't possible to delete the buffers until you restart the client.
|
||||
* Update current buffer: perform an update operation in the selected buffer, which will retrieve the new items.
|
||||
* Remove buffer: Tries to remove the current buffer. It only works with audio searches, because the default buffers shouldn't be removed.
|
||||
|
||||
The help menu is self explanatory.
|
||||
A copy of the English version of the manual can be read here: [Manual in the socializer's wiki](https://code.manuelcortez.net/manuelcortez/socializer/wikis/manual)
|
||||
|
||||
## Contributing
|
||||
|
||||
If you are interested in this project, you can help it by [translating this program](https://github.com/manuelcortez/socializer/wiki/translate) into your native language and give more people the possibility of using it. Thank you in advance!
|
||||
If you are interested in this project, you can help it by [translating this program](https://code.manuelcortez.net/manuelcortez/socializer/wikis/translate) into your native language and give more people the possibility of using it. Thank you in advance!
|
||||
|
||||
## contact
|
||||
|
||||
|
257
changelog.md
257
changelog.md
@@ -1,6 +1,254 @@
|
||||
% Changelog
|
||||
# Changelog
|
||||
|
||||
## Changes for the current build ()
|
||||
## News in this version
|
||||
|
||||
### New additions
|
||||
|
||||
* Socializer will ask for confirmation before closing the application.
|
||||
* In all audio buffers, there is a new item in the context menu that allows downloading of the audio directly from the buffer. If there are multiple audios selected, socializer will ask for a folder where all audios should be placed. When downloading multiple audios, socializer will name those automatically by following the template "song title - artist".
|
||||
* In all audio buffers, there are two new menu items for selecting and deselecting all items in the buffer.
|
||||
* Added displaying of articles as attachments in wall posts. When opened, Socializer will open the article in the web browser.
|
||||
* Starting from Version 0.24, there will be an installer for the Alpha version of socializer, always available from our downloads page.
|
||||
|
||||
### bugfixes
|
||||
|
||||
* Fixed an error that was making socializer unable to render correctly certain Links containing uppercase letters (such as yandex.disk shared links). Before, those links were giving 404 errors when pressed, now they should work normally. This error was present in wall posts, comments, topics and chat messages.
|
||||
* Fixed an error related to chat notifications in Socializer. Before, the "online now" notification could break the Socializer interface, making it unable to load the chat in real time.
|
||||
* Fixed a small inconsistency when marking a conversation as read. Before, if two messages were sent by the recipient, only the last message was marked as read and the previous was making the unread sound all the time. Now that issue should be handled properly.
|
||||
|
||||
### Changes
|
||||
|
||||
* Socializer will not be marked as Virus by most antivirus softwares due to a new build tool which is cleaner and less prone to be flagged by antivirus.
|
||||
* Socializer is distributed with the Microsoft C++ redistributable package, so everyone will be able to use the software without needing to install any extra package.
|
||||
* Replaced the underlying library we were using for spelling correction as is no longer in development. Instead, we started to use a new approach in socializer, which, in theory, should allow us to switch language for spelling correction and other benefits a bit later. For now, available languages are Russian, Ukranian, English, Polish and Spanish, but more languages can be added by request.
|
||||
* When downloading a file (such as an audio file or document), the download process should be relatively faster due to some optimizations made in the function.
|
||||
* Socializer now uses just the first name of users in typing notifications.
|
||||
* socializer should be able to inform users about common errors when sending chat messages (such as sending messages to people in the current user's blacklist or banned from VK). Later, more errors related to posts will be added.
|
||||
* The application will load up to 100 audio albums instead of the default 10.
|
||||
|
||||
## Changes in Version 0.23 (11.11.2019)
|
||||
|
||||
### New additions
|
||||
|
||||
* Socializer is now more tolerant to internet issues. When attempting to create a wall post, comment, topic or send a chat message, if the data is unable to be posted to VK, socializer will allow you to try to post it again, giving you the opportunity to edit or copy the text of the post in case you want to save it for later.
|
||||
* Switching accounts is now supported in socializer. In the application menu, there is an option called "manage accounts" which allows you to add or remove an account. Socializer will take changes after a restart of the application. In case of having multiple accounts, every time Socializer starts, you will see a dialog from where is possible to choose the account for logging in.
|
||||
* when selecting multiple audio files in audio buffers, multiple actions can be performed in all items, these actions are present in the contextual menu of the buffer (namely play, add/remove from the library and move to a different playlist). This means you can select all the audios you want and Socializer will perform the selected options in all items, making it a bit easier to operate with multiple songs.
|
||||
* Now it is possible to like and see who liked a comment when displaying it individually. This applies to comments in wall posts and topics.
|
||||
* Now it is possible to choose how many items Socializer will load in conversation buffers, from the General tab in the preferences dialog. The default value is 50 items, and the maximum value is 200.
|
||||
* There is a new tab called buffer settings, in the preferences dialog. Settings related to how many items should be loaded in certain buffer types have been moved to this tab, so it will separate better the configuration options in the application.
|
||||
* Added management of the Blacklist on VK. Users can be blocked from people buffers (friends, online, or any buffer inside friend requests). You can access the blacklist from the application menu, located in the menu bar. From there, you can unblock any previously blocked user.
|
||||
* In the new timeline dialog, it is possible to create video buffers by selecting the "video" radio button as buffer type.
|
||||
|
||||
### bugfixes
|
||||
|
||||
* Fixed an error that was causing socializer to not update the "Online friends" buffer if chat notifications were disabled.
|
||||
* Fixed an error that was making Socializer unable to attach audio files from the computer, if the file does not include correct ID3 TAGS.
|
||||
* Fixed a traceback that was being logged when attempting to load an image but cancel the dialog for attaching it.
|
||||
* Fixed an error that was making Socializer to fail when loading the newsfeed buffer, thus not loading any other buffers. This error was caused due to VK sending a new object type representing push subscriptions. The item is ignored by Socializer so it will not break the newsfeed buffer anymore.
|
||||
* Fixed an error that was making the status bar to not fit the full size of the Window. This was cutting the messages placed on it, now, all messages are displayed properly again.
|
||||
* fixed an unhandled condition when playing a song and voice message at the same time, that was potentially making Socializer to stop loading certain buffers.
|
||||
* fixed an error that was making socializer unable to parse video data, thus video buffers were impossible to be loaded.
|
||||
|
||||
### Changes
|
||||
|
||||
* Less confidential user data will be send to the logs, so it will be much safer to pass logs publicly.
|
||||
* automatic update checks will be disabled if using socializer from the source code.
|
||||
* it is possible to post in an user's wall by using the post button located next to the user, in people buffers. This applies only to online users and list of friends.
|
||||
* When displaying a profile, information about mobile and home phone is displayed in the basic information tab.
|
||||
* In wall posts, all comments, including replies, will be displayed in the same list. Before, you had to open a comment to read its replies. When a new comment is posted by the current user, the list of comments will be reloaded and new additions will be fetched and sorted properly.
|
||||
|
||||
## changes in Versions 0.21 and 0.22 (14.07.2019)
|
||||
|
||||
### New additions
|
||||
|
||||
* Added "post in groups" feature. In order to do so, you need to load the posts for the group where you want to send something. Once loaded, go to the post button in the group's wall and select whether you want to post in the group's behalf or as yourself.
|
||||
* In all audio buffers, it is possible to select individual tracks to be played together. In order to do so, you need to press space to start the selection of items. When selected, the item will emit a sound to indicate the change. Press space in all items you want to select/unselect. When you're focusing an already selected item it will play a sound to indicate that it is already selected. Once you're done with your selection, pressing enter in the list of tracks will start the playback of the list of items you have selected. This is a very experimental feature. More actions can be supported based in this selection method if it proves to be useful.
|
||||
* In conversation buffers, it is possible to display and open wall posts sent as attachments in messages.
|
||||
* In people buffers, it is possible to create a new timeline by using the context menu while focusing an user. This method will create the buffer for the selected user, as opposed to creating the buffer from the menu bar, where you have to type the username or find it in a list.
|
||||
|
||||
### bugfixes
|
||||
|
||||
* Fixed an error with two factor authentication in the recent socializer version. Now it works reliably again.
|
||||
* Fixed an error when trying to attach a photo to a wall post. The error was fixed in the [vk_api](https://github.com/python273/vk_api) module and the fix was sent to the developer of the library, so he will be able to merge it in the next version. In the meantime, socializer already includes the fix for this method, so you can upload photos to wall posts normally.
|
||||
* Fixed an error retrieving some group information for the current session.
|
||||
* When posting in a topic, links will be posted properly.
|
||||
|
||||
|
||||
### Changes
|
||||
|
||||
* the audio player module has received some improvements:
|
||||
- When there is something being played, the label of the "play" button, located in all audio buffers, will change automatically to "pause". When pressed, it will pause the song instead of starting the playback again since the beginning.
|
||||
- The last change will work also in the dialog for displaying audio information. Now it's possible to play and pause an audio from such dialog.
|
||||
- When playing a voice message, if a song is playing already socializer will decrease the volume so you can hear the voice message well enough. Some seconds after the message has finished, the song's volume will be restored.
|
||||
* In audio buffers, you will play the focused audio when pressing enter in the item, instead of opening the audio information dialog.
|
||||
* Removed some old keystrokes in socializer buffers due to better alternatives. The reason for this change is that currently you don't need to be focusing an item in a buffer for being able to use the alternative keystrokes, which makes those a better implementation.
|
||||
- Control+Enter and control+Shift+Enter: superseeded by Control+P for playing (and pausing) the currently focused audio.
|
||||
- F5 and F6: superseeded by Alt+down and up arrows for modifying volume.
|
||||
|
||||
## changes in version 0.20 (25.04.2019)
|
||||
|
||||
### New additions
|
||||
|
||||
* For users with multiple soundcards, there is a new tab in the preferences dialogue of Socializer, called sound. From there, you can define which soundcard will be used for input and output. [#25,](https://code.manuelcortez.net/manuelcortez/socializer/issues/25)
|
||||
* the audio player can seek positions in the currently playing track. You can use the menu items (located in the main menu) or use the new available keystrokes dedicated to the actions. Seeking will be made in 5 second intervals.
|
||||
* Alt+Shift+Left arrow: Seek 5 seconds backwards.
|
||||
* Alt+Shift+Right arrow: Seek 5 seconds forwards.
|
||||
* it is possible to select the language used in socializer from the preferences dialog. When changing the language, the application must be restarted for the changes to take effect.
|
||||
* A new option, called open in vk.com, has been added in the context menu for almost all objects (items in home timeline, walls, documents, people, group topics and in buffers for conversations). This option will open the selected item in the VK website.
|
||||
* when opening the list of friends added by an user, you can display the context menu from an item on the list and view the user profile, open it in VK.com, among other actions. [#8,](https://code.manuelcortez.net/manuelcortez/socializer/issues/8)
|
||||
* When displaying a post, if you press enter in the button indicating how many people liked or shared the post, Socializer will display the listt of people who have liked or shared it. You can use the context menu in the list to do certain actions. [#38,](https://code.manuelcortez.net/manuelcortez/socializer/issues/38)
|
||||
* it is possible to retrieve more items for conversation buffers. Due to API limitations, it is possible to load up to the last 600 messages for every conversation. Take into account that the process of loading more items takes some time. You will hear a message when the process is done.
|
||||
* It is possible to delete entire conversations from the buffer's tree, by using the menu key and selecting "delete conversation". The conversation will be removed from VK.
|
||||
* When loading a topic in a group, socializer will display the latest 100 messages. In order to load more messages, you will find a button that will load the previous 100 messages present in the topic, or the amount of messages not loaded yet.
|
||||
|
||||
### bugfixes
|
||||
|
||||
* All spelling dictionaries are included by default for the following languages: Russian, English, German, French, italian, Polish, spanish and Turkish. Before, some dictionaries were missing and the spelling checker was failing.
|
||||
* Fixed an error in the default configuration template used for new sessions in the application. This error was making Socializer to fail when loading any conversation buffer.
|
||||
* Fixed an error in the algorithm to detect friends disconnecting from VK. This problem was interrupting the connection with the chat server every time it was happening, thus chat server's connection should be more reliable now.
|
||||
* The audio player should behave better in situations where a song is interrupted. Before, if you pressed "next song" while the currently playing sound was interrupted due to internet connection issues, two or more songs were played at the same time.
|
||||
* The bug reporting feature works normally again.
|
||||
|
||||
### Changes
|
||||
|
||||
* Updated method for accessing audio files due to the latest changes on VK apps.
|
||||
* When changing volume of the playing audio, it will decrease or increase the volume by 2% instead of 5%.
|
||||
* Read confirmations will be sent to VK as soon as you read the message. Before, read confirmations were being sent every 3 minutes to the social network.
|
||||
|
||||
## Changes in version 0.19 (13.03.2019)
|
||||
|
||||
* Added a new buffer called documents. When loading the buffer, it will contain all documents owned by the current user. The context menu of any item will allow you to download the document to your computer or remove it from VK.
|
||||
* A new buffer, called online, has been added in the friends section. It contains friends currently connected to VK. Items in this buffer will be added as soon as new friends are online in the social network, and will be removed when friends are offline. This buffer needs a lot of testing. Please report any possible inconsistency on this method.
|
||||
* Added new options to open the config and logs folder, these options are located in the help menu and may be useful during error reporting.
|
||||
* Added experimental support to "subscribers" buffer, inside frienship requests. This shows friend requests that have been declined by the current user.
|
||||
* the message when an user is typing in conversation buffers will be announced only if the socializer window is focused.
|
||||
* In "my audios" buffer, there is a button that allows a direct audio upload from your computer. The audio will be placed in your library.
|
||||
* Added experimental support to user and community polls:
|
||||
* If the poll is already closed or the user has send a vote to the poll previously, it will display only the results of the poll.
|
||||
* Otherwise it will display a dialog from where the user can vote in the current poll.
|
||||
* Fixed an error in Socializer that was making it unable to detect unread messages properly.
|
||||
* Socializer should save all tracebacks directly to error.log instead of displaying an error message during exit. ([#27,](https://code.manuelcortez.net/manuelcortez/socializer/issues/27))
|
||||
* When displaying user profiles, fixed an error where a married person without specifing relation partner would cause an error in the program. ([#29,](https://code.manuelcortez.net/manuelcortez/socializer/issues/29))
|
||||
* Socializer will load all conversations during startup, not only conversations with unread messages.
|
||||
* Added new global keystrokes, available in the main window.
|
||||
* Alt + up/down arrows: Increase / decrease volume.
|
||||
* Alt + Left/down arrows: Play previous and next song if playing an audios buffer.
|
||||
* Control + P: Play/pause.
|
||||
* control+Shift+P: Play all.
|
||||
* Fixed an error in the audio player that was skipping the first track if you were in the last song and pressed "play next" in the menu bar or via the keystroke.
|
||||
* Chats with unread messages will be placed at the top of the chats section. When a chat buffer receives a new message, socializer will move the buffer to the first position in the chats list. This should make easier for everyone to determine which chats contain unread items. ([#24,](https://code.manuelcortez.net/manuelcortez/socializer/issues/24))
|
||||
* In dialogs for displaying posts and comments, and also in the two edit boxes present in chat buffers, it is possible to select all by pressing Control+A.
|
||||
* Now it is possible to remove friends directly from the friends buffer. There is a new option for this purpose in the context menu for the focused friend. After being removed, the person will be placed in the subscribers buffer.
|
||||
* Deleted posts will display an error message when trying to view details about those. Before, the dialog was created and left blank.
|
||||
* Improvements in audio features present in Socializer:
|
||||
* The audio search feature has received improvements: Now it is possible to indicate wether the search will be performed by title or artist, and select to sort the results by duration, popularity or date of addition to VK.
|
||||
* Now it is possible to create and delete audio albums again.
|
||||
* Fixed errors when moving songs to albums. Now everything works as expected.
|
||||
* Added documents to the list of supported files when adding attachments to a wall post or private message.
|
||||
* It is possible to enable or disable proxy from the preferences dialog. The application must be restarted for this change to take effect.
|
||||
* Fixed an error that was making Socializer unable to display the changelog properly, when opened from the help menu. ([#21](https://code.manuelcortez.net/manuelcortez/socializer/issues/21))
|
||||
* When receiving chat messages and in some other situations, socializer will display all characters properly. Before, usernames were rendered using the internal code VK uses for them, and some unicode characters were displaying their HTML representation.
|
||||
* It is possible to retrieve previous items for the home buffer and walls (current user's wall and any other timeline):
|
||||
* For the home buffer, only a limited amount of items (around 700) can be loaded, supposedly due to VK API limits.
|
||||
* For walls, all posts should be possible to be loaded, however, testing with walls containing more than 2000 posts are not performed yet.
|
||||
* Added improvements to groups:
|
||||
* It is possible to load topics, audios, videos and documents for a group. In order to do so, you need to go to the group buffer and press the menu key, or right mouse click, in the tree item representing the group. New buffers will be created inside the current group's buffer.
|
||||
* You can create or delete all buffers for groups by pressing the menu key or right mouse click in the "communities" buffer.
|
||||
* There is support for group topics. When opening them, they will be displayed as a list of posts. You can like or reply to such posts, as well as adding new posts in the topic.
|
||||
* Authentication errors should be handled gracefully by the application:
|
||||
* When there is a password change, Socializer must be reauthorized again. An error message will indicate this if the user forgot to do that. After the error, the app will be restarted, prompting the user to introduce the new data for authorizing the application.
|
||||
* If the user introduced incorrect or invalid data, Socializer will display an error and prompt the user again for valid information.
|
||||
* If there is a connection problem when opening Socializer, it will display an error and inform the user about the issue.
|
||||
|
||||
## Changes in version 0.18 (21.01.2019)
|
||||
|
||||
* Changed authentication tokens in Socializer. It is mandatory to download a fresh copy of socializer and start a new configuration for your account.
|
||||
* Stable versions of Socializer are built with Python 3. Previous versions are built with Python 2, however support for Python 2 will be dropped very soon.
|
||||
* There is an installer file for Socializer, available in our downloads page. Installed version of Socializer will be more confortable for some people.
|
||||
* For users from countries where VK is not allowed, Socializer includes a proxy to bypass country restrictions. The first time you start socializer, it will ask you whether you need a proxy or not. It is suggested to use a proxy only if you need it.
|
||||
* Now it is possible to post in someone else's wall. When viewing a timeline of an user, the "post" button will post in his/her wall. To post in your own wall, you'll need to go to the newsfeed or your own wall and press the post button.
|
||||
* If you are not allowed to post in someone's wall, the post button will not be visible.
|
||||
* A new option for deleting wall posts has been added to the context menu in newsfeed and walls (current user's wall and timelines). This option will be visible only if the current user is allowed to delete the focused post.
|
||||
* Socializer will be able to handle all users correctly. Before, if an user that was not present in the local storage system was needed, the program was displaying "no specified user". ([#17,](https://code.manuelcortez.net/manuelcortez/socializer/issues/17))
|
||||
* It is possible to use user domains (short names for users) to create timelines. Just write @username and the program will create the needed timeline, regardless if the user is present in your friend list. ([#18,](https://code.manuelcortez.net/manuelcortez/socializer/issues/18))
|
||||
* When displaying someone's profile, the dialog should be loaded dramatically faster than before. A message will be spoken when all data of the profile is loaded.
|
||||
* When opening a timeline, if the current user is not allowed to do it, an error message should be displayed and the buffer will not be created. Before the buffer was partially created in the main window. ([#22.](https://code.manuelcortez.net/manuelcortez/socializer/issues/22))
|
||||
* Added basic support to handle group chats. At the current moment it is possible to receive and reply to chat messages only. Chat groups will be placed inside the conversations section. ([#23.](https://code.manuelcortez.net/manuelcortez/socializer/issues/23))
|
||||
* It is possible to delete a conversation buffer from the buffer menu. Deleting a conversation will only dismiss the buffer, no data is deleted at VK.
|
||||
* During the first start of Socializer, an invitation will be shown to join the Socializer's group in case the current user is not already a member.
|
||||
* It is possible to see how many people has read a wall post when showing it in the dialog. ([#28.](https://code.manuelcortez.net/manuelcortez/socializer/issues/28))
|
||||
* A new tab has been added to the preferences dialog. From the new section, it is possible to control whether socializer should create buffers for the first 1000 audio albums, video albums and communities when starting.
|
||||
* Added functionality regarding comments in wall posts:
|
||||
* when reading a post, you can press enter in any comment to display a dialog from where it is possible to view attachments, translate, check spelling or reply to the thread. If there are replies made to this comment, these will be visible in a section called replies. Pressing enter in a reply will also open the same dialog.
|
||||
* A new "replies" field has been added to the comments' list.
|
||||
* When writing a comment, it is possible to do the same actions available for a post (translate, spell checking and adding attachments).
|
||||
|
||||
## Changes in version 0.17 (01.01.2019)
|
||||
|
||||
* Added support for Two factor authentication (2FA). ([#13,](https://code.manuelcortez.net/manuelcortez/socializer/issues/13))
|
||||
* Added update channels in socializer. You can subscribe to the "stable" or "alpha" channel from the preferences dialog and you will receive updates published for those:
|
||||
* The stable channel will have releases every month, approximately, and is the channel where the code will be more tested and with less bugs. All support and help will be provided for the stable versions only.
|
||||
* The alpha channel will have releases every time a change is added to socializer, it may even include several releases in the same day, but we will try to release only a new version every day. Support will not be provided for alpha versions, as they will be used to test the latest code in the application.
|
||||
* Now it is possible to send voice messages from socializer. Voice messages are available from the "add" button in any conversation buffer.
|
||||
* tokens generated by socializer will never expire. ([#3,](https://code.manuelcortez.net/manuelcortez/socializer/issues/3))
|
||||
* In order to use all methods available in VK, socializer will use tokens of kate mobile for Android. It means you may receive an email by saying that you've authorised Kate for accessing your account from an Android device.
|
||||
* Audio albums are loaded correctly.
|
||||
* It is possible to play audios added by friends appearing in the news feed.
|
||||
* Adding and removing an audio file to your library works.
|
||||
* Unread messages will play a sound when focused.
|
||||
* Unread messages will be marked as read when user focuses them.
|
||||
* Socializer will handle restricted audio tracks. Restricted songs are not allowed to be played in the user's country. Before, playing a restricted track was generating an exception and playback could not resume. Now, playing an audio track will display an error notification.
|
||||
* Fixed an error when people were trying to open a post in an empty buffer, or accessing the menu when there are no posts in the buffer.
|
||||
* Now Socializer will not send a notification every 5 minutes.
|
||||
* the chat widget now is a multiline text control. It means it is possible to add a new line by pressing shift+Enter, and send the message by pressing enter.
|
||||
* Socializer should handle connection errors when loading items in buffers and retry in 2 minutes. Also, connection errors in the chat server are handled and chat should be able to reconnect by itself.
|
||||
* When trying to add an audio or video to an album, if the current user does not have any album, it will display an error instead of a traceback.
|
||||
* Added popular and suggested songs. This will not work when using alternative tokens.
|
||||
* Now it is possible to update the status message, located in your profile.
|
||||
* Now it is possible to upload an audio from your computer when adding attachments in a wall post. When adding attachments to a post or message in a conversation, you will have two options: upload from your computer and add a file from your VK profile.
|
||||
* Updated Russian translation: thanks to Дарья Ратникова.
|
||||
* Fixed some conditions, especially when rendering items in feeds, that were making the client to crash.
|
||||
* new versions will include documentation and changelog.
|
||||
* A new option for reporting issues directly from the help menu has been added. Issues will be publicly available in the [Project Issues page](https://code.manuelcortez.net/manuelcortez/socializer/issues)
|
||||
|
||||
## Changes in version 0.16 (13.12.2018)
|
||||
|
||||
* Added two more buffers: "Pending requests" and "I follow", located in the people buffer, under "friendship requests".
|
||||
* Added an experimental photo viewer. Will show options for displaying the next and previous photo if the current post contains multiple images. Fullscreen button still doesn't work.
|
||||
* Improved the chat features present in the application. Read documentation to get a full understanding about how it works now.
|
||||
* Added video management (my videos, video albums and video search). For playing videos, you will be redirected to a website in your browser due to the VK'S policy.
|
||||
* Added a setting that allows you to specify if you want socializer to load images when you are opening posts. It could be useful for slow connections or those who don't want images to be loaded.
|
||||
* Added basic tagging for users in posts and comments. You can tag only people in your friends buffer.
|
||||
* Added a basic user profile viewer.
|
||||
* Added support for listening voice messages in chats. Currently it is not possible to send them.
|
||||
* Fixed an error that was making Socializer unable to display chat history properly. It was showing the first 200 items in a conversation instead the last 200 items. Now chat will be displayed accordingly.
|
||||
* Changed the chat history widget from list of items to a read only text box, similar to how it was displayed in skype. Now the widget should be fully visible and messages will work in the same way.
|
||||
* It is possible to play songs sent in a chat message by opening them from the attachments panel.
|
||||
* Reimplemented most of the audio playback methods (audio albums buffer still not working).
|
||||
* Added some notifications and chat notifications when friends are online and offline. Most notifications can be configured from settings.
|
||||
|
||||
## Changes in build 2016.07.08 (08/07/2016)
|
||||
|
||||
* Removed platform from "last seen" column in the friends list as it could cause some problems and it was being not so exact.
|
||||
* Now deleted audios are not parsed and displayed as "audio removed from library". They are silently ignored.
|
||||
* It's possible to open a friends timeline for others.
|
||||
* Fixed some strange bugs in the built version.
|
||||
* Deactivated accounts will not cause problems in friends lists. They will be displayed as deactivated, wich means that it'll be impossible to interact with those accounts.
|
||||
* When opened, the client will set online for the user account, it'll inform VK that this user is currently online. This parameter will be updated every 15 minutes, as stated in the API documentation.
|
||||
* When opened, socializer will try to create chat buffers for all unread messages.
|
||||
* Update some information on certain posts when an item is selected. For example, update the date of a post.
|
||||
* Read messages will be marked as read in the social network, so it'll cause that your friends could see that you have read the message and socializer will not load chat buffers with read messages at startup.
|
||||
* Included a brief manual in the help menu. Currently available only in English.
|
||||
* Included a context menu in list items. Currently there are functions not available. Menu for chat buffers is not implemented yet.
|
||||
* Implemented audio album load (in the music buffer), creation (in the application menu) and deletion (in the application menu, too).
|
||||
* audios can be moved to albums by pressing the menu key or doing a right click in the item, and selecting "move to album". Audios will be added to the album in the next update (there is a programmed update every 3 minutes), or you can update the buffer manually (from the buffer menu in the menu bar). This option will be available in audio buffers (searches, popular and recommended audio buffers, and audio timelines).
|
||||
* Albums will be empty at startup. In order to get the album's audios, you'll have to navigate to the album and press the button "load". It'll load the needed information for displaying and playing the added songs
|
||||
* If the config is invalid (for example you changed email or phone in the VK site and didn't changed that in Socializer, or just entered invalid credentials), the program will display an error with instructions for fixing the problem.
|
||||
* Now is possible to press enter in the password or email/phone field and it'll do the action of the OK button.
|
||||
* If you have set russian as the main language in the VK site, you'll see names in genitive and instrumental cases in certain phrases.
|
||||
* Updated russian and spanish translations.
|
||||
|
||||
## Changes on build 2016.05.25
|
||||
|
||||
* Added grouped controls in the audio searches dialogue. It will be more accessible so screen readers could detect and read the label for radio buttons.
|
||||
* Added documents to the list of supported attachments in the post viewer. The action for this kind of attachments is to open the default web browser, pointing to the URL address of that file.
|
||||
@@ -23,7 +271,4 @@
|
||||
* Added more options in the search audio dialog. Now users could use more parameters and searches will be more precise.
|
||||
* Added a new attachments' list. When a post is opened, this list will show up if there are attachments in the current post (attachments are audio, photos, video and links). You will be able to interact with the supported data (at the moment only photos, videos, audio and links are supported, more will be added in future).
|
||||
* Added a changelog file which could be opened from the help menu.
|
||||
* Added a preferences dialogue and a new application menu in the menu bar. From this dialogue you can change the number of items to be loaded for every buffer.
|
||||
|
||||
---
|
||||
© 2016, manuel cortéz.
|
||||
* Added a preferences dialogue and a new application menu in the menu bar. From this dialogue you can change the number of items to be loaded for every buffer.
|
@@ -1,2 +0,0 @@
|
||||
Manuel E. Cortéz
|
||||
Valeria K
|
12
doc/application.py
Normal file
12
doc/application.py
Normal file
@@ -0,0 +1,12 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
name = "Socializer"
|
||||
version = "0.13"
|
||||
author = u"Manuel Cortéz"
|
||||
authorEmail = "manuel@manuelcortez.net"
|
||||
copyright = u"Copyright (C) 2016, Manuel cortéz."
|
||||
description = unicode(name+" Is an accessible VK client for Windows.")
|
||||
url = "https://github.com/manuelcortez/socializer"
|
||||
update_url = "https://raw.githubusercontent.com/manuelcortez/socializer/master/update-files/socializer.json"
|
||||
# The short name will be used for detecting translation files. See languageHandler for more details.
|
||||
short_name = "socializer"
|
||||
translators = [u"Valeria K (Russian)", u"Manuel Cortez (Spanish)"]
|
29
doc/documentation_importer.py
Normal file
29
doc/documentation_importer.py
Normal file
@@ -0,0 +1,29 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from codecs import open
|
||||
""" This script converts the hold documentation (saved in markdown files) in a python file with a list of strings to translate it using gettext."""
|
||||
|
||||
def prepare_documentation_in_file(fileSource, fileDest):
|
||||
""" This takes documentation written in a markdown file and put all the contents in a python file, to create a translatable documentation.
|
||||
@fileSource str: A markdown(.md) file.
|
||||
@fileDest str: A file where this will put the new strings"""
|
||||
|
||||
f1 = open(fileSource, "r", encoding="utf-8")
|
||||
f2 = open(fileDest, "w", encoding="utf-8")
|
||||
lns = f1.readlines()
|
||||
f2.write("# -*- coding: utf-8 -*-\n")
|
||||
f2.write("documentation = [\n")
|
||||
for i in lns:
|
||||
if "\n" == i or i.splitlines()[0] == "":
|
||||
newvar = "\"\",\n"
|
||||
elif "\n" == i[-1]:
|
||||
newvar = "_(u\"\"\"%s\"\"\"),\n" % (i.splitlines()[0])
|
||||
else:
|
||||
newvar = "_(u\"\"\"%s\"\"\"),\n" % (i)
|
||||
f2.write(newvar)
|
||||
f1.close()
|
||||
f2.write("]")
|
||||
f2.close()
|
||||
|
||||
|
||||
prepare_documentation_in_file("manual.md", "strings.py")
|
||||
prepare_documentation_in_file("changelog.md", "changelog.py")
|
62
doc/generator.py
Normal file
62
doc/generator.py
Normal file
@@ -0,0 +1,62 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
import gettext
|
||||
import os
|
||||
import locale
|
||||
import markdown
|
||||
import shutil
|
||||
from codecs import open as _open
|
||||
from importlib import reload
|
||||
|
||||
def change_language(name, language):
|
||||
global _
|
||||
os.environ["lang"] = language
|
||||
_ = gettext.install(name, os.path.join(os.getcwd(), "locales"))
|
||||
|
||||
languages = ["en", "ru"]
|
||||
|
||||
def generate_document(language, document_type="documentation"):
|
||||
translation_file = "socializer-documentation"
|
||||
change_language(translation_file, language)
|
||||
if document_type == "documentation":
|
||||
reload(strings)
|
||||
markdown_file = markdown.markdown("\n".join(strings.documentation[1:]), extensions=["markdown.extensions.toc"])
|
||||
title = strings.documentation[0][1:]
|
||||
filename = "manual.html"
|
||||
elif document_type == "changelog":
|
||||
reload(changelog)
|
||||
markdown_file = markdown.markdown("\n".join(changelog.documentation[1:]), extensions=["markdown.extensions.toc"])
|
||||
title = changelog.documentation[0][1:]
|
||||
filename = "changelog.html"
|
||||
first_html_block = """<!doctype html>
|
||||
<html lang="%s">
|
||||
<head>
|
||||
<title>%s</title>
|
||||
<meta charset="utf-8">
|
||||
</head>
|
||||
<body>
|
||||
<header><h1>%s</h1></header>
|
||||
""" % (language, title, title)
|
||||
first_html_block = first_html_block+ markdown_file
|
||||
first_html_block = first_html_block + "\n</body>\n</html>"
|
||||
if not os.path.exists(os.path.join("documentation", language)):
|
||||
os.mkdir(os.path.join("documentation", language))
|
||||
mdfile = _open(os.path.join("documentation", language, filename), "w", encoding="utf-8")
|
||||
mdfile.write(first_html_block)
|
||||
mdfile.close()
|
||||
|
||||
def create_documentation():
|
||||
print("Creating documentation in the supported languages...\n")
|
||||
if not os.path.exists("documentation"):
|
||||
os.mkdir("documentation")
|
||||
if os.path.exists(os.path.join("documentation", "license.txt")) == False:
|
||||
shutil.copy(os.path.join("..", "license.txt"), os.path.join("documentation", "license.txt"))
|
||||
for i in languages:
|
||||
print("Creating documentation for: %s" % (i,))
|
||||
generate_document(i)
|
||||
generate_document(i, "changelog")
|
||||
print("Done")
|
||||
|
||||
change_language("socializer-documentation", "en")
|
||||
import strings
|
||||
import changelog
|
||||
create_documentation()
|
185
doc/manual.md
Normal file
185
doc/manual.md
Normal file
@@ -0,0 +1,185 @@
|
||||
# Socializer's manual
|
||||
|
||||
## Introduction
|
||||
|
||||
Socializer is an application to use [VK.com](https://vk.com) in an easy and accessible way with minimal CPU resource usage. Socializer will allow you to interact with the VK social network by giving you access to the most relevant features such as:
|
||||
|
||||
* Supports two factor authentication (2FA).
|
||||
* Post creation in user and community walls.
|
||||
* audio support.
|
||||
* Post comments.
|
||||
* like, unlike and repost other's posts.
|
||||
* Open other's timelines so you could track their friends, posts, audio or video files.
|
||||
* Basic chat features.
|
||||
|
||||
## Usage
|
||||
|
||||
In order to use socializer, you must have an account in the [VK](https://vk.com) website. The process for registering an account is very accessible and is not covered in this manual. In the documentation, it is assumed you have a registered account on VK and you are able to sign in in the website by providing your phone number or email address, and a password. You will require this data for signing in the application later.
|
||||
|
||||
## authorising the application
|
||||
|
||||
First of all, it's necessary to authorise the application so it can access your VK account and act on your behalf. The authorisation process is quite simple, and will be required only once. In order to start the authorisation process, you just need to run the executable file called "socializer.exe" (on some computers it will appear only as socializer, depending if windows explorer is set to display file extensions or not). You may like to place a Windows shortcut in your desktop for an easier access to the application.
|
||||
|
||||
If this is the first time you have launched socializer, you will see a message asking you whether socializer should connect through a proxy server, already configured in the application, or use the system network settings. This allows people from countries where VK is blocked to use the social network without having to look for a proxy server themselves. It is highly adviced to use the proxy server only if you are in need of it.
|
||||
|
||||
After the proxy message, you will see a new message dialog asking you to proceed with the account authorisation process. It consists in providing the authentication data you normally use to sign in VK. It is very important to know that this data will be stored in a folder called config, located in the same folder where the socializer files are. Your config folder is a very important storage for your authentication data, so you must be sure you never will share it with anyone, mostly because your data is stored as plain text (this will be fixed in a future release and your data will be properly encrypted). Socializer will need your authentication data for acting in your behalf and offering you a better experience that what it could do with a simple access token. You must provide your phone number or email address in the first text box, and your password in the second. When pressing OK, your data will be saved and the application will start to retrieve all the required information for showing your buffers. If you have two factor authentication configured in your account, you will see an additional dialog where you have to type the code provided by VK via SMS.
|
||||
|
||||
It is worth saying that whenever you change your password in the VK website, you will need to authorize Socializer again. When you open socializer after changing your password, you will see a message informing you of the problem and the application will be restarted, allowing you to write your new data and start the authorization again.
|
||||
|
||||
Once started, the application will start loading your data (posts, audio files, conversations, friends). When done, it will show you a notification indicating that the program is ready.
|
||||
|
||||
## General concepts
|
||||
|
||||
Before starting to describe Socializer's usage, we'll explain some concepts that will be used extensively throughout this manual.
|
||||
|
||||
### Buffer
|
||||
|
||||
A buffer is a list of items that will manage the data which arrives from VK, after being processed by the application. When you configure your account on Socializer and start it, many buffers are created. Each of them may contain some of the items which this program works with: Newsfeed posts, wall posts, audio and video files, documents, friendship requests and conversations. According to the buffer you are focusing, you will be able to do different actions with these items.
|
||||
|
||||
All buffers will be updated in one of the following ways:
|
||||
|
||||
* Periodically: Most buffers containing posts, audio or video files and people, will be updated periodically to reflect the new additions to them. Updates will be every 2 minutes for every buffer, so if you posted something and did not see the post in the buffer, you may need to wait a moment. There is an option, located in the buffer menu on the menu bar, which allows you to trigger a manual update in the current buffer.
|
||||
* Real time: Conversation buffers will be updated every time someone sends a message to you. When an user sends you a message, if there is not a conversation buffer created to receive the message, a new conversation buffer will be opened automatically and the message will be placed on it. If you already have an opened conversation for the user sending the message, the message will be placed at the end of the buffer. A different sound will indicate whether a new conversation has been opened or an existing buffer gets updated. Socializer will sort conversation buffers by placing buffers with unread messages at the top of the conversations section. When a buffer gets a new message, it will be moved automatically to the first place in the conversations category.
|
||||
|
||||
### item
|
||||
|
||||
An item is an element representing some data provided by VK. Items are separated in buffers which stores items of the same type: Audio buffers will contain only audio files, wall buffers will be full of wall posts. The only exception to this rule is the newsfeed buffer, which can contain different kind of items. Actions are available in a per-item basis, allowing certain items to be treated differently than others and showing different dialogs, depending in the kind of data VK sends for them. All items show a menu with their available actions by focusing them in the list and pressing the menu key or a right mouse click.
|
||||
|
||||
The following is a brief description of the kind of items socializer can work with, and what actions are available for those.
|
||||
|
||||
* Newsfeed post: It represents a post displayed in your "home" page on VK. It may contain a variety of information based in what you or your friends do. A newsfeed item may contain information about new audios added to your friend's library, new people added to friends, wall posts, reposts and new photos added. Depending on the kind of data VK has supplied, the item can open a dialog showing information about the post, a list displaying the people added to friends, or a dialog displaying information for every audio added to library. If a wall post contains a long message, only the first 140 characters will be displayed. You can open the post to read the full message in the dialog. Available options for this item are different depending in the information the item contains. You can open or view the profile of the user that generated the item, like, dislike or add a comment to a post.
|
||||
* Wall post: Represents a post in an user's wall. This post will be similar to wall posts displayed in the newsfeed. If a wall post contains a long message, only the first 140 characters will be displayed. You can open the post to read the full message in the dialog. When opened (by pressing enter or the open option in the associated menu), it will show a dialogue where you can read the message, see how many times the post has been viewed by other users, interact with attachment files (by searching the list and pressing enter in the focused attachment to open it), see the photos included in the post, read information related to likes and times the post has been shared, read and reply to comments. Additionally, you can share the post, indicate you like it, or add a comment. You can cycle through every item in the dialog by pressing tab.
|
||||
* Audio: It represents an audio uploaded to the VK'S platform. Actions available for this item are opening the audio in a dialog, add or remove it from your library, move the audio to a playlist, and play it. When opened, it will be displayed in a dialog allowing you to read the title of the song, artist name, duration and a few buttons: play, add or remove from your library and download. You can control playback of audio items from the buffer by using the player menu on the menu bar or the corresponding keyboard shortcuts. Additionally, it is possible to select multiple audios in the same buffer to perform specific actions on them, such as play, remove or add the selected audios to a playlist. In order to select multiple audios, press the spacebar in every audio item you want to select. You will hear a sound when an item is selected, and when you focus a selected audio. When you're done, press enter to play all the selected audios or use the context menu to see available actions. All actions will be applied in the selected audios.
|
||||
* Video: It represents a video uploaded to the VK'S platform. Actions available for this item are opening the video in your default web browser and move it to a video album. When opened, it will open a web browser and play the video automatically due to VK limitations in access to video files.
|
||||
* person: It contains information about a VK user, this item is present in all buffers under the "people" category. Actions available for this item are view user profile, send message and create a timeline, which is a special buffer to track all posts, friends, audios or videos owned by the user. When opened, it will display the profile of this user in a dialog and will provide actions to send a message to the user, or view other sections of her/his profile.
|
||||
* Message: A message appears only in conversation buffers and represents a chat message. It may include a list of attached files that will be displayed in a separated list. You can tab to that list (from the history) and press enter in the attached file you want to open. Chat items are marked as read automatically as soon as they are focused.
|
||||
|
||||
## Main interface
|
||||
|
||||
The graphical user interface of Socializer consists of a window containing:
|
||||
|
||||
* a menu bar accomodating five menus (application, Me, buffer, player and help),
|
||||
* One tree view, where you can press the menu key or right mouse click to display a context menu which contains actions you can apply in the selected buffer,
|
||||
* One list of items, which also accepts the menu key to display actions available for the selected item,
|
||||
* Some buttons, depending which is the focused buffer.
|
||||
|
||||
The actions that are available for every item will be described later.
|
||||
|
||||
In summary, the GUI contains two core components. These are the controls you will find while pressing the Tab key within the program's interface, and the different elements present on the menu bar.
|
||||
|
||||
### Buttons in the application
|
||||
|
||||
* Post: this button opens up a dialogue box to write a post in the wall of the focused user. For example, if you are in the "my wall" buffer you will send a post to your own wall, but if you are in an user timeline the post will be sent to the owner of the timeline. You can upload an attachment by pressing the "attach" button and choosing between uploading a photo, audio file or document in the dialog which will appear, check spelling or translate your message by selecting one of the available buttons in the dialogue box. In addition, you can tag a friend in your post by pressing the corresponding button for that purpose. Also it is possible to configure the privacy settings for your post by allowing all users or just your friends to read it. Press the send button to send the post.
|
||||
* Load buffer: Some buffers are created but not loaded in VK. These special buffers need to be loaded manually by pressing the load button. Once loaded, this kind of buffers will behave in the same way other buffers do. Examples of these buffers are audio and video albums, community walls, and the current user's documents
|
||||
* Play: In audio buffers, plays the focused song. In video buffers, this button will open a web browser for playing the focused video, due to a limitation VK placed to third party developers with videos.
|
||||
* Play all: In audio buffers, play all songs starting from the focused buffer, until the last item in the list.
|
||||
* Send message: Send a message to a friend, which will open a conversation buffer if it does not exist already. Conversation buffers contain a full conversation, accommodating chat messages, between the current user and someone else. You can type your message in the provided box and press enter to send it to your friend. Additionally, You can upload an attachment by pressing the "attach" button and choosing between uploading a photo, audio file or record a voice message in the dialog which will appear, and open attachments sent in the focused message by pressing tab and finding them in the attachments list.
|
||||
|
||||
Bear in mind that buttons will appear according to which actions are possible on the list you are browsing.
|
||||
|
||||
## Menus
|
||||
|
||||
Visually, Towards the top of the main application window, A menu bar can be found which contains many of the same functions as listed in the previous section, together with some additional items. To access the menu bar, press the alt key. You will find five menus listed: application, Me, buffer, player and help. This section describes the items on each one of them.
|
||||
|
||||
### Application menu
|
||||
|
||||
* Create: opens a menu where you can create a new album. At the moment, only audio and video albums are supported.
|
||||
* Delete: opens a menu where you can delete an already existing album owned by yourself. Only audio and video albums are supported at this time.
|
||||
* blacklist: Opens a dialog which allows you to manage blocked people on VK.
|
||||
* Manage accounts: Opens up a dialogue from where you are able to add or delete an account in socializer. If you have more than an account, you will be asked at startup for the account you want to use in the application. You can use an account at once, but it is possible to have multiple accounts and switch between them by restarting the application.
|
||||
* Preferences: Opens a dialogue which lets you configure settings for the entire application.
|
||||
|
||||
### Me menu
|
||||
|
||||
* Profile: Opens a menu with several options to do in your profile:
|
||||
* View profile: Displays your profile in a dialog in the application.
|
||||
* Open in browser: Redirects you to your profile in vk.com.
|
||||
* Set status message: Opens up a dialog where you can write your status message. The status message is displayed in your profile and can contain up to 140 characters.
|
||||
|
||||
### Buffer menu
|
||||
|
||||
* New timeline: Lets you open an user's timeline by choosing the user in a dialog box. You can choose which items you want to track: wall posts, videos, friends or audio items. It is created when you press enter. If you invoke this option relative to a user that has no items of the kind you specified, the operation will fail. If you try creating an existing timeline the program will warn you and will not create it again.
|
||||
* Search: Shows a menu where you can search for audios or videos on VK. Search results will be created in a new buffer inside "music" or "videos".
|
||||
* Update buffer: Performs a manual update operation in the buffer, which will retrieve all new items present in the social network since the last update.
|
||||
* Load previous items: This allows more items to be loaded for the specified buffer. Bear in mind that not all buffers support this setting.
|
||||
* Remove buffer: dismisses the list you're on, if possible.
|
||||
|
||||
### Player menu
|
||||
|
||||
* Play: Plays the currently focused audio item, if the current buffer contains audio files. If not, plays the focused audio in the "my music" buffer.
|
||||
* Play all: Plays all audio items in the current buffer or the "my music" buffer, starting by the currently focused audio item until the last audio in the list.
|
||||
* Stop: Stops audio playback.
|
||||
* Previous: Plays the previous audio in the buffer or the last item in the list, if the current audio was the first on the buffer.
|
||||
* Next: Plays the Next audio in the buffer or the first item in the list, if the current audio was the last on the buffer.
|
||||
* Shuffle: Plays all audios in the current buffer or the "my music" buffer shuffled.
|
||||
* Volume up: Increases volume by 5%.
|
||||
* Volume down: decreases volume by 5%.
|
||||
* Mute: Mutes audio playback, setting volume to 0%.
|
||||
|
||||
### help menu
|
||||
|
||||
* About Socializer: shows the credits of the program.
|
||||
* Documentation: opens up this file, where you can read some useful program concepts.
|
||||
* Check for updates: every time you open the program it automatically checks for new versions. If an update is available, it will ask you if you want to download the update. If you accept, the updating process will commence. When complete, Socializer will be restarted. This item checks for new updates without having to restart the application.
|
||||
* Changelog: opens up a document with the list of changes from the current version to the earliest.
|
||||
* Open logs directory: Opens windows explorer in the logs directory, useful to include your logs in a bug report.
|
||||
* Open config directory: Opens Windows explorer in your config directory.
|
||||
* Report an error: opens up a dialogue box to report a bug by completing a small number of fields. Pressing enter will send the report. If the operation doesn't succeed the program will display a warning.
|
||||
|
||||
## Keyboard shortcuts
|
||||
|
||||
Socializer includes some keyboard shortcuts, available from any buffer. Here you have the list of the available shortcuts:
|
||||
|
||||
* Enter: Execute the default action for the focused item. It may be opening a post, view friends added by someone else, view audio details or opening an user profile. You need to be in the items list for using this key.
|
||||
* Alt+Up/down: Increase and decrease audio volume by 5%.
|
||||
* Control+P: Play/pause. If this is the firt time you press this keystroke, it will automatically play all items present in the focused buffer or in your audios.
|
||||
* control+Shift+P: Play all audio tracks. If the currently focused buffer does not contain audio items, it will play all items present in your audios buffer.
|
||||
* Alt+Left: Play the previous song.
|
||||
* Alt+Right: Play the next song.
|
||||
|
||||
## configuration
|
||||
|
||||
As described above, this application has a preferences dialogue accessible under the application menu. Here you have a brief description of the settings present in this dialogue.
|
||||
|
||||
### General tab
|
||||
|
||||
* Language: allows you to switch the interface language for socializer. The application must be restarted after changing the language.
|
||||
* Load images in posts: Allows you to specify whether you want socializer to display all images when opening a post, or not. This can be useful for people with slow connections or not needing images.
|
||||
* Use proxy: for countries where Vk is blocked by the internet providers, this settings allows socializer to connect via a proxy server already included in the application.
|
||||
* Update channel: allows you to specify how often you will receive updates for the program. There are two update channels available: Alpha channel, which contains unstable versions of the application and gets updates almost dayly, and stable, which contain tested and more stable versions of the program, but gets updates once in a month, approximately.
|
||||
|
||||
### Buffer settings tab
|
||||
|
||||
* Number of items to load for newsfeed and wall buffers: Allows you to specify how many items should be retrieved from VK in the newsfeed buffer and when opening walls for other users. Default is 50 items, and maximum is 100.
|
||||
* Number of items to load in video buffers: Allows you to specify how many items should be retrieved from VK in video buffers. Default is 50, maximum value is 200.
|
||||
* Number of items to load in conversation buffers: allows you to specify how many messages Socializer will retrieve when loading a conversation. Default is 50, maximum value is 200.
|
||||
|
||||
### Chat settings tab
|
||||
|
||||
* Show notifications when users are online/offline: These two checkboxes allows you to specify if you want socializer to notify you when someone is connected or disconnected in the VK network.
|
||||
* Notification type: This setting allows you to specify the notification type you prefer to use in socializer. The options are native and custom. Native notifications send a system notification every time someone is online or offline, while custom notifications play a sound and announce the notification in the screen reader only.
|
||||
|
||||
### Optional buffers tab
|
||||
|
||||
This section allows you to specify which buffers should be precreated every time socializer starts. This kind of buffers, namely audio playlists, video albums and communities, have a special way of being created. When a buffer of the previously mentioned types is created, the buffer is added to the corresponding section but no data is loaded from VK. In order to load the data for one of these buffers you have to press the load button present in the buffer. From this tab you can mark and unmark the buffers Socializer will create when it starts. By default, buffers for audio playlists, video albums and communities are not created automatically when Socializer starts.
|
||||
|
||||
## License and source code
|
||||
|
||||
Socializer is free software, licensed under the GNU GPL license, either version 2 or, at your option, any later version. You can view the license in the file named license.txt, or online at <http://www.gnu.org/licenses/old-licenses/gpl-2.0.html>.
|
||||
|
||||
The source code of the program is available at <https://code.manuelcortez.net/manuelcortez/socializer>.
|
||||
|
||||
## Contact
|
||||
|
||||
If you still have questions after reading this document, if you wish to collaborate to the project in some other way, or if you simply want to get in touch with the team, [join the Socializer's community in VK.](https://vk.com/socializer.club) You can also visit [The project website.](http://socializer.su)
|
||||
|
||||
## Credits
|
||||
|
||||
Socializer is developed and maintained by [Manuel Cortez.](https://manuelcortez.net)
|
||||
|
||||
We would also like to thank the translators of Socializer, who have allowed the spreading of the application.
|
||||
|
||||
* English: Manuel Cortéz.
|
||||
* Russian: Дарья Ратникова.
|
||||
|
||||
Special thanks to Дарья Ратникова, as she also manages the Socializer's community in VK, translates the website and the documentation into Russian.
|
5
doc/translate.py
Normal file
5
doc/translate.py
Normal file
@@ -0,0 +1,5 @@
|
||||
from babel.messages.frontend import CommandLineInterface
|
||||
|
||||
CommandLineInterface().run(['pybabel', 'extract', '-o', 'socializer-documentation.pot', '.'])
|
||||
#CommandLineInterface().run(['pybabel','compile','-d','../src/locales'])
|
||||
CommandLineInterface().run(['pybabel','update', '--input-file', 'socializer-documentation.pot', '--domain', 'socializer-documentation', '--output-dir', '../src/locales'])
|
@@ -1,14 +0,0 @@
|
||||
#! /usr/bin/env python# -*- coding: iso-8859-1 -*-
|
||||
import shutil
|
||||
|
||||
def create_build():
|
||||
os.chdir("../src")
|
||||
print "Current path is {0}".format(os.getcwd())
|
||||
subprocess.call(["C:\python27x86\python.exe", "setup.py", "py2exe"])
|
||||
|
||||
def create_archive():
|
||||
print "Creating zip archive..."
|
||||
shutil.make_archive("socializer-nightly-build", "zip", "socializer")
|
||||
shutil.rmtree("socializer")
|
||||
|
||||
create_archive()
|
Binary file not shown.
28
requirements.txt
Normal file
28
requirements.txt
Normal file
@@ -0,0 +1,28 @@
|
||||
wxpython==4.0.3
|
||||
pywin32
|
||||
markdown
|
||||
# For the moment we will use the modified vk_api version that does not try to include enum34 and
|
||||
# already fixed the caption for wall uploaded photos.
|
||||
# Hopefully I can uncomment this in the near future when my changes will get merged upstream.
|
||||
#vk_api
|
||||
bs4
|
||||
configobj
|
||||
pypubsub
|
||||
requests-oauthlib
|
||||
future
|
||||
arrow
|
||||
backports.functools_lru_cache
|
||||
yandex.translate
|
||||
mutagen
|
||||
mock
|
||||
babel
|
||||
# cx_freeze for building the executable files.
|
||||
cx_freeze
|
||||
symspellpy
|
||||
# forked repositories previously found at http://q-continuum.net
|
||||
git+https://code.manuelcortez.net/manuelcortez/libloader
|
||||
git+https://code.manuelcortez.net/manuelcortez/platform_utils
|
||||
git+https://github.com/chrisnorman7/sound_lib
|
||||
git+https://code.manuelcortez.net/manuelcortez/accessible_output2
|
||||
# Modified vk_api.
|
||||
git+https://github.com/manuelcortez/vk_api
|
@@ -1,53 +0,0 @@
|
||||
#!/bin/bash
|
||||
# Define paths for a regular use, if there are not paths for python32 or 64, these commands will be taken.
|
||||
pythonpath32="/C/python27x86"
|
||||
pandocpath="pandoc.exe"
|
||||
|
||||
help () {
|
||||
echo -e "$0 | usage:"
|
||||
echo -e "$0 | \t./build.sh [-py32path <path to python for 32 bits> | -h]"
|
||||
}
|
||||
|
||||
# parsing options from the command line
|
||||
while [[ $# > 1 ]]
|
||||
do
|
||||
key="$1"
|
||||
shift
|
||||
|
||||
case $key in
|
||||
-py32path)
|
||||
pythonpath32="$1"
|
||||
shift
|
||||
;;
|
||||
-help)
|
||||
help
|
||||
;;
|
||||
*)
|
||||
help
|
||||
esac
|
||||
done
|
||||
|
||||
cd ../src
|
||||
if [ -d build/ ];
|
||||
then
|
||||
rm -rf build
|
||||
fi
|
||||
if [ -d dist/ ];
|
||||
then
|
||||
rm -rf dist
|
||||
fi
|
||||
if [ -d documentation/ ];
|
||||
then
|
||||
rm -rf documentation
|
||||
fi
|
||||
mkdir documentation
|
||||
cp ../changelog.md documentation/changelog.md
|
||||
cd documentation
|
||||
$pandocpath -s changelog.md -o changelog.html
|
||||
rm changelog.md
|
||||
cd ..
|
||||
$pythonpath32/python.exe "setup.py" "py2exe" "--quiet"
|
||||
mv -f dist ../nightly/socializer
|
||||
rm -rf build
|
||||
cd ../nightly
|
||||
$pythonpath32/python.exe make_zipversion.py
|
32
scripts/generate_update_file.py
Normal file
32
scripts/generate_update_file.py
Normal file
@@ -0,0 +1,32 @@
|
||||
#! /usr/bin/env python
|
||||
import os
|
||||
import json
|
||||
|
||||
print("Generating update files for Socializer...")# Determine if we are going to write stable or alpha update file.
|
||||
# Stable file is when we build tags and alpha otherwise.
|
||||
version = os.environ.get("CI_COMMIT_TAG") or os.environ.get("CI_COMMIT_SHORT_SHA")
|
||||
if os.environ.get("CI_COMMIT_TAG") == None:
|
||||
version_type = "alpha"
|
||||
else:
|
||||
version_type = "stable"
|
||||
print("Version detected: %s" % (version_type,))
|
||||
|
||||
# Read update description and URL'S
|
||||
if version_type == "alpha":
|
||||
description = os.environ.get("CI_COMMIT_MESSAGE")
|
||||
urls = dict(Windows32="http://socializer.su/static/files/alpha/socializer_x86_alpha.zip", Windows64="http://socializer.su/static/files/alpha/socializer_x64_alpha.zip")
|
||||
else:
|
||||
with open("update-description",'r') as f:
|
||||
description = f.read()
|
||||
urls=dict(Windows32="http://socializer.su/static/files/{v}/socializer_{v}_x86.zip".format(v=version[1:]), Windows64="http://socializer.su/static/files/{v}/socializer_{v}_x64.zip".format(v=version[1:]))
|
||||
|
||||
# build the main dict object
|
||||
data = dict(current_version=version, description=description, downloads=urls)
|
||||
print("Generating file with the following arguments: %r" % (data,))
|
||||
if version_type == "alpha":
|
||||
updatefile = "alpha.json"
|
||||
else:
|
||||
updatefile = "stable.json"
|
||||
f = open(updatefile, "w")
|
||||
json.dump(data, f, ensure_ascii=False)
|
||||
f.close()
|
@@ -1,3 +0,0 @@
|
||||
@echo off
|
||||
echo Generating application translation strings...
|
||||
C:\python27x86\python.exe pygettext.py -v -d socializer ../src/*.pyw ../src/*.py ../src/*/*.py ../src/*/*.pyw ../src/*/*/*.py ../src/*/*/*.pyw ../src/*/*/*/*.py ../src/*/*/*/*.pyw ../src/*/*/*/*/*.py ../src/*/*/*/*/*.pyw
|
7
scripts/genpot_doc.bat
Normal file
7
scripts/genpot_doc.bat
Normal file
@@ -0,0 +1,7 @@
|
||||
@echo off
|
||||
echo Generating file list..
|
||||
dir ..\doc\*.py /L /B /S > %TEMP%\listfile.txt
|
||||
echo Generating .POT file...
|
||||
xgettext --language=Python -o socializer-documentation.pot --keyword=_ -d socializer -f %TEMP%\listfile.txt -c --no-location --no-wrap
|
||||
del %TEMP%\listfile.txt
|
||||
echo Done.
|
7
scripts/genpot_interface.bat
Normal file
7
scripts/genpot_interface.bat
Normal file
@@ -0,0 +1,7 @@
|
||||
@echo off
|
||||
echo Generating file list..
|
||||
dir ..\src\*.py /L /B /S > %TEMP%\listfile.txt
|
||||
echo Generating .POT file...
|
||||
xgettext --language=Python --from-code=utf-8 -o socializer.pot --keyword=_ -d socializer -f %TEMP%\listfile.txt -c --no-location --no-wrap
|
||||
del %TEMP%\listfile.txt
|
||||
echo Done.
|
17
scripts/prepare_zipversion.py
Normal file
17
scripts/prepare_zipversion.py
Normal file
@@ -0,0 +1,17 @@
|
||||
#! /usr/bin/env python# -*- coding: iso-8859-1 -*-
|
||||
import shutil
|
||||
import os
|
||||
import sys
|
||||
|
||||
def create_archive():
|
||||
os.chdir("..\\src")
|
||||
print("Creating zip archive...")
|
||||
folder = "dist"
|
||||
shutil.make_archive("socializer", "zip", folder)
|
||||
# if os.path.exists("dist"):
|
||||
# shutil.rmtree("dist")
|
||||
if os.path.exists("build"):
|
||||
shutil.rmtree("build")
|
||||
os.chdir("..\\scripts")
|
||||
|
||||
create_archive()
|
@@ -1,669 +0,0 @@
|
||||
#! /usr/bin/env python
|
||||
# -*- coding: iso-8859-1 -*-
|
||||
# Originally written by Barry Warsaw <barry@zope.com>
|
||||
#
|
||||
# Minimally patched to make it even more xgettext compatible
|
||||
# by Peter Funk <pf@artcom-gmbh.de>
|
||||
#
|
||||
# 2002-11-22 J<>rgen Hermann <jh@web.de>
|
||||
# Added checks that _() only contains string literals, and
|
||||
# command line args are resolved to module lists, i.e. you
|
||||
# can now pass a filename, a module or package name, or a
|
||||
# directory (including globbing chars, important for Win32).
|
||||
# Made docstring fit in 80 chars wide displays using pydoc.
|
||||
#
|
||||
|
||||
# for selftesting
|
||||
try:
|
||||
import fintl
|
||||
_ = fintl.gettext
|
||||
except ImportError:
|
||||
_ = lambda s: s
|
||||
|
||||
__doc__ = _("""pygettext -- Python equivalent of xgettext(1)
|
||||
|
||||
Many systems (Solaris, Linux, Gnu) provide extensive tools that ease the
|
||||
internationalization of C programs. Most of these tools are independent of
|
||||
the programming language and can be used from within Python programs.
|
||||
Martin von Loewis' work[1] helps considerably in this regard.
|
||||
|
||||
There's one problem though; xgettext is the program that scans source code
|
||||
looking for message strings, but it groks only C (or C++). Python
|
||||
introduces a few wrinkles, such as dual quoting characters, triple quoted
|
||||
strings, and raw strings. xgettext understands none of this.
|
||||
|
||||
Enter pygettext, which uses Python's standard tokenize module to scan
|
||||
Python source code, generating .pot files identical to what GNU xgettext[2]
|
||||
generates for C and C++ code. From there, the standard GNU tools can be
|
||||
used.
|
||||
|
||||
A word about marking Python strings as candidates for translation. GNU
|
||||
xgettext recognizes the following keywords: gettext, dgettext, dcgettext,
|
||||
and gettext_noop. But those can be a lot of text to include all over your
|
||||
code. C and C++ have a trick: they use the C preprocessor. Most
|
||||
internationalized C source includes a #define for gettext() to _() so that
|
||||
what has to be written in the source is much less. Thus these are both
|
||||
translatable strings:
|
||||
|
||||
gettext("Translatable String")
|
||||
_("Translatable String")
|
||||
|
||||
Python of course has no preprocessor so this doesn't work so well. Thus,
|
||||
pygettext searches only for _() by default, but see the -k/--keyword flag
|
||||
below for how to augment this.
|
||||
|
||||
[1] http://www.python.org/workshops/1997-10/proceedings/loewis.html
|
||||
[2] http://www.gnu.org/software/gettext/gettext.html
|
||||
|
||||
NOTE: pygettext attempts to be option and feature compatible with GNU
|
||||
xgettext where ever possible. However some options are still missing or are
|
||||
not fully implemented. Also, xgettext's use of command line switches with
|
||||
option arguments is broken, and in these cases, pygettext just defines
|
||||
additional switches.
|
||||
|
||||
Usage: pygettext [options] inputfile ...
|
||||
|
||||
Options:
|
||||
|
||||
-a
|
||||
--extract-all
|
||||
Extract all strings.
|
||||
|
||||
-d name
|
||||
--default-domain=name
|
||||
Rename the default output file from messages.pot to name.pot.
|
||||
|
||||
-E
|
||||
--escape
|
||||
Replace non-ASCII characters with octal escape sequences.
|
||||
|
||||
-D
|
||||
--docstrings
|
||||
Extract module, class, method, and function docstrings. These do
|
||||
not need to be wrapped in _() markers, and in fact cannot be for
|
||||
Python to consider them docstrings. (See also the -X option).
|
||||
|
||||
-h
|
||||
--help
|
||||
Print this help message and exit.
|
||||
|
||||
-k word
|
||||
--keyword=word
|
||||
Keywords to look for in addition to the default set, which are:
|
||||
%(DEFAULTKEYWORDS)s
|
||||
|
||||
You can have multiple -k flags on the command line.
|
||||
|
||||
-K
|
||||
--no-default-keywords
|
||||
Disable the default set of keywords (see above). Any keywords
|
||||
explicitly added with the -k/--keyword option are still recognized.
|
||||
|
||||
--no-location
|
||||
Do not write filename/lineno location comments.
|
||||
|
||||
-n
|
||||
--add-location
|
||||
Write filename/lineno location comments indicating where each
|
||||
extracted string is found in the source. These lines appear before
|
||||
each msgid. The style of comments is controlled by the -S/--style
|
||||
option. This is the default.
|
||||
|
||||
-o filename
|
||||
--output=filename
|
||||
Rename the default output file from messages.pot to filename. If
|
||||
filename is `-' then the output is sent to standard out.
|
||||
|
||||
-p dir
|
||||
--output-dir=dir
|
||||
Output files will be placed in directory dir.
|
||||
|
||||
-S stylename
|
||||
--style stylename
|
||||
Specify which style to use for location comments. Two styles are
|
||||
supported:
|
||||
|
||||
Solaris # File: filename, line: line-number
|
||||
GNU #: filename:line
|
||||
|
||||
The style name is case insensitive. GNU style is the default.
|
||||
|
||||
-v
|
||||
--verbose
|
||||
Print the names of the files being processed.
|
||||
|
||||
-V
|
||||
--version
|
||||
Print the version of pygettext and exit.
|
||||
|
||||
-w columns
|
||||
--width=columns
|
||||
Set width of output to columns.
|
||||
|
||||
-x filename
|
||||
--exclude-file=filename
|
||||
Specify a file that contains a list of strings that are not be
|
||||
extracted from the input files. Each string to be excluded must
|
||||
appear on a line by itself in the file.
|
||||
|
||||
-X filename
|
||||
--no-docstrings=filename
|
||||
Specify a file that contains a list of files (one per line) that
|
||||
should not have their docstrings extracted. This is only useful in
|
||||
conjunction with the -D option above.
|
||||
|
||||
If `inputfile' is -, standard input is read.
|
||||
""")
|
||||
|
||||
import os
|
||||
import imp
|
||||
import sys
|
||||
import glob
|
||||
import time
|
||||
import getopt
|
||||
import token
|
||||
import tokenize
|
||||
import operator
|
||||
|
||||
__version__ = '1.5'
|
||||
|
||||
default_keywords = ['_']
|
||||
DEFAULTKEYWORDS = ', '.join(default_keywords)
|
||||
|
||||
EMPTYSTRING = ''
|
||||
|
||||
|
||||
|
||||
# The normal pot-file header. msgmerge and Emacs's po-mode work better if it's
|
||||
# there.
|
||||
pot_header = _('''\
|
||||
# SOME DESCRIPTIVE TITLE.
|
||||
# Copyright (C) YEAR ORGANIZATION
|
||||
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: PACKAGE VERSION\\n"
|
||||
"POT-Creation-Date: %(time)s\\n"
|
||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\\n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\\n"
|
||||
"Language-Team: LANGUAGE <LL@li.org>\\n"
|
||||
"MIME-Version: 1.0\\n"
|
||||
"Content-Type: text/plain; charset=CHARSET\\n"
|
||||
"Content-Transfer-Encoding: ENCODING\\n"
|
||||
"Generated-By: pygettext.py %(version)s\\n"
|
||||
|
||||
''')
|
||||
|
||||
|
||||
def usage(code, msg=''):
|
||||
print >> sys.stderr, __doc__ % globals()
|
||||
if msg:
|
||||
print >> sys.stderr, msg
|
||||
sys.exit(code)
|
||||
|
||||
|
||||
|
||||
escapes = []
|
||||
|
||||
def make_escapes(pass_iso8859):
|
||||
global escapes
|
||||
if pass_iso8859:
|
||||
# Allow iso-8859 characters to pass through so that e.g. 'msgid
|
||||
# "H<>he"' would result not result in 'msgid "H\366he"'. Otherwise we
|
||||
# escape any character outside the 32..126 range.
|
||||
mod = 128
|
||||
else:
|
||||
mod = 256
|
||||
for i in range(256):
|
||||
if 32 <= (i % mod) <= 126:
|
||||
escapes.append(chr(i))
|
||||
else:
|
||||
escapes.append("\\%03o" % i)
|
||||
escapes[ord('\\')] = '\\\\'
|
||||
escapes[ord('\t')] = '\\t'
|
||||
escapes[ord('\r')] = '\\r'
|
||||
escapes[ord('\n')] = '\\n'
|
||||
escapes[ord('\"')] = '\\"'
|
||||
|
||||
|
||||
def escape(s):
|
||||
global escapes
|
||||
s = list(s)
|
||||
for i in range(len(s)):
|
||||
s[i] = escapes[ord(s[i])]
|
||||
return EMPTYSTRING.join(s)
|
||||
|
||||
|
||||
def safe_eval(s):
|
||||
# unwrap quotes, safely
|
||||
return eval(s, {'__builtins__':{}}, {})
|
||||
|
||||
|
||||
def normalize(s):
|
||||
# This converts the various Python string types into a format that is
|
||||
# appropriate for .po files, namely much closer to C style.
|
||||
lines = s.split('\n')
|
||||
if len(lines) == 1:
|
||||
s = '"' + escape(s) + '"'
|
||||
else:
|
||||
if not lines[-1]:
|
||||
del lines[-1]
|
||||
lines[-1] = lines[-1] + '\n'
|
||||
for i in range(len(lines)):
|
||||
lines[i] = escape(lines[i])
|
||||
lineterm = '\\n"\n"'
|
||||
s = '""\n"' + lineterm.join(lines) + '"'
|
||||
return s
|
||||
|
||||
|
||||
def containsAny(str, set):
|
||||
"""Check whether 'str' contains ANY of the chars in 'set'"""
|
||||
return 1 in [c in str for c in set]
|
||||
|
||||
|
||||
def _visit_pyfiles(list, dirname, names):
|
||||
"""Helper for getFilesForName()."""
|
||||
# get extension for python source files
|
||||
if not globals().has_key('_py_ext'):
|
||||
global _py_ext
|
||||
_py_ext = [triple[0] for triple in imp.get_suffixes()
|
||||
if triple[2] == imp.PY_SOURCE][0]
|
||||
|
||||
# don't recurse into CVS directories
|
||||
if 'CVS' in names:
|
||||
names.remove('CVS')
|
||||
|
||||
# add all *.py files to list
|
||||
list.extend(
|
||||
[os.path.join(dirname, file) for file in names
|
||||
if os.path.splitext(file)[1] == _py_ext]
|
||||
)
|
||||
|
||||
|
||||
def _get_modpkg_path(dotted_name, pathlist=None):
|
||||
"""Get the filesystem path for a module or a package.
|
||||
|
||||
Return the file system path to a file for a module, and to a directory for
|
||||
a package. Return None if the name is not found, or is a builtin or
|
||||
extension module.
|
||||
"""
|
||||
# split off top-most name
|
||||
parts = dotted_name.split('.', 1)
|
||||
|
||||
if len(parts) > 1:
|
||||
# we have a dotted path, import top-level package
|
||||
try:
|
||||
file, pathname, description = imp.find_module(parts[0], pathlist)
|
||||
if file: file.close()
|
||||
except ImportError:
|
||||
return None
|
||||
|
||||
# check if it's indeed a package
|
||||
if description[2] == imp.PKG_DIRECTORY:
|
||||
# recursively handle the remaining name parts
|
||||
pathname = _get_modpkg_path(parts[1], [pathname])
|
||||
else:
|
||||
pathname = None
|
||||
else:
|
||||
# plain name
|
||||
try:
|
||||
file, pathname, description = imp.find_module(
|
||||
dotted_name, pathlist)
|
||||
if file:
|
||||
file.close()
|
||||
if description[2] not in [imp.PY_SOURCE, imp.PKG_DIRECTORY]:
|
||||
pathname = None
|
||||
except ImportError:
|
||||
pathname = None
|
||||
|
||||
return pathname
|
||||
|
||||
|
||||
def getFilesForName(name):
|
||||
"""Get a list of module files for a filename, a module or package name,
|
||||
or a directory.
|
||||
"""
|
||||
if not os.path.exists(name):
|
||||
# check for glob chars
|
||||
if containsAny(name, "*?[]"):
|
||||
files = glob.glob(name)
|
||||
list = []
|
||||
for file in files:
|
||||
list.extend(getFilesForName(file))
|
||||
return list
|
||||
|
||||
# try to find module or package
|
||||
name = _get_modpkg_path(name)
|
||||
if not name:
|
||||
return []
|
||||
|
||||
if os.path.isdir(name):
|
||||
# find all python files in directory
|
||||
list = []
|
||||
os.path.walk(name, _visit_pyfiles, list)
|
||||
return list
|
||||
elif os.path.exists(name):
|
||||
# a single file
|
||||
return [name]
|
||||
|
||||
return []
|
||||
|
||||
|
||||
class TokenEater:
|
||||
def __init__(self, options):
|
||||
self.__options = options
|
||||
self.__messages = {}
|
||||
self.__state = self.__waiting
|
||||
self.__data = []
|
||||
self.__lineno = -1
|
||||
self.__freshmodule = 1
|
||||
self.__curfile = None
|
||||
|
||||
def __call__(self, ttype, tstring, stup, etup, line):
|
||||
# dispatch
|
||||
## import token
|
||||
## print >> sys.stderr, 'ttype:', token.tok_name[ttype], \
|
||||
## 'tstring:', tstring
|
||||
self.__state(ttype, tstring, stup[0])
|
||||
|
||||
def __waiting(self, ttype, tstring, lineno):
|
||||
opts = self.__options
|
||||
# Do docstring extractions, if enabled
|
||||
if opts.docstrings and not opts.nodocstrings.get(self.__curfile):
|
||||
# module docstring?
|
||||
if self.__freshmodule:
|
||||
if ttype == tokenize.STRING:
|
||||
self.__addentry(safe_eval(tstring), lineno, isdocstring=1)
|
||||
self.__freshmodule = 0
|
||||
elif ttype not in (tokenize.COMMENT, tokenize.NL):
|
||||
self.__freshmodule = 0
|
||||
return
|
||||
# class docstring?
|
||||
if ttype == tokenize.NAME and tstring in ('class', 'def'):
|
||||
self.__state = self.__suiteseen
|
||||
return
|
||||
if ttype == tokenize.NAME and tstring in opts.keywords:
|
||||
self.__state = self.__keywordseen
|
||||
|
||||
def __suiteseen(self, ttype, tstring, lineno):
|
||||
# ignore anything until we see the colon
|
||||
if ttype == tokenize.OP and tstring == ':':
|
||||
self.__state = self.__suitedocstring
|
||||
|
||||
def __suitedocstring(self, ttype, tstring, lineno):
|
||||
# ignore any intervening noise
|
||||
if ttype == tokenize.STRING:
|
||||
self.__addentry(safe_eval(tstring), lineno, isdocstring=1)
|
||||
self.__state = self.__waiting
|
||||
elif ttype not in (tokenize.NEWLINE, tokenize.INDENT,
|
||||
tokenize.COMMENT):
|
||||
# there was no class docstring
|
||||
self.__state = self.__waiting
|
||||
|
||||
def __keywordseen(self, ttype, tstring, lineno):
|
||||
if ttype == tokenize.OP and tstring == '(':
|
||||
self.__data = []
|
||||
self.__lineno = lineno
|
||||
self.__state = self.__openseen
|
||||
else:
|
||||
self.__state = self.__waiting
|
||||
|
||||
def __openseen(self, ttype, tstring, lineno):
|
||||
if ttype == tokenize.OP and tstring == ')':
|
||||
# We've seen the last of the translatable strings. Record the
|
||||
# line number of the first line of the strings and update the list
|
||||
# of messages seen. Reset state for the next batch. If there
|
||||
# were no strings inside _(), then just ignore this entry.
|
||||
if self.__data:
|
||||
self.__addentry(EMPTYSTRING.join(self.__data))
|
||||
self.__state = self.__waiting
|
||||
elif ttype == tokenize.STRING:
|
||||
self.__data.append(safe_eval(tstring))
|
||||
elif ttype not in [tokenize.COMMENT, token.INDENT, token.DEDENT,
|
||||
token.NEWLINE, tokenize.NL]:
|
||||
# warn if we see anything else than STRING or whitespace
|
||||
print >> sys.stderr, _(
|
||||
'*** %(file)s:%(lineno)s: Seen unexpected token "%(token)s"'
|
||||
) % {
|
||||
'token': tstring,
|
||||
'file': self.__curfile,
|
||||
'lineno': self.__lineno
|
||||
}
|
||||
self.__state = self.__waiting
|
||||
|
||||
def __addentry(self, msg, lineno=None, isdocstring=0):
|
||||
if lineno is None:
|
||||
lineno = self.__lineno
|
||||
if not msg in self.__options.toexclude:
|
||||
entry = (self.__curfile, lineno)
|
||||
self.__messages.setdefault(msg, {})[entry] = isdocstring
|
||||
|
||||
def set_filename(self, filename):
|
||||
self.__curfile = filename
|
||||
self.__freshmodule = 1
|
||||
|
||||
def write(self, fp):
|
||||
options = self.__options
|
||||
timestamp = time.strftime('%Y-%m-%d %H:%M+%Z')
|
||||
# The time stamp in the header doesn't have the same format as that
|
||||
# generated by xgettext...
|
||||
print >> fp, pot_header % {'time': timestamp, 'version': __version__}
|
||||
# Sort the entries. First sort each particular entry's keys, then
|
||||
# sort all the entries by their first item.
|
||||
reverse = {}
|
||||
for k, v in self.__messages.items():
|
||||
keys = v.keys()
|
||||
keys.sort()
|
||||
reverse.setdefault(tuple(keys), []).append((k, v))
|
||||
rkeys = reverse.keys()
|
||||
rkeys.sort()
|
||||
for rkey in rkeys:
|
||||
rentries = reverse[rkey]
|
||||
rentries.sort()
|
||||
for k, v in rentries:
|
||||
isdocstring = 0
|
||||
# If the entry was gleaned out of a docstring, then add a
|
||||
# comment stating so. This is to aid translators who may wish
|
||||
# to skip translating some unimportant docstrings.
|
||||
if reduce(operator.__add__, v.values()):
|
||||
isdocstring = 1
|
||||
# k is the message string, v is a dictionary-set of (filename,
|
||||
# lineno) tuples. We want to sort the entries in v first by
|
||||
# file name and then by line number.
|
||||
v = v.keys()
|
||||
v.sort()
|
||||
if not options.writelocations:
|
||||
pass
|
||||
# location comments are different b/w Solaris and GNU:
|
||||
elif options.locationstyle == options.SOLARIS:
|
||||
for filename, lineno in v:
|
||||
d = {'filename': filename, 'lineno': lineno}
|
||||
print >>fp, _(
|
||||
'# File: %(filename)s, line: %(lineno)d') % d
|
||||
elif options.locationstyle == options.GNU:
|
||||
# fit as many locations on one line, as long as the
|
||||
# resulting line length doesn't exceeds 'options.width'
|
||||
locline = '#:'
|
||||
for filename, lineno in v:
|
||||
d = {'filename': filename, 'lineno': lineno}
|
||||
s = _(' %(filename)s:%(lineno)d') % d
|
||||
if len(locline) + len(s) <= options.width:
|
||||
locline = locline + s
|
||||
else:
|
||||
print >> fp, locline
|
||||
locline = "#:" + s
|
||||
if len(locline) > 2:
|
||||
print >> fp, locline
|
||||
if isdocstring:
|
||||
print >> fp, '#, docstring'
|
||||
print >> fp, 'msgid', normalize(k)
|
||||
print >> fp, 'msgstr ""\n'
|
||||
|
||||
|
||||
|
||||
def main():
|
||||
global default_keywords
|
||||
try:
|
||||
opts, args = getopt.getopt(
|
||||
sys.argv[1:],
|
||||
'ad:DEhk:Kno:p:S:Vvw:x:X:',
|
||||
['extract-all', 'default-domain=', 'escape', 'help',
|
||||
'keyword=', 'no-default-keywords',
|
||||
'add-location', 'no-location', 'output=', 'output-dir=',
|
||||
'style=', 'verbose', 'version', 'width=', 'exclude-file=',
|
||||
'docstrings', 'no-docstrings',
|
||||
])
|
||||
except getopt.error, msg:
|
||||
usage(1, msg)
|
||||
|
||||
# for holding option values
|
||||
class Options:
|
||||
# constants
|
||||
GNU = 1
|
||||
SOLARIS = 2
|
||||
# defaults
|
||||
extractall = 0 # FIXME: currently this option has no effect at all.
|
||||
escape = 0
|
||||
keywords = []
|
||||
outpath = ''
|
||||
outfile = 'messages.pot'
|
||||
writelocations = 1
|
||||
locationstyle = GNU
|
||||
verbose = 0
|
||||
width = 78
|
||||
excludefilename = ''
|
||||
docstrings = 0
|
||||
nodocstrings = {}
|
||||
|
||||
options = Options()
|
||||
locations = {'gnu' : options.GNU,
|
||||
'solaris' : options.SOLARIS,
|
||||
}
|
||||
|
||||
# parse options
|
||||
for opt, arg in opts:
|
||||
if opt in ('-h', '--help'):
|
||||
usage(0)
|
||||
elif opt in ('-a', '--extract-all'):
|
||||
options.extractall = 1
|
||||
elif opt in ('-d', '--default-domain'):
|
||||
options.outfile = arg + '.pot'
|
||||
elif opt in ('-E', '--escape'):
|
||||
options.escape = 1
|
||||
elif opt in ('-D', '--docstrings'):
|
||||
options.docstrings = 1
|
||||
elif opt in ('-k', '--keyword'):
|
||||
options.keywords.append(arg)
|
||||
elif opt in ('-K', '--no-default-keywords'):
|
||||
default_keywords = []
|
||||
elif opt in ('-n', '--add-location'):
|
||||
options.writelocations = 1
|
||||
elif opt in ('--no-location',):
|
||||
options.writelocations = 0
|
||||
elif opt in ('-S', '--style'):
|
||||
options.locationstyle = locations.get(arg.lower())
|
||||
if options.locationstyle is None:
|
||||
usage(1, _('Invalid value for --style: %s') % arg)
|
||||
elif opt in ('-o', '--output'):
|
||||
options.outfile = arg
|
||||
elif opt in ('-p', '--output-dir'):
|
||||
options.outpath = arg
|
||||
elif opt in ('-v', '--verbose'):
|
||||
options.verbose = 1
|
||||
elif opt in ('-V', '--version'):
|
||||
print _('pygettext.py (xgettext for Python) %s') % __version__
|
||||
sys.exit(0)
|
||||
elif opt in ('-w', '--width'):
|
||||
try:
|
||||
options.width = int(arg)
|
||||
except ValueError:
|
||||
usage(1, _('--width argument must be an integer: %s') % arg)
|
||||
elif opt in ('-x', '--exclude-file'):
|
||||
options.excludefilename = arg
|
||||
elif opt in ('-X', '--no-docstrings'):
|
||||
fp = open(arg)
|
||||
try:
|
||||
while 1:
|
||||
line = fp.readline()
|
||||
if not line:
|
||||
break
|
||||
options.nodocstrings[line[:-1]] = 1
|
||||
finally:
|
||||
fp.close()
|
||||
|
||||
# calculate escapes
|
||||
make_escapes(options.escape)
|
||||
|
||||
# calculate all keywords
|
||||
options.keywords.extend(default_keywords)
|
||||
|
||||
# initialize list of strings to exclude
|
||||
if options.excludefilename:
|
||||
try:
|
||||
fp = open(options.excludefilename)
|
||||
options.toexclude = fp.readlines()
|
||||
fp.close()
|
||||
except IOError:
|
||||
print >> sys.stderr, _(
|
||||
"Can't read --exclude-file: %s") % options.excludefilename
|
||||
sys.exit(1)
|
||||
else:
|
||||
options.toexclude = []
|
||||
|
||||
# resolve args to module lists
|
||||
expanded = []
|
||||
for arg in args:
|
||||
if arg == '-':
|
||||
expanded.append(arg)
|
||||
else:
|
||||
expanded.extend(getFilesForName(arg))
|
||||
args = expanded
|
||||
|
||||
# slurp through all the files
|
||||
eater = TokenEater(options)
|
||||
for filename in args:
|
||||
if filename == '-':
|
||||
if options.verbose:
|
||||
print _('Reading standard input')
|
||||
fp = sys.stdin
|
||||
closep = 0
|
||||
else:
|
||||
if options.verbose:
|
||||
print _('Working on %s') % filename
|
||||
fp = open(filename)
|
||||
closep = 1
|
||||
try:
|
||||
eater.set_filename(filename)
|
||||
try:
|
||||
tokenize.tokenize(fp.readline, eater)
|
||||
except tokenize.TokenError, e:
|
||||
print >> sys.stderr, '%s: %s, line %d, column %d' % (
|
||||
e[0], filename, e[1][0], e[1][1])
|
||||
finally:
|
||||
if closep:
|
||||
fp.close()
|
||||
|
||||
# write the output
|
||||
if options.outfile == '-':
|
||||
fp = sys.stdout
|
||||
closep = 0
|
||||
else:
|
||||
if options.outpath:
|
||||
options.outfile = os.path.join(options.outpath, options.outfile)
|
||||
fp = open(options.outfile, 'w')
|
||||
closep = 1
|
||||
try:
|
||||
eater.write(fp)
|
||||
finally:
|
||||
if closep:
|
||||
fp.close()
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
# some more test strings
|
||||
_(u'a unicode string')
|
||||
# this one creates a warning
|
||||
_('*** Seen unexpected token "%(token)s"') % {'token': 'test'}
|
||||
_('more' 'than' 'one' 'string')
|
File diff suppressed because it is too large
Load Diff
68
scripts/upload.py
Normal file
68
scripts/upload.py
Normal file
@@ -0,0 +1,68 @@
|
||||
#! /usr/bin/env python
|
||||
""" Upload socializer to the ftp server. This script has been created to be executed from a continuous integrations system.
|
||||
Important note: for this script to work, the following conditions should be met:
|
||||
* There must be ftp server data, via environment variables (FTP_SERVER, FTP_USERNAME and FTP_PASSWORD) or via arguments to the script call (in the prior order). Connection to this server is done via default ftp port.
|
||||
* If the version to upload is alpha, there's not need of an extra variable. Otherwise, CI_COMMIT_TAG should point to a version as vx.x, where v is a literal and x are numbers, example may be v0.18, v0.25, v0.3. This variable should be set in the environment.
|
||||
* Inside the ftp server, the following directory structure will be expected: socializer.su/static/files/. The script will create the <version> folder or alpha if needed.
|
||||
* The script will upload all .exe, .zip and .json files located in the root directory from where it was called. The json files are uploaded to socializer.su/static/files/update and other files are going to socializer.su/static/files/<version>.
|
||||
"""
|
||||
import sys
|
||||
import os
|
||||
import glob
|
||||
import ftplib
|
||||
|
||||
transferred=0
|
||||
|
||||
def convert_bytes(n):
|
||||
K, M, G, T, P = 1 << 10, 1 << 20, 1 << 30, 1 << 40, 1 << 50
|
||||
if n >= P:
|
||||
return '%.2fPb' % (float(n) / T)
|
||||
elif n >= T:
|
||||
return '%.2fTb' % (float(n) / T)
|
||||
elif n >= G:
|
||||
return '%.2fGb' % (float(n) / G)
|
||||
elif n >= M:
|
||||
return '%.2fMb' % (float(n) / M)
|
||||
elif n >= K:
|
||||
return '%.2fKb' % (float(n) / K)
|
||||
else:
|
||||
return '%d' % n
|
||||
|
||||
def callback(progress):
|
||||
global transferred
|
||||
transferred = transferred+len(progress)
|
||||
print("Uploaded {}".format(convert_bytes(transferred),))
|
||||
|
||||
ftp_server = os.environ.get("FTP_SERVER") or sys.argv[1]
|
||||
ftp_username = os.environ.get("FTP_USERNAME") or sys.argv[2]
|
||||
ftp_password = os.environ.get("FTP_PASSWORD") or sys.argv[3]
|
||||
version = os.environ.get("CI_COMMIT_TAG") or "alpha"
|
||||
version = version.replace("v", "")
|
||||
|
||||
print("Uploading files to the Socializer server...")
|
||||
connection = ftplib.FTP(ftp_server)
|
||||
print("Connected to FTP server {}".format(ftp_server,))
|
||||
connection.login(user=ftp_username, passwd=ftp_password)
|
||||
print("Logged in successfully")
|
||||
connection.cwd("socializer.su/static/files/")
|
||||
if version not in connection.nlst():
|
||||
print("Creating version directory {} because does not exists...".format(version,))
|
||||
connection.mkd(version)
|
||||
|
||||
if "update" not in connection.nlst():
|
||||
print("Creating update info directory because does not exists...")
|
||||
connection.mkd("update")
|
||||
connection.cwd(version)
|
||||
print("Moved into version directory")
|
||||
files = glob.glob("*.zip")+glob.glob("*.exe")+glob.glob("*.json")
|
||||
print("These files will be uploaded into the version folder: {}".format(files,))
|
||||
for file in files:
|
||||
transferred = 0
|
||||
print("Uploading {}".format(file,))
|
||||
with open(file, "rb") as f:
|
||||
if file.endswith("json"):
|
||||
connection.storbinary('STOR ../update/%s' % file, f, callback=callback, blocksize=1024*1024)
|
||||
else:
|
||||
connection.storbinary('STOR %s' % file, f, callback=callback, blocksize=1024*1024)
|
||||
print("Upload completed. exiting...")
|
||||
connection.quit()
|
@@ -1,33 +0,0 @@
|
||||
from __future__ import absolute_import
|
||||
import ctypes
|
||||
import os
|
||||
import types
|
||||
from platform_utils import paths
|
||||
|
||||
def load_library(libname, cdll=False):
|
||||
if paths.is_frozen():
|
||||
libfile = os.path.join(paths.embedded_data_path(), 'accessible_output2', 'lib', libname)
|
||||
else:
|
||||
libfile = os.path.join(paths.module_path(), 'lib', libname)
|
||||
if cdll:
|
||||
return ctypes.cdll[libfile]
|
||||
else:
|
||||
return ctypes.windll[libfile]
|
||||
|
||||
def get_output_classes():
|
||||
from . import outputs
|
||||
module_type = types.ModuleType
|
||||
classes = [m.output_class for m in outputs.__dict__.values() if type(m) == module_type and hasattr(m, 'output_class')]
|
||||
return sorted(classes, key=lambda c: c.priority)
|
||||
|
||||
def find_datafiles():
|
||||
import os
|
||||
import platform
|
||||
from glob import glob
|
||||
import accessible_output2
|
||||
if platform.system() != 'Windows':
|
||||
return []
|
||||
path = os.path.join(accessible_output2.__path__[0], 'lib', '*.dll')
|
||||
results = glob(path)
|
||||
dest_dir = os.path.join('accessible_output2', 'lib')
|
||||
return [(dest_dir, results)]
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,20 +0,0 @@
|
||||
from __future__ import absolute_import
|
||||
import platform
|
||||
if platform.system() == 'Windows':
|
||||
from . import nvda
|
||||
from . import jaws
|
||||
from . import sapi5
|
||||
from . import window_eyes
|
||||
from . import system_access
|
||||
from . import dolphin
|
||||
from . import pc_talker
|
||||
#import sapi4
|
||||
|
||||
if platform.system() == 'Darwin':
|
||||
from . import voiceover
|
||||
from . import say
|
||||
|
||||
if platform.system() == 'Linux':
|
||||
from . import e_speak
|
||||
|
||||
from . import auto
|
@@ -1,40 +0,0 @@
|
||||
from __future__ import absolute_import
|
||||
import accessible_output2
|
||||
from .base import Output, OutputError
|
||||
|
||||
class Auto(Output):
|
||||
|
||||
def __init__(self):
|
||||
output_classes = accessible_output2.get_output_classes()
|
||||
self.outputs = []
|
||||
for output in output_classes:
|
||||
try:
|
||||
self.outputs.append(output())
|
||||
except OutputError:
|
||||
pass
|
||||
|
||||
def get_first_available_output(self):
|
||||
for output in self.outputs:
|
||||
if output.is_active():
|
||||
return output
|
||||
return None
|
||||
|
||||
def speak(self, *args, **kwargs):
|
||||
output = self.get_first_available_output()
|
||||
if output:
|
||||
output.speak(*args, **kwargs)
|
||||
|
||||
def braille(self, *args, **kwargs):
|
||||
output = self.get_first_available_output()
|
||||
if output:
|
||||
output.braille(*args, **kwargs)
|
||||
|
||||
def output(self, *args, **kwargs):
|
||||
output = self.get_first_available_output()
|
||||
if output:
|
||||
output.speak(*args, **kwargs)
|
||||
|
||||
def is_system_output(self):
|
||||
output = self.get_first_available_output()
|
||||
if output:
|
||||
return output.is_system_output()
|
@@ -1,47 +0,0 @@
|
||||
from accessible_output2 import load_library
|
||||
import platform
|
||||
|
||||
class OutputError(Exception):
|
||||
pass
|
||||
|
||||
class Output(object):
|
||||
name = "Unnamed Output"
|
||||
lib32 = None
|
||||
lib64 = None
|
||||
argtypes = {}
|
||||
cdll = False
|
||||
priority = 100
|
||||
system_output = False
|
||||
|
||||
def __init__(self):
|
||||
self.is_32bit = platform.architecture()[0] == "32bit"
|
||||
if self.lib32 and self.is_32bit:
|
||||
self.lib = load_library(self.lib32, cdll=self.cdll)
|
||||
elif self.lib64:
|
||||
self.lib = load_library(self.lib64, cdll=self.cdll)
|
||||
else:
|
||||
self.lib = None
|
||||
if self.lib is not None:
|
||||
for func in self.argtypes:
|
||||
try:
|
||||
getattr(self.lib, func).argtypes = self.argtypes[func]
|
||||
except AttributeError:
|
||||
pass
|
||||
|
||||
def output(self, text, **options):
|
||||
output = False
|
||||
if self.speak(text, **options):
|
||||
output = True
|
||||
if self.braille(text, **options):
|
||||
output = True
|
||||
if not output:
|
||||
raise RuntimeError("Output %r does not have any method defined to output" % self)
|
||||
|
||||
def is_system_output(self):
|
||||
return self.system_output
|
||||
|
||||
def speak(self, **optiont):
|
||||
return False
|
||||
|
||||
def braille(self, *args, **options):
|
||||
return False
|
@@ -1,33 +0,0 @@
|
||||
from __future__ import absolute_import
|
||||
import os
|
||||
import ctypes
|
||||
|
||||
from .base import Output
|
||||
|
||||
class Dolphin (Output):
|
||||
"""Supports dolphin products."""
|
||||
|
||||
name = 'Dolphin'
|
||||
lib32 = 'dolapi.dll'
|
||||
argtypes = {
|
||||
'DolAccess_Command': (ctypes.c_wchar_p, ctypes.c_int, ctypes.c_int),
|
||||
'DolAccess_Action': (ctypes.c_int,),
|
||||
}
|
||||
|
||||
def speak(self, text, interrupt=0):
|
||||
if interrupt:
|
||||
self.silence()
|
||||
#If we don't call this, the API won't let us speak.
|
||||
if self.is_active():
|
||||
self.lib.DolAccess_Command(text, (len(text)*2)+2, 1)
|
||||
|
||||
def silence(self):
|
||||
self.lib.DolAccess_Action(141)
|
||||
|
||||
def is_active(self):
|
||||
try:
|
||||
return self.lib.DolAccess_GetSystem() in (1, 4, 8)
|
||||
except:
|
||||
return False
|
||||
|
||||
output_class = Dolphin
|
@@ -1,31 +0,0 @@
|
||||
from __future__ import absolute_import
|
||||
from .base import Output
|
||||
|
||||
try:
|
||||
import espeak.core
|
||||
except:
|
||||
raise RuntimeError("Cannot find espeak.core. Please install python-espeak")
|
||||
|
||||
class ESpeak(Output):
|
||||
"""Speech output supporting ESpeak on Linux
|
||||
Note this requires python-espeak to be installed
|
||||
This can be done on Debian distros by using apt-get install python-espeak
|
||||
Or through this tarball: https://launchpad.net/python-espeak
|
||||
"""
|
||||
name = "Linux ESpeak"
|
||||
|
||||
def is_active(self):
|
||||
try:
|
||||
import espeak.core
|
||||
except:
|
||||
return False
|
||||
return True
|
||||
|
||||
def speak(self, text, interrupt = 0):
|
||||
if interrupt:
|
||||
self.silence()
|
||||
espeak.core.synth(text)
|
||||
def silence(self):
|
||||
espeak.core.cancel()
|
||||
|
||||
output_class = ESpeak
|
@@ -1,34 +0,0 @@
|
||||
from __future__ import absolute_import
|
||||
import win32gui
|
||||
from libloader.com import load_com
|
||||
import pywintypes
|
||||
|
||||
from .base import Output, OutputError
|
||||
|
||||
class Jaws (Output):
|
||||
"""Output supporting the Jaws for Windows screen reader."""
|
||||
|
||||
name = 'jaws'
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
super (Jaws, self).__init__(*args, **kwargs)
|
||||
try:
|
||||
self.object = load_com("FreedomSci.JawsApi", "jfwapi")
|
||||
except pywintypes.com_error:
|
||||
raise OutputError
|
||||
|
||||
def braille(self, text, **options):
|
||||
# HACK: replace " with ', Jaws doesn't seem to understand escaping them with \
|
||||
text = text.replace('"', "'")
|
||||
self.object.RunFunction("BrailleString(\"%s\")" % text)
|
||||
|
||||
def speak(self, text, interrupt=False):
|
||||
self.object.SayString(' %s' % text, interrupt)
|
||||
|
||||
def is_active(self):
|
||||
try:
|
||||
return self.object.SayString('',0) == True or win32gui.FindWindow("JFWUI2", "JAWS") != 0
|
||||
except:
|
||||
return False
|
||||
|
||||
output_class = Jaws
|
@@ -1,37 +0,0 @@
|
||||
from __future__ import absolute_import
|
||||
import os
|
||||
import platform
|
||||
import ctypes
|
||||
|
||||
from platform_utils import paths
|
||||
from libloader import load_library
|
||||
from .base import Output
|
||||
|
||||
class NVDA(Output):
|
||||
"""Supports The NVDA screen reader"""
|
||||
name = "NVDA"
|
||||
lib32 = 'nvdaControllerClient32.dll'
|
||||
lib64 = 'nvdaControllerClient64.dll'
|
||||
argtypes = {
|
||||
'nvdaController_brailleMessage': (ctypes.c_wchar_p,),
|
||||
'nvdaController_speakText': (ctypes.c_wchar_p,),
|
||||
}
|
||||
|
||||
def is_active(self):
|
||||
try:
|
||||
return self.lib.nvdaController_testIfRunning() == 0
|
||||
except:
|
||||
return False
|
||||
|
||||
def braille(self, text, **options):
|
||||
self.lib.nvdaController_brailleMessage(text)
|
||||
|
||||
def speak(self, text, interrupt=False):
|
||||
if interrupt:
|
||||
self.silence()
|
||||
self.lib.nvdaController_speakText(text)
|
||||
|
||||
def silence(self):
|
||||
self.lib.nvdaController_cancelSpeech()
|
||||
|
||||
output_class = NVDA
|
@@ -1,24 +0,0 @@
|
||||
from __future__ import absolute_import
|
||||
import ctypes
|
||||
from .base import Output
|
||||
|
||||
class PCTalker(Output):
|
||||
lib32 = 'pctkusr.dll'
|
||||
lib64 = 'pctkusr64.dll'
|
||||
cdll = True
|
||||
argtypes = {
|
||||
'PCTKPRead': (ctypes.c_char_p, ctypes.c_int, ctypes.c_int)
|
||||
}
|
||||
|
||||
def speak(self, text, interrupt=False):
|
||||
if interrupt:
|
||||
self.silence()
|
||||
self.lib.PCTKPRead(text.encode('cp932', 'replace'), 0, 1)
|
||||
|
||||
def silence(self):
|
||||
self.lib.PCTKVReset()
|
||||
|
||||
def is_active(self):
|
||||
return self.lib.PCTKStatus() != 0
|
||||
|
||||
output_class = PCTalker
|
@@ -1,143 +0,0 @@
|
||||
from __future__ import absolute_import
|
||||
from builtins import range
|
||||
from libloader.com import load_com
|
||||
from .base import Output
|
||||
|
||||
import logging
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
class Sapi4(Output):
|
||||
|
||||
name = 'sapi4'
|
||||
priority = 102
|
||||
|
||||
def __init__(self):
|
||||
sapi4 = load_com("{EEE78591-FE22-11D0-8BEF-0060081841DE}")
|
||||
self._voiceNo = sapi4.Find(0)
|
||||
sapi4.Select(self._voiceNo)
|
||||
sapi4.Speak(" ")
|
||||
self.__object = sapi4
|
||||
self._voice_list = self._available_voices()
|
||||
|
||||
def _set_capabilities(self):
|
||||
sapi4 = self.__object
|
||||
try:
|
||||
sapi4.Pitch = sapi4.Pitch
|
||||
self._min_pitch = sapi4.MinPitch
|
||||
self._max_pitch = sapi4.MaxPitch
|
||||
self._has_pitch = True
|
||||
except:
|
||||
self._min_pitch = 0
|
||||
self._max_pitch = 0
|
||||
self._has_pitch = False
|
||||
try:
|
||||
sapi4.Speed = sapi4.Speed
|
||||
self._min_rate = sapi4.MinSpeed
|
||||
self._max_rate = sapi4.MaxSpeed
|
||||
self._has_rate = True
|
||||
except:
|
||||
self._min_rate = 0
|
||||
self._max_rate = 0
|
||||
self._has_rate = False
|
||||
try:
|
||||
sapi4.VolumeLeft = sapi4.VolumeLeft
|
||||
self._min_volume = sapi4.MinVolumeLeft
|
||||
self._max_volume = sapi4.MaxVolumeLeft
|
||||
self._has_volume = True
|
||||
except:
|
||||
self._min_volume = 0
|
||||
self._max_volume = 0
|
||||
self._has_volume = False
|
||||
|
||||
def _available_voices(self):
|
||||
voice_list = []
|
||||
for voice_no in range(1, self.__object.CountEngines):
|
||||
voice_list.append(self.__object.ModeName(voice_no))
|
||||
return voice_list
|
||||
|
||||
@property
|
||||
def available_voices(self):
|
||||
return self._voice_list
|
||||
|
||||
def list_voices(self):
|
||||
return self.available_voices
|
||||
|
||||
def get_voice(self):
|
||||
return self.__object.ModeName(self._voice_no)
|
||||
|
||||
def set_voice(self, value):
|
||||
self._voice_no = self.list_voices().index(value) + 1
|
||||
self.__object.Select(self._voice_no)
|
||||
self.silence()
|
||||
self.__object.Speak(" ")
|
||||
self._set_capabilities()
|
||||
|
||||
def get_pitch(self):
|
||||
if self.has_pitch:
|
||||
return self.__object.Pitch
|
||||
|
||||
def set_pitch(self, value):
|
||||
if self.has_pitch:
|
||||
self.__object.Pitch = value
|
||||
|
||||
def get_rate(self):
|
||||
if self.has_rate:
|
||||
return self.__object.Speed
|
||||
|
||||
def set_rate(self, value):
|
||||
if self.has_rate:
|
||||
self.__object.Speed = value
|
||||
|
||||
def get_volume(self):
|
||||
if self.has_volume:
|
||||
return self.__object.VolumeLeft
|
||||
|
||||
def set_volume(self, value):
|
||||
if self.has_volume:
|
||||
self.__object.VolumeLeft = value
|
||||
|
||||
@property
|
||||
def has_pitch(self):
|
||||
return self._has_pitch
|
||||
|
||||
@property
|
||||
def has_rate(self):
|
||||
return self._has_rate
|
||||
|
||||
@property
|
||||
def has_volume(self):
|
||||
return self._has_volume
|
||||
|
||||
@property
|
||||
def min_pitch(self):
|
||||
return self._min_pitch
|
||||
|
||||
@property
|
||||
def max_pitch(self):
|
||||
return self._max_pitch
|
||||
|
||||
@property
|
||||
def min_rate(self):
|
||||
return self._min_rate
|
||||
|
||||
@property
|
||||
def max_rate(self):
|
||||
return self._max_rate
|
||||
|
||||
@property
|
||||
def min_volume(self):
|
||||
return self._min_volume
|
||||
|
||||
@property
|
||||
def max_volume(self):
|
||||
return self._max_volume
|
||||
|
||||
def speak(self, text, interrupt=False):
|
||||
if interrupt:
|
||||
self.silence()
|
||||
self.__object.Speak(text)
|
||||
|
||||
def silence(self):
|
||||
self.__object.AudioReset()
|
||||
|
||||
output_class = Sapi4
|
@@ -1,95 +0,0 @@
|
||||
from __future__ import absolute_import
|
||||
from collections import OrderedDict
|
||||
from libloader.com import load_com
|
||||
from .base import Output, OutputError
|
||||
import pywintypes
|
||||
import logging
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
SVSFDefault = 0
|
||||
SVSFlagsAsync = 1
|
||||
SVSFPurgeBeforeSpeak = 2
|
||||
SVSFIsFilename = 4
|
||||
SVSFIsXML = 8
|
||||
SVSFIsNotXML = 16
|
||||
SVSFPersistXML = 32
|
||||
|
||||
class SAPI5(Output):
|
||||
has_volume = True
|
||||
has_rate = True
|
||||
has_pitch = True
|
||||
min_pitch = -10
|
||||
max_pitch = 10
|
||||
min_rate = -10
|
||||
max_rate = 10
|
||||
min_volume = 0
|
||||
max_volume = 100
|
||||
name = "sapi5"
|
||||
priority = 101
|
||||
system_output = True
|
||||
|
||||
def __init__(self):
|
||||
try:
|
||||
self.object = load_com("SAPI.SPVoice")
|
||||
self._voices = self._available_voices()
|
||||
except pywintypes.com_error:
|
||||
raise OutputError
|
||||
self._pitch = 0
|
||||
|
||||
def _available_voices(self):
|
||||
_voices = OrderedDict()
|
||||
for v in self.object.GetVoices():
|
||||
_voices[v.GetDescription()] = v
|
||||
return _voices
|
||||
|
||||
def list_voices(self):
|
||||
return list(self._voices.keys())
|
||||
|
||||
def get_voice(self):
|
||||
return self.object.Voice.GetDescription()
|
||||
|
||||
def set_voice(self, value):
|
||||
log.debug("Setting SAPI5 voice to \"%s\"" % value)
|
||||
self.object.Voice = self._voices[value]
|
||||
# For some reason SAPI5 does not reset audio after changing the voice
|
||||
# By setting the audio device after changing voices seems to fix this
|
||||
# This was noted from information at:
|
||||
# http://lists.nvaccess.org/pipermail/nvda-dev/2011-November/022464.html
|
||||
self.object.AudioOutput = self.object.AudioOutput
|
||||
|
||||
def get_pitch(self):
|
||||
return self._pitch
|
||||
|
||||
def set_pitch(self, value):
|
||||
log.debug("Setting pitch to %d" % value)
|
||||
self._pitch = value
|
||||
|
||||
def get_rate(self):
|
||||
return self.object.Rate
|
||||
|
||||
def set_rate(self, value):
|
||||
log.debug("Setting rate to %d" % value)
|
||||
self.object.Rate = value
|
||||
|
||||
def get_volume(self):
|
||||
return self.object.Volume
|
||||
|
||||
def set_volume(self, value):
|
||||
self.object.Volume = value
|
||||
|
||||
def speak(self, text, interrupt=False):
|
||||
if interrupt:
|
||||
self.silence()
|
||||
# We need to do the pitch in XML here
|
||||
textOutput = "<pitch absmiddle=\"%d\">%s</pitch>" % (round(self._pitch), text.replace("<", "<"))
|
||||
self.object.Speak(textOutput, SVSFlagsAsync | SVSFIsXML)
|
||||
|
||||
def silence(self):
|
||||
self.object.Speak("", SVSFlagsAsync | SVSFPurgeBeforeSpeak)
|
||||
|
||||
def is_active(self):
|
||||
if self.object:
|
||||
return True
|
||||
return False
|
||||
|
||||
output_class = SAPI5
|
@@ -1,21 +0,0 @@
|
||||
from __future__ import absolute_import
|
||||
import os
|
||||
from .base import Output
|
||||
|
||||
class AppleSay(Output):
|
||||
"""Speech output supporting the Apple Say subsystem."""
|
||||
name = 'Apple Say'
|
||||
def __init__(self, voice = 'Alex', rate = '300'):
|
||||
self.voice = voice
|
||||
self.rate = rate
|
||||
super(AppleSay, self).__init__()
|
||||
def is_active(self):
|
||||
return not os.system('which say')
|
||||
def speak(self, text, interrupt = 0):
|
||||
if interrupt:
|
||||
self.silence()
|
||||
os.system('say -v %s -r %s "%s" &' % (self.voice, self.rate, text))
|
||||
def silence(self):
|
||||
os.system('killall say')
|
||||
|
||||
output_class = AppleSay
|
@@ -1,29 +0,0 @@
|
||||
from __future__ import absolute_import
|
||||
import ctypes
|
||||
from .base import Output
|
||||
|
||||
class SystemAccess (Output):
|
||||
"""Supports System Access and System Access Mobile"""
|
||||
|
||||
name = "System Access"
|
||||
lib32 = 'saapi32.dll'
|
||||
argtypes = {
|
||||
'SA_BrlShowTextW': (ctypes.c_wchar_p,),
|
||||
'SA_SayW': (ctypes.c_wchar_p,),
|
||||
}
|
||||
priority = 99
|
||||
|
||||
def braille(self, text, **options):
|
||||
self.lib.SA_BrlShowTextW(text)
|
||||
|
||||
def speak(self, text, interrupt=False):
|
||||
if self.is_active():
|
||||
self.dll.SA_SayW(str(text))
|
||||
|
||||
def is_active(self):
|
||||
try:
|
||||
return self.dll.SA_IsRunning()
|
||||
except:
|
||||
return False
|
||||
|
||||
output_class = SystemAccess
|
@@ -1 +0,0 @@
|
||||
from __future__ import absolute_import
|
@@ -1,33 +0,0 @@
|
||||
from __future__ import absolute_import
|
||||
import win32gui
|
||||
from libloader.com import load_com
|
||||
from .base import Output, OutputError
|
||||
import pywintypes
|
||||
|
||||
class WindowEyes (Output):
|
||||
"""Speech output supporting the WindowEyes screen reader"""
|
||||
|
||||
name = 'Window-Eyes'
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
super(WindowEyes, self).__init__(*args, **kwargs)
|
||||
try:
|
||||
self.object = load_com("gwspeak.speak")
|
||||
except pywintypes.com_error:
|
||||
raise OutputError
|
||||
|
||||
def speak(self, text, interrupt=0):
|
||||
if interrupt:
|
||||
self.silence()
|
||||
self.object.SpeakString(text)
|
||||
|
||||
def silence (self):
|
||||
self.object.Silence()
|
||||
|
||||
def is_active(self):
|
||||
try:
|
||||
return win32gui.FindWindow("GWMExternalControl", "External Control") != 0
|
||||
except:
|
||||
return False
|
||||
|
||||
output_class = WindowEyes
|
@@ -1,4 +1,11 @@
|
||||
[app-settings]
|
||||
username = string(default="")
|
||||
password = string(default="")
|
||||
language = string(default="system")
|
||||
language = string(default="system")
|
||||
use_proxy = boolean(default=False)
|
||||
first_start = boolean(default=True)
|
||||
|
||||
[sound]
|
||||
volume = integer(default=100)
|
||||
input_device = string(default="Default")
|
||||
output_device = string(default="Default")
|
||||
session_mute = boolean(default=False)
|
||||
current_soundpack = string(default="default")
|
@@ -1,12 +1,22 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
name = "Socializer"
|
||||
version = "0.13"
|
||||
author = u"Manuel Cortéz"
|
||||
version = "0.24"
|
||||
author = "Manuel Cortez"
|
||||
authorEmail = "manuel@manuelcortez.net"
|
||||
copyright = u"Copyright (C) 2016, Manuel cortéz."
|
||||
description = unicode(name+" Is an accessible VK client for Windows.")
|
||||
url = "https://github.com/manuelcortez/socializer"
|
||||
update_url = "https://raw.githubusercontent.com/manuelcortez/socializer/master/update-files/socializer.json"
|
||||
copyright = "Copyright (C) 2016-2020, Manuel Cortez"
|
||||
description = name+" Is an accessible VK client for Windows."
|
||||
url = "http://socializer.su"
|
||||
# The short name will be used for detecting translation files. See languageHandler for more details.
|
||||
short_name = "socializer"
|
||||
translators = [u"Valeria K (Russian)", u"Manuel Cortez (Spanish)"]
|
||||
translators = ["Darya Ratnikova (Russian)", "Manuel Cortez (Spanish)"]
|
||||
bts_name = "socializer"
|
||||
bts_access_token = "U29jaWFsaXplcg"
|
||||
bts_url = "https://issues.manuelcortez.net"
|
||||
### Update information
|
||||
# URL to retrieve the latest updates for the stable branch.
|
||||
update_stable_url = "http://socializer.su/static/files/update/stable.json"
|
||||
# URL to retrieve update information for the "next" branch. This is a channel made for alpha versions.
|
||||
# Every commit will trigger an update, so users wanting to have the bleeding edge code will get it as soon as it is committed here and build by a runner.
|
||||
update_next_url = "http://socializer.su/static/files/update/alpha.json"
|
||||
# Short_id of the last commit, this is set to none here because it will be set manually by the building tools.
|
||||
update_next_version = "03286a44"
|
103
src/authenticator/official.py
Normal file
103
src/authenticator/official.py
Normal file
@@ -0,0 +1,103 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
""" Set of methods used to retrieve access tokens by simulating the official VK application for Android. """
|
||||
import random
|
||||
import requests
|
||||
import logging
|
||||
from hashlib import md5
|
||||
from .wxUI import two_factor_auth, bad_password
|
||||
|
||||
log = logging.getLogger("authenticator.official")
|
||||
|
||||
class AuthenticationError(Exception):
|
||||
pass
|
||||
|
||||
# Data extracted from official VK android APP.
|
||||
client_id = "2274003"
|
||||
client_secret = "hHbZxrka2uZ6jB1inYsH"
|
||||
api_ver="5.93"
|
||||
scope = "nohttps,all"
|
||||
user_agent = "VKAndroidApp/5.23-2978 (Android 4.4.2; SDK 19; x86; unknown Android SDK built for x86; en; 320x240)"
|
||||
|
||||
api_url = "https://api.vk.com/method/"
|
||||
|
||||
def get_device_id():
|
||||
""" Generate a random device ID, consisting in 16 alphanumeric characters."""
|
||||
return "".join(random.choice(["1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "a", "b", "c", "d", "e", "f"]) for _ in range(16))
|
||||
|
||||
def get_sig(method, values, secret):
|
||||
""" Create a signature for parameters passed to VK API. """
|
||||
postdata = ""
|
||||
for key in values:
|
||||
# None values should be excluded from SIG, otherwise VK won't validate it correctly.
|
||||
if values[key] != None:
|
||||
postdata = postdata + "{key}={value}&".format(key=key, value=values[key])
|
||||
# Remove the last "&" character.
|
||||
postdata = postdata[:-1]
|
||||
sig = md5(b"/method/"+method.encode("utf-8")+b"?"+postdata.encode("utf-8")+secret.encode("utf-8"))
|
||||
return sig.hexdigest()
|
||||
|
||||
def perform_request(method, postdata, secret):
|
||||
""" Send a request to VK servers by signing the data with the 'sig' parameter."""
|
||||
url = api_url+method
|
||||
sig = get_sig(method, postdata, secret)
|
||||
postdata.update(sig=sig)
|
||||
headers = {'User-Agent': user_agent}
|
||||
r = requests.post(url, data=postdata, headers=headers)
|
||||
return r.json()
|
||||
|
||||
def get_non_refreshed(login, password, scope=scope):
|
||||
""" Retrieves a non-refreshed token, this should be the first token needed to authenticate in VK.
|
||||
returns the access_token which still needs to be refreshed, device_id, and secret code, needed to sign all petitions in VK."""
|
||||
if not (login or password):
|
||||
raise ValueError("Both user and password are required.")
|
||||
device_id = get_device_id()
|
||||
# Let's authenticate.
|
||||
url = "https://oauth.vk.com/token"
|
||||
params = dict(grant_type="password",
|
||||
client_id=client_id, client_secret=client_secret, username=login,
|
||||
password=password, v=api_ver, scope=scope, lang="en", device_id=device_id, force_sms=1)
|
||||
# Add two factor auth later due to python's syntax.
|
||||
params["2fa_supported"] = 1
|
||||
headers = {'User-Agent': user_agent}
|
||||
r = requests.get(url, params=params, headers=headers)
|
||||
log.exception(r.json())
|
||||
# If a 401 error is raised, we need to use 2FA here.
|
||||
# see https://vk.com/dev/auth_direct (switch lang to russian, english docs are very incomplete in the matter)
|
||||
# ToDo: this needs testing after implemented official VK tokens.
|
||||
if r.status_code == 401 and "phone_mask" in r.text:
|
||||
t = r.json()
|
||||
code, remember = two_factor_auth()
|
||||
url = "https://oauth.vk.com/token"
|
||||
params = dict(grant_type="password", lang="en",
|
||||
client_id=client_id, client_secret=client_secret, username=login,
|
||||
password=password, v=api_ver, scope=scope, device_id=device_id, code=code)
|
||||
r = requests.get(url, params=params, headers=headers)
|
||||
if r.status_code == 200 and 'access_token' in r.text:
|
||||
res = r.json()
|
||||
# Retrieve access_token and secret.
|
||||
access_token = res['access_token']
|
||||
secret = res['secret']
|
||||
return access_token, secret, device_id
|
||||
else:
|
||||
raise AuthenticationError(r.text)
|
||||
|
||||
def refresh_token(token, secret, device_id):
|
||||
method = "execute.getUserInfo"
|
||||
postdata = dict(v=api_ver, https=1, androidVersion=19, androidModel="Android SDK built for x86", info_fields="audio_ads,audio_background_limit,country,discover_design_version,discover_preload,discover_preload_not_seen,gif_autoplay,https_required,inline_comments,intro,lang,menu_intro,money_clubs_p2p,money_p2p,money_p2p_params,music_intro,audio_restrictions,profiler_settings,raise_to_record_enabled,stories,masks,subscriptions,support_url,video_autoplay,video_player,vklive_app,community_comments,webview_authorization,story_replies,animated_stickers,community_stories,live_section,playlists_download,calls,security_issue,eu_user,wallet,vkui_community_create,vkui_profile_edit,vkui_community_manage,vk_apps,stories_photo_duration,stories_reposts,live_streaming,live_masks,camera_pingpong,role,video_discover", device_id=device_id, lang="en", func_v=11, androidManufacturer="unknown", fields="photo_100,photo_50,exports,country,sex,status,bdate,first_name_gen,last_name_gen,verified,trending", access_token=token)
|
||||
perform_request(method, postdata, secret)
|
||||
method = "auth.refreshToken"
|
||||
postdata = dict(v=api_ver, https=1, timestamp=0, receipt2="", device_id=device_id, receipt="", lang="en", nonce="", access_token=token)
|
||||
return perform_request(method, postdata, secret)
|
||||
|
||||
def login(user, password):
|
||||
try:
|
||||
access_token, secret, device_id = get_non_refreshed(user, password)
|
||||
response = refresh_token(access_token, secret, device_id)
|
||||
except AuthenticationError:
|
||||
bad_password()
|
||||
raise AuthenticationError("")
|
||||
try:
|
||||
return response["response"]["token"], secret, device_id
|
||||
except KeyError:
|
||||
log.exception("An exception has occurred while attempting to authenticate. Printing response returned by vk...")
|
||||
log.exception(response)
|
17
src/authenticator/wxUI.py
Normal file
17
src/authenticator/wxUI.py
Normal file
@@ -0,0 +1,17 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals
|
||||
import time
|
||||
import wx
|
||||
import widgetUtils
|
||||
|
||||
def two_factor_auth():
|
||||
code = None
|
||||
dlg = wx.TextEntryDialog(None, _("Please provide the authentication code you have received from VK."), _("Two factor authentication code"))
|
||||
response = dlg.ShowModal()
|
||||
if response == widgetUtils.OK:
|
||||
code = dlg.GetValue()
|
||||
dlg.Destroy()
|
||||
return (code, True)
|
||||
|
||||
def bad_password():
|
||||
return wx.MessageDialog(None, _("Your password or email address are incorrect. Please fix the mistakes and try it again."), _("Wrong data"), wx.ICON_ERROR).ShowModal()
|
5
src/babel.cfg
Normal file
5
src/babel.cfg
Normal file
@@ -0,0 +1,5 @@
|
||||
[python: **.py]
|
||||
input_dirs = .
|
||||
output_file=socializer.pot
|
||||
msgid_bugs_address=manuel@manuelcortez.net
|
||||
copyright_holder=Manuel Cortez
|
@@ -1,4 +1,5 @@
|
||||
# -*- coding: cp1252 -*-
|
||||
import os
|
||||
import config_utils
|
||||
import paths
|
||||
import logging
|
||||
@@ -12,5 +13,5 @@ app = None
|
||||
def setup ():
|
||||
global app
|
||||
log.debug("Loading global app settings...")
|
||||
app = config_utils.load_config(paths.config_path(MAINFILE), paths.app_path(MAINSPEC))
|
||||
app = config_utils.load_config(os.path.join(paths.config_path(), MAINFILE), os.path.join(paths.app_path(), MAINSPEC))
|
||||
|
@@ -45,7 +45,7 @@ def hist(keys):
|
||||
def find_problems(hist):
|
||||
"Takes a histogram and returns a list of items occurring more than once."
|
||||
res=[]
|
||||
for k,v in hist.items():
|
||||
for k,v in list(hist.items()):
|
||||
if v>1:
|
||||
res.append(k)
|
||||
return res
|
||||
|
@@ -1,38 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
import os
|
||||
import widgetUtils
|
||||
import logging
|
||||
from wxUI.dialogs import attach as gui
|
||||
log = logging.getLogger("controller.attach")
|
||||
|
||||
class attach(object):
|
||||
def __init__(self):
|
||||
self.attachments = list()
|
||||
self.dialog = gui.attachDialog()
|
||||
widgetUtils.connect_event(self.dialog.photo, widgetUtils.BUTTON_PRESSED, self.upload_image)
|
||||
widgetUtils.connect_event(self.dialog.remove, widgetUtils.BUTTON_PRESSED, self.remove_attachment)
|
||||
self.dialog.get_response()
|
||||
log.debug("Attachments controller started.")
|
||||
|
||||
def upload_image(self, *args, **kwargs):
|
||||
image, description = self.dialog.get_image()
|
||||
if image != None:
|
||||
imageInfo = {"type": "photo", "file": image, "description": os.path.basename(image)}
|
||||
log.debug("Image data to upload: %r" % (imageInfo,))
|
||||
self.attachments.append(imageInfo)
|
||||
info = [_(u"Photo"), os.path.basename(image)]
|
||||
self.dialog.attachments.insert_item(False, *info)
|
||||
self.dialog.remove.Enable(True)
|
||||
|
||||
def remove_attachment(self, *args, **kwargs):
|
||||
current_item = self.dialog.attachments.get_selected()
|
||||
log.debug("Removing item %d" % (current_item,))
|
||||
if current_item == -1: current_item = 0
|
||||
self.attachments.pop(current_item)
|
||||
self.dialog.attachments.remove_item(current_item)
|
||||
self.check_remove_status()
|
||||
log.debug("Removed")
|
||||
|
||||
def check_remove_status(self):
|
||||
if len(self.attachments) == 0 and self.dialog.attachments.get_count() == 0:
|
||||
self.dialog.remove.Enable(False)
|
File diff suppressed because it is too large
Load Diff
@@ -1,22 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
import widgetUtils
|
||||
from wxUI.dialogs import configuration as configurationUI
|
||||
|
||||
class configuration(object):
|
||||
|
||||
def __init__(self, session):
|
||||
self.session = session
|
||||
self.dialog = configurationUI.configurationDialog(_(u"Preferences"))
|
||||
self.create_config()
|
||||
|
||||
def create_config(self):
|
||||
self.dialog.create_general()
|
||||
self.dialog.set_value("general", "wall_buffer_count", self.session.settings["buffers"]["count_for_wall_buffers"])
|
||||
self.dialog.set_value("general", "audio_buffers_count", self.session.settings["buffers"]["count_for_audio_buffers"])
|
||||
self.dialog.realize()
|
||||
self.response = self.dialog.get_response()
|
||||
|
||||
def save_configuration(self):
|
||||
self.session.settings["buffers"]["count_for_audio_buffers"] = self.dialog.get_value("general", "wall_buffer_count")
|
||||
self.session.settings["buffers"]["count_for_audio_buffers"] = self.dialog.get_value("general", "audio_buffers_count")
|
||||
self.session.settings.write()
|
@@ -1,22 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
import threading
|
||||
from vk import longpool
|
||||
from pubsub import pub
|
||||
|
||||
class worker(threading.Thread):
|
||||
def __init__(self, session):
|
||||
super(worker, self).__init__()
|
||||
self.session = session
|
||||
self.l = longpool.LongPoll(self.session.vk.client)
|
||||
|
||||
def run(self):
|
||||
while self.session.is_logged == True:
|
||||
p = self.l.check()
|
||||
for i in p:
|
||||
# print i.message_id, i.flags, i.from_id, i.user_id, i.mask, i.byself, i.message_flags
|
||||
# if i.flags == 4 or i.flags == 51 or i.flags == 49:
|
||||
if i.text != None and i.from_id != None and i.flags != None and i.message_flags != None:
|
||||
# print i.message_id, i.flags, i.from_id, i.user_id, i.mask, i.byself, i.message_flags
|
||||
# if i.from_id != None:
|
||||
# print "ordering sent stuff"
|
||||
pub.sendMessage("order-sent-message", obj=i)
|
File diff suppressed because it is too large
Load Diff
@@ -1,56 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
import widgetUtils
|
||||
import output
|
||||
from pubsub import pub
|
||||
import attach
|
||||
from wxUI.dialogs import message
|
||||
from extra import SpellChecker, translator
|
||||
|
||||
class post(object):
|
||||
def __init__(self, title, caption, text, post_type="post"):
|
||||
super(post, self).__init__()
|
||||
self.title = title
|
||||
self.message = getattr(message, post_type)(title, caption, text)
|
||||
self.message.set_title(title)
|
||||
widgetUtils.connect_event(self.message.spellcheck, widgetUtils.BUTTON_PRESSED, self.spellcheck)
|
||||
widgetUtils.connect_event(self.message.translateButton, widgetUtils.BUTTON_PRESSED, self.translate)
|
||||
self.images = []
|
||||
if hasattr(self.message, "attach"):
|
||||
widgetUtils.connect_event(self.message.attach, widgetUtils.BUTTON_PRESSED, self.show_attach_dialog)
|
||||
|
||||
def get_privacy_options(self):
|
||||
p = self.message.get("privacy")
|
||||
if p == _(u"Friends of friends"):
|
||||
privacy = 0
|
||||
elif p == _(u"All users"):
|
||||
privacy = 1
|
||||
return privacy
|
||||
|
||||
def translate(self, *args, **kwargs):
|
||||
dlg = translator.gui.translateDialog()
|
||||
if dlg.get_response() == widgetUtils.OK:
|
||||
text_to_translate = self.message.get_text()
|
||||
source = [x[0] for x in translator.translator.available_languages()][dlg.get("source_lang")]
|
||||
dest = [x[0] for x in translator.translator.available_languages()][dlg.get("dest_lang")]
|
||||
msg = translator.translator.translate(text_to_translate, source, dest)
|
||||
self.message.set_text(msg)
|
||||
self.message.text_focus()
|
||||
output.speak(_(u"Translated"))
|
||||
dlg.Destroy()
|
||||
|
||||
def spellcheck(self, event=None):
|
||||
text = self.message.get_text()
|
||||
checker = SpellChecker.spellchecker.spellChecker(text, "")
|
||||
if hasattr(checker, "fixed_text"):
|
||||
self.message.set_text(checker.fixed_text)
|
||||
checker.clean()
|
||||
|
||||
def show_attach_dialog(self, *args, **kwargs):
|
||||
a = attach.attach()
|
||||
if len(a.attachments) != 0:
|
||||
self.attachments = a.attachments
|
||||
|
||||
class comment(post):
|
||||
def __init__(self, title, caption, text):
|
||||
super(comment, self).__init__(title, caption, text, "comment")
|
||||
self.message.set_title(_(u"New comment"))
|
@@ -1,88 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
import output
|
||||
import sound_lib
|
||||
from sound_lib.stream import URLStream
|
||||
from mysc.repeating_timer import RepeatingTimer
|
||||
from pubsub import pub
|
||||
|
||||
player = None
|
||||
|
||||
def setup():
|
||||
global player
|
||||
if player == None:
|
||||
player = audioPlayer()
|
||||
|
||||
class audioPlayer(object):
|
||||
|
||||
def __init__(self):
|
||||
self.is_playing = False
|
||||
self.stream = None
|
||||
self.vol = 100
|
||||
self.is_working = False
|
||||
self.queue = []
|
||||
self.stopped = True
|
||||
|
||||
def play(self, url):
|
||||
if self.stream != None and self.stream.is_playing == True:
|
||||
self.stream.stop()
|
||||
self.stopped = True
|
||||
if hasattr(self, "worker") and self.worker != None:
|
||||
self.worker.cancel()
|
||||
self.worker = None
|
||||
self.queue = []
|
||||
# Make sure that there are no other sounds trying to be played.
|
||||
if self.is_working == False:
|
||||
self.is_working = True
|
||||
self.stream = URLStream(url=url["url"])
|
||||
msg = _(u"Playing {0} by {1}").format(url["title"], url["artist"])
|
||||
pub.sendMessage("update-status-bar", status=msg)
|
||||
self.stream.volume = self.vol/100.0
|
||||
self.stream.play()
|
||||
self.stopped = False
|
||||
self.is_working = False
|
||||
|
||||
def stop(self):
|
||||
if self.stream != None and self.stream.is_playing == True:
|
||||
self.stream.stop()
|
||||
self.stopped = True
|
||||
if hasattr(self, "worker") and self.worker != None:
|
||||
self.worker.cancel()
|
||||
self.worker = None
|
||||
self.queue = []
|
||||
|
||||
def pause(self):
|
||||
if self.stream != None:
|
||||
if self.stream.is_playing == True:
|
||||
self.stream.pause()
|
||||
self.stopped = True
|
||||
else:
|
||||
self.stream.play()
|
||||
self.stopped = False
|
||||
|
||||
@property
|
||||
def volume(self):
|
||||
if self.stream != None:
|
||||
return self.vol
|
||||
|
||||
@volume.setter
|
||||
def volume(self, vol):
|
||||
if vol <= 100 and vol >= 0:
|
||||
self.vol = vol
|
||||
if self.stream != None:
|
||||
self.stream.volume = self.vol/100.0
|
||||
|
||||
def play_all(self, list_of_urls):
|
||||
self.stop()
|
||||
self.queue = list_of_urls
|
||||
self.play(self.queue[0])
|
||||
self.queue.remove(self.queue[0])
|
||||
self.worker = RepeatingTimer(5, self.player_function)
|
||||
self.worker.start()
|
||||
|
||||
def player_function(self):
|
||||
if self.stream != None and self.stream.is_playing == False and self.stopped == False:
|
||||
if len(self.queue) == 0:
|
||||
self.worker.cancel()
|
||||
return
|
||||
self.play(self.queue[0])
|
||||
self.queue.remove(self.queue[0])
|
@@ -1,458 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
import os
|
||||
import arrow
|
||||
import messages
|
||||
import languageHandler
|
||||
import widgetUtils
|
||||
import output
|
||||
import wx
|
||||
import webbrowser
|
||||
import utils
|
||||
import logging
|
||||
from sessionmanager import session # We'll use some functions from there
|
||||
from pubsub import pub
|
||||
from wxUI.dialogs import postDialogs, urlList
|
||||
from extra import SpellChecker, translator
|
||||
from mysc.thread_utils import call_threaded
|
||||
from wxUI import menus
|
||||
|
||||
log = logging.getLogger("controller.post")
|
||||
|
||||
def get_user(id, profiles):
|
||||
""" Returns an user name and last name based in the id receibed."""
|
||||
for i in profiles:
|
||||
if i["id"] == id:
|
||||
return u"{0} {1}".format(i["first_name"], i["last_name"])
|
||||
return _(u"Unknown username")
|
||||
|
||||
def add_attachment(attachment):
|
||||
msg = u""
|
||||
tpe = ""
|
||||
if attachment["type"] == "link":
|
||||
msg = u"{0}: {1}".format(attachment["link"]["title"], attachment["link"]["url"])
|
||||
tpe = _(u"Link")
|
||||
elif attachment["type"] == "photo":
|
||||
tpe = _(u"Photo")
|
||||
msg = attachment["photo"]["text"]
|
||||
if msg == "":
|
||||
msg = _(u"no description available")
|
||||
elif attachment["type"] == "video":
|
||||
msg = u"{0}".format(attachment["video"]["title"],)
|
||||
tpe = _(u"Video")
|
||||
elif attachment["type"] == "audio":
|
||||
msg = u"{0}".format(" ".join(session.compose_audio(attachment["audio"])))
|
||||
tpe = _(u"Audio")
|
||||
elif attachment["type"] == "doc":
|
||||
msg = u"{0}".format(attachment["doc"]["title"])
|
||||
tpe = _(u"{0} file").format(attachment["doc"]["ext"])
|
||||
return [tpe, msg]
|
||||
|
||||
def get_message(status):
|
||||
message = ""
|
||||
if status.has_key("text"):
|
||||
message = utils.clean_text(status["text"])
|
||||
return message
|
||||
|
||||
class postController(object):
|
||||
def __init__(self, session, postObject):
|
||||
super(postController, self).__init__()
|
||||
self.session = session
|
||||
self.post = postObject
|
||||
# Posts from newsfeed contains this source_id instead from_id in walls. Also it uses post_id and walls use just id.
|
||||
if self.post.has_key("source_id"):
|
||||
self.user_identifier = "source_id"
|
||||
self.post_identifier = "post_id"
|
||||
else:
|
||||
# In wall's posts, if someone has posted in user's wall, owner_id should be used instead from_id
|
||||
# This will help for retrieving comments, do likes, etc.
|
||||
if not self.post.has_key("owner_id"):
|
||||
self.user_identifier = "from_id"
|
||||
else:
|
||||
self.user_identifier = "owner_id"
|
||||
self.post_identifier = "id"
|
||||
self.dialog = postDialogs.post()
|
||||
# self.dialog.comments.list.Bind(wx.EVT_LIST_ITEM_ACTIVATED, self.show_comment)
|
||||
widgetUtils.connect_event(self.dialog.like, widgetUtils.BUTTON_PRESSED, self.post_like)
|
||||
widgetUtils.connect_event(self.dialog.comment, widgetUtils.BUTTON_PRESSED, self.add_comment)
|
||||
widgetUtils.connect_event(self.dialog.tools, widgetUtils.BUTTON_PRESSED, self.show_tools_menu)
|
||||
widgetUtils.connect_event(self.dialog.repost, widgetUtils.BUTTON_PRESSED, self.post_repost)
|
||||
# self.dialog.Bind(wx.EVT_LIST_ITEM_RIGHT_CLICK, self.show_menu, self.dialog.comments.list)
|
||||
# self.dialog.Bind(wx.EVT_LIST_KEY_DOWN, self.show_menu_by_key, self.dialog.comments.list)
|
||||
call_threaded(self.load_all_components)
|
||||
# if self.post.has_key("attachments"): print self.post["attachments"]
|
||||
self.attachments = []
|
||||
|
||||
def get_comments(self):
|
||||
user = self.post[self.user_identifier]
|
||||
id = self.post[self.post_identifier]
|
||||
self.comments = self.session.vk.client.wall.getComments(owner_id=user, post_id=id, need_likes=1, count=100, extended=1, preview_length=0)
|
||||
comments_ = []
|
||||
for i in self.comments["items"]:
|
||||
from_ = get_user(i["from_id"], self.comments["profiles"])
|
||||
if len(i["text"]) > 140:
|
||||
text = i["text"][:141]
|
||||
else:
|
||||
text = i["text"]
|
||||
original_date = arrow.get(i["date"])
|
||||
created_at = original_date.humanize(locale=languageHandler.getLanguage())
|
||||
likes = str(i["likes"]["count"])
|
||||
comments_.append((from_, text, created_at, likes))
|
||||
self.dialog.insert_comments(comments_)
|
||||
|
||||
def get_post_information(self):
|
||||
from_ = self.session.get_user_name(self.post[self.user_identifier])
|
||||
if self.post.has_key("copy_history"):
|
||||
title = _(u"repost from {0}").format(from_,)
|
||||
else:
|
||||
if self.post.has_key("from_id") and self.post.has_key("owner_id"):
|
||||
title = _(u"Post from {0} in the {1}'s wall").format(self.session.get_user_name(self.post["from_id"]), self.session.get_user_name(self.post["owner_id"]))
|
||||
else:
|
||||
title = _(u"Post from {0}").format(from_,)
|
||||
self.dialog.set_title(title)
|
||||
message = u""
|
||||
message = get_message(self.post)
|
||||
if self.post.has_key("copy_history"):
|
||||
nm = u"\n"
|
||||
for i in self.post["copy_history"]:
|
||||
nm += u"{0}: {1}\n\n".format(self.session.get_user_name(i["from_id"]), get_message(i))
|
||||
self.get_attachments(i)
|
||||
message += nm
|
||||
self.dialog.set_post(message)
|
||||
self.get_attachments(self.post)
|
||||
|
||||
def get_attachments(self, post):
|
||||
attachments = []
|
||||
if post.has_key("attachments"):
|
||||
for i in post["attachments"]:
|
||||
# We don't need the photos_list attachment, so skip it.
|
||||
if i["type"] == "photos_list":
|
||||
continue
|
||||
attachments.append(add_attachment(i))
|
||||
self.attachments.append(i)
|
||||
# Links in text are not treated like normal attachments, so we'll have to catch and add those to the list without title
|
||||
# We can't get a title because title is provided by the VK API and it will not work for links as simple text.
|
||||
urls = utils.find_urls_in_text(self.dialog.get("post_view"))
|
||||
print urls
|
||||
if len(urls) > 0:
|
||||
links = []
|
||||
for i in urls:
|
||||
links.append({"link": {"title": _(U"Untitled link"), "url": i}, "type": "link"})
|
||||
for i in links:
|
||||
attachments.append(add_attachment(i))
|
||||
self.attachments.append(i)
|
||||
if len(self.attachments) > 0:
|
||||
self.dialog.attachments.list.Enable(True)
|
||||
self.dialog.attachments.list.Bind(wx.EVT_LIST_ITEM_ACTIVATED, self.open_attachment)
|
||||
self.dialog.insert_attachments(attachments)
|
||||
|
||||
def load_all_components(self):
|
||||
self.get_post_information()
|
||||
self.get_likes()
|
||||
self.get_reposts()
|
||||
self.get_comments()
|
||||
if self.post["comments"]["can_post"] == 0:
|
||||
self.dialog.disable("add_comment")
|
||||
if self.post["likes"]["can_like"] == 0 and self.post["likes"]["user_likes"] == 0:
|
||||
self.dialog.disable("like")
|
||||
elif self.post["likes"]["user_likes"] == 1:
|
||||
self.dialog.set("like", _(u"&Dislike"))
|
||||
if self.post["likes"]["can_publish"] == 0:
|
||||
self.dialog.disable("repost")
|
||||
|
||||
def post_like(self, *args, **kwargs):
|
||||
if self.post.has_key("owner_id") == False:
|
||||
user = int(self.post[self.user_identifier])
|
||||
else:
|
||||
user = int(self.post["owner_id"])
|
||||
id = int(self.post[self.post_identifier])
|
||||
if self.post.has_key("type"):
|
||||
type_ = self.post["type"]
|
||||
else:
|
||||
type_ = "post"
|
||||
if self.dialog.get("like") == _(u"&Dislike"):
|
||||
l = self.session.vk.client.likes.delete(owner_id=user, item_id=id, type=type_)
|
||||
output.speak(_(u"You don't like this"))
|
||||
self.post["likes"]["count"] = l["likes"]
|
||||
self.post["likes"]["user_likes"] = 2
|
||||
self.get_likes()
|
||||
self.dialog.set("like", _(u"&Like"))
|
||||
else:
|
||||
l = self.session.vk.client.likes.add(owner_id=user, item_id=id, type=type_)
|
||||
output.speak(_(u"You liked this"))
|
||||
self.dialog.set("like", _(u"&Dislike"))
|
||||
self.post["likes"]["count"] = l["likes"]
|
||||
self.post["likes"]["user_likes"] = 1
|
||||
self.get_likes()
|
||||
|
||||
def post_repost(self, *args, **kwargs):
|
||||
object_id = "wall{0}_{1}".format(self.post[self.user_identifier], self.post[self.post_identifier])
|
||||
p = messages.post(title=_(u"Repost"), caption=_(u"Add your comment here"), text="")
|
||||
if p.message.get_response() == widgetUtils.OK:
|
||||
msg = p.message.get_text().encode("utf-8")
|
||||
self.session.vk.client.wall.repost(object=object_id, message=msg)
|
||||
|
||||
def get_likes(self):
|
||||
self.dialog.set_likes(self.post["likes"]["count"])
|
||||
|
||||
def get_reposts(self):
|
||||
self.dialog.set_shares(self.post["reposts"]["count"])
|
||||
|
||||
def add_comment(self, *args, **kwargs):
|
||||
comment = messages.comment(title=_(u"Add a comment"), caption="", text="")
|
||||
if comment.message.get_response() == widgetUtils.OK:
|
||||
msg = comment.message.get_text().encode("utf-8")
|
||||
try:
|
||||
user = self.post[self.user_identifier]
|
||||
id = self.post[self.post_identifier]
|
||||
self.session.vk.client.wall.addComment(owner_id=user, post_id=id, text=msg)
|
||||
output.speak(_(u"You've posted a comment"))
|
||||
if self.comments["count"] < 100:
|
||||
self.clear_comments_list()
|
||||
self.get_comments()
|
||||
except Exception as msg:
|
||||
print msg
|
||||
|
||||
def clear_comments_list(self):
|
||||
self.dialog.comments.clear()
|
||||
|
||||
def show_comment(self, *args, **kwargs):
|
||||
c = comment(self.session, self.comments["data"][self.dialog.comments.get_selected()])
|
||||
c.dialog.get_response()
|
||||
|
||||
def show_menu(self, *args, **kwargs):
|
||||
if self.dialog.comments.get_count() == 0: return
|
||||
menu = menus.commentMenu()
|
||||
widgetUtils.connect_event(self.dialog, widgetUtils.MENU, self.show_comment, menuitem=menu.open)
|
||||
widgetUtils.connect_event(self.dialog, widgetUtils.MENU, self.comment_like, menuitem=menu.like)
|
||||
widgetUtils.connect_event(self.dialog, widgetUtils.MENU, self.comment_unlike, menuitem=menu.unlike)
|
||||
self.dialog.PopupMenu(menu, self.dialog.comments.list.GetPosition())
|
||||
|
||||
def show_menu_by_key(self, ev):
|
||||
if ev.GetKeyCode() == wx.WXK_WINDOWS_MENU:
|
||||
self.show_menu()
|
||||
|
||||
def show_tools_menu(self, *args, **kwargs):
|
||||
menu = menus.toolsMenu()
|
||||
widgetUtils.connect_event(self.dialog, widgetUtils.MENU, self.open_url, menuitem=menu.url)
|
||||
widgetUtils.connect_event(self.dialog, widgetUtils.MENU, self.translate, menuitem=menu.translate)
|
||||
widgetUtils.connect_event(self.dialog, widgetUtils.MENU, self.spellcheck, menuitem=menu.CheckSpelling)
|
||||
self.dialog.PopupMenu(menu, self.dialog.tools.GetPosition())
|
||||
|
||||
def comment_like(self, *args, **kwargs):
|
||||
comment_id = self.comments["data"][self.dialog.comments.get_selected()]["id"]
|
||||
self.session.like(comment_id)
|
||||
output.speak(_(u"You do like this comment"))
|
||||
|
||||
def comment_unlike(self, *args, **kwargs):
|
||||
comment_id = self.comments["data"][self.dialog.comments.get_selected()]["id"]
|
||||
self.session.unlike(comment_id)
|
||||
output.speak(_(u"You don't like this comment"))
|
||||
|
||||
def translate(self, *args, **kwargs):
|
||||
dlg = translator.gui.translateDialog()
|
||||
if dlg.get_response() == widgetUtils.OK:
|
||||
text_to_translate = self.dialog.post_view.GetValue().encode("utf-8")
|
||||
source = [x[0] for x in translator.translator.available_languages()][dlg.get("source_lang")]
|
||||
dest = [x[0] for x in translator.translator.available_languages()][dlg.get("dest_lang")]
|
||||
msg = translator.translator.translate(text_to_translate, source, dest)
|
||||
self.dialog.post_view.ChangeValue(msg)
|
||||
output.speak(_(u"Translated"))
|
||||
else:
|
||||
return
|
||||
|
||||
def spellcheck(self, *args, **kwargs):
|
||||
text = self.dialog.post_view.GetValue()
|
||||
checker = SpellChecker.spellchecker.spellChecker(text, "")
|
||||
if hasattr(checker, "fixed_text"):
|
||||
self.dialog.post_view.ChangeValue(checker.fixed_text)
|
||||
|
||||
def open_url(self, *args, **kwargs):
|
||||
text = self.dialog.post_view.GetValue()
|
||||
urls = find_urls(text)
|
||||
url = None
|
||||
if len(urls) == 0: return
|
||||
if len(urls) == 1:
|
||||
url = urls[0]
|
||||
elif len(urls) > 1:
|
||||
url_list = urlList.urlList()
|
||||
url_list.populate_list(urls)
|
||||
if url_list.get_response() == widgetUtils.OK:
|
||||
url = urls[url_list.get_item()]
|
||||
if url != None:
|
||||
output.speak(_(u"Opening URL..."), True)
|
||||
webbrowser.open_new_tab(url)
|
||||
|
||||
def open_attachment(self, *args, **kwargs):
|
||||
index = self.dialog.attachments.get_selected()
|
||||
attachment = self.attachments[index]
|
||||
if attachment["type"] == "audio":
|
||||
a = audio(session=self.session, postObject=[attachment["audio"]])
|
||||
a.dialog.get_response()
|
||||
a.dialog.Destroy()
|
||||
if attachment["type"] == "link":
|
||||
output.speak(_(u"Opening URL..."), True)
|
||||
webbrowser.open_new_tab(attachment["link"]["url"])
|
||||
elif attachment["type"] == "doc":
|
||||
output.speak(_(u"Opening document in web browser..."))
|
||||
webbrowser.open(attachment["doc"]["url"])
|
||||
elif attachment["type"] == "video":
|
||||
# it seems VK doesn't like to attach video links as normal URLS, so we'll have to
|
||||
# get the full video object and use its "player" key which will open a webbrowser in their site with a player for the video.
|
||||
# see https://vk.com/dev/attachments_w and and https://vk.com/dev/video.get
|
||||
# However, the flash player isn't good for visually impaired people (when you press play you won't be able to close the window with alt+f4), so it could be good to use the HTML5 player.
|
||||
# For firefox, see https://addons.mozilla.org/ru/firefox/addon/force-html5-video-player-at-vk/
|
||||
# May be I could use a dialogue here for inviting people to use this addon in firefox. It seems it isn't possible to use this html5 player from the player URL.
|
||||
object_id = "{0}_{1}".format(attachment["video"]["owner_id"], attachment["video"]["id"])
|
||||
video_object = self.session.vk.client.video.get(owner_id=attachment["video"]["owner_id"], videos=object_id)
|
||||
video_object = video_object["items"][0]
|
||||
output.speak(_(u"Opening video in web browser..."), True)
|
||||
webbrowser.open_new_tab(video_object["player"])
|
||||
elif attachment["type"] == "photo":
|
||||
output.speak(_(u"Opening photo in web browser..."), True)
|
||||
# Possible photo sizes for looking in the attachment information. Try to use the biggest photo available.
|
||||
possible_sizes = [1280, 604, 130, 75]
|
||||
url = ""
|
||||
for i in possible_sizes:
|
||||
if attachment["photo"].has_key("photo_{0}".format(i,)):
|
||||
url = attachment["photo"]["photo_{0}".format(i,)]
|
||||
if url != "":
|
||||
webbrowser.open_new_tab(url)
|
||||
else:
|
||||
print attachment["photo"].keys()
|
||||
else:
|
||||
log.debug("Unhandled attachment: %r" % (attachment,))
|
||||
|
||||
class comment(object):
|
||||
def __init__(self, session, comment_object):
|
||||
super(comment, self).__init__()
|
||||
self.session = session
|
||||
self.comment = comment_object
|
||||
self.dialog = postDialogs.comment()
|
||||
from_ = self.comment["from"]["name"]
|
||||
message = self.comment["message"]
|
||||
original_date = arrow.get(self.comment["created_time"], "YYYY-MM-DTHH:m:sZ", locale="en")
|
||||
created_at = original_date.humanize(locale=languageHandler.getLanguage())
|
||||
self.dialog.set_post(message)
|
||||
self.dialog.set_title(_(u"Comment from {0}").format(from_,))
|
||||
widgetUtils.connect_event(self.dialog.like, widgetUtils.BUTTON_PRESSED, self.post_like)
|
||||
call_threaded(self.get_likes)
|
||||
|
||||
def get_likes(self):
|
||||
self.likes = self.session.fb.client.get_connections(id=self.comment["id"], connection_name="likes", summary=True)
|
||||
self.dialog.set_likes(self.likes["summary"]["total_count"])
|
||||
|
||||
def post_like(self, *args, **kwargs):
|
||||
lk = self.session.like(self.comment["id"])
|
||||
self.get_likes()
|
||||
|
||||
class audio(postController):
|
||||
def __init__(self, session, postObject):
|
||||
self.added_audios = {}
|
||||
self.session = session
|
||||
self.post = postObject
|
||||
self.dialog = postDialogs.audio()
|
||||
widgetUtils.connect_event(self.dialog.list, widgetUtils.LISTBOX_CHANGED, self.handle_changes)
|
||||
self.load_audios()
|
||||
self.fill_information(0)
|
||||
widgetUtils.connect_event(self.dialog.download, widgetUtils.BUTTON_PRESSED, self.download)
|
||||
widgetUtils.connect_event(self.dialog.play, widgetUtils.BUTTON_PRESSED, self.play)
|
||||
widgetUtils.connect_event(self.dialog.add, widgetUtils.BUTTON_PRESSED, self.add_to_library)
|
||||
widgetUtils.connect_event(self.dialog.remove, widgetUtils.BUTTON_PRESSED, self.remove_from_library)
|
||||
|
||||
def add_to_library(self, *args, **kwargs):
|
||||
post = self.post[self.dialog.get_audio()]
|
||||
args = {}
|
||||
args["audio_id"] = post["id"]
|
||||
if post.has_key("album_id"):
|
||||
args["album_id"] = post["album_id"]
|
||||
args["owner_id"] = post["owner_id"]
|
||||
audio = self.session.vk.client.audio.add(**args)
|
||||
if audio != None and int(audio) > 21:
|
||||
self.added_audios[post["id"]] = audio
|
||||
self.dialog.change_state("add", False)
|
||||
self.dialog.change_state("remove", True)
|
||||
|
||||
def remove_from_library(self, *args, **kwargs):
|
||||
post = self.post[self.dialog.get_audio()]
|
||||
args = {}
|
||||
if self.added_audios.has_key(post["id"]):
|
||||
args["audio_id"] = self.added_audios[post["id"]]
|
||||
args["owner_id"] = self.session.user_id
|
||||
else:
|
||||
args["audio_id"] = post["id"]
|
||||
args["owner_id"] = post["owner_id"]
|
||||
result = self.session.vk.client.audio.delete(**args)
|
||||
if int(result) == 1:
|
||||
self.dialog.change_state("add", True)
|
||||
self.dialog.change_state("remove", False)
|
||||
if self.added_audios.has_key(post["id"]):
|
||||
self.added_audios.pop(post["id"])
|
||||
|
||||
def fill_information(self, index):
|
||||
post = self.post[index]
|
||||
if post.has_key("artist"):
|
||||
self.dialog.set("artist", post["artist"])
|
||||
if post.has_key("title"):
|
||||
self.dialog.set("title", post["title"])
|
||||
if post.has_key("duration"):
|
||||
self.dialog.set("duration", utils.seconds_to_string(post["duration"]))
|
||||
self.dialog.set_title(u"{0} - {1}".format(post["title"], post["artist"]))
|
||||
call_threaded(self.get_lyrics)
|
||||
if post["owner_id"] == self.session.user_id or self.added_audios.has_key(post["id"]) == True:
|
||||
self.dialog.change_state("remove", True)
|
||||
self.dialog.change_state("add", False)
|
||||
else:
|
||||
self.dialog.change_state("add", True)
|
||||
self.dialog.change_state("remove", False)
|
||||
|
||||
def get_lyrics(self):
|
||||
post = self.post[self.dialog.get_audio()]
|
||||
if post.has_key("lyrics_id"):
|
||||
l = self.session.vk.client.audio.getLyrics(lyrics_id=int(post["lyrics_id"]))
|
||||
self.dialog.set("lyric", l["text"])
|
||||
else:
|
||||
self.dialog.change_state("lyric", False)
|
||||
|
||||
def download(self, *args, **kwargs):
|
||||
post = self.post[self.dialog.get_audio()]
|
||||
f = u"{0} - {1}.mp3".format(post["title"], post["artist"])
|
||||
path = self.dialog.get_destination_path(f)
|
||||
if path != None:
|
||||
pub.sendMessage("download-file", url=post["url"], filename=path)
|
||||
|
||||
def play(self, *args, **kwargs):
|
||||
post = self.post[self.dialog.get_audio()]
|
||||
pub.sendMessage("play-audio", audio_object=post)
|
||||
|
||||
def load_audios(self):
|
||||
for i in self.post:
|
||||
s = u"{0} - {1}. {2}".format(i["title"], i["artist"], utils.seconds_to_string(i["duration"]))
|
||||
self.dialog.insert_audio(s)
|
||||
self.dialog.list.SetSelection(0)
|
||||
if len(self.post) == 1:
|
||||
self.dialog.list.Enable(False)
|
||||
self.dialog.title.SetFocus()
|
||||
|
||||
def handle_changes(self, *args, **kwargs):
|
||||
p = self.dialog.get_audio()
|
||||
self.fill_information(p)
|
||||
|
||||
class friendship(object):
|
||||
|
||||
def __init__(self, session, post):
|
||||
self.session = session
|
||||
self.post = post
|
||||
self.dialog = postDialogs.friendship()
|
||||
list_of_friends = self.get_friend_names()
|
||||
from_ = self.session.get_user_name(self.post["source_id"])
|
||||
title = _(u"{0} added the following friends").format(from_,)
|
||||
self.dialog.set_title(title)
|
||||
self.set_friends_list(list_of_friends)
|
||||
|
||||
def get_friend_names(self):
|
||||
self.friends = self.post["friends"]["items"]
|
||||
return [self.session.get_user_name(i["user_id"]) for i in self.friends]
|
||||
|
||||
def set_friends_list(self, friendslist):
|
||||
for i in friendslist:
|
||||
self.dialog.friends.insert_item(False, *[i])
|
27
src/controller/selector.py
Normal file
27
src/controller/selector.py
Normal file
@@ -0,0 +1,27 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
import widgetUtils
|
||||
from wxUI.dialogs import selector as gui
|
||||
|
||||
class album(object):
|
||||
|
||||
def __init__(self, title, session, album_type="audio_albums"):
|
||||
super(album, self).__init__()
|
||||
self.item = None
|
||||
self.session = session
|
||||
if not hasattr(self.session, album_type):
|
||||
return
|
||||
self.albums = getattr(self.session, album_type)
|
||||
self.dialog = gui.selectAlbum(title=title, albums=self.get_albums_as_string())
|
||||
response = self.dialog.get_response()
|
||||
if response == widgetUtils.OK:
|
||||
self.item = self.search_item(self.dialog.get_string())
|
||||
|
||||
def get_albums_as_string(self):
|
||||
return [i["title"] for i in self.albums]
|
||||
|
||||
def search_item(self, item):
|
||||
for i in self.albums:
|
||||
if i["title"] == item:
|
||||
return i["id"]
|
||||
return None
|
||||
|
@@ -1,4 +1,4 @@
|
||||
import spellchecker
|
||||
from . import spellchecker
|
||||
import platform
|
||||
if platform.system() == "Windows":
|
||||
from wx_ui import *
|
||||
from .wx_ui import *
|
115
src/extra/SpellChecker/checker.py
Normal file
115
src/extra/SpellChecker/checker.py
Normal file
@@ -0,0 +1,115 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
""" High level Spell checker module by using the SymSpellPy library. """
|
||||
import os
|
||||
import glob
|
||||
import shutil
|
||||
import logging
|
||||
import paths
|
||||
from symspellpy.symspellpy import SymSpell, Verbosity
|
||||
from codecs import open as open_
|
||||
|
||||
log = logging.getLogger("SpellChecker.checker")
|
||||
|
||||
loaded_dicts = dict()
|
||||
ready = False
|
||||
|
||||
def load_dicts():
|
||||
global loaded_dicts, ready
|
||||
log.debug("Start dictionary loading for spelling checker module...")
|
||||
if len(loaded_dicts) > 0:
|
||||
loaded_dicts = dict()
|
||||
path = os.path.join(paths.config_path(), "dicts")
|
||||
if os.path.isdir(path):
|
||||
log.debug("Loading language dictionaries from path %s" % (path,))
|
||||
files = glob.glob(os.path.join(path, "*.txt"))
|
||||
log.debug("%r files found." % (len(files)))
|
||||
for i in files:
|
||||
key = os.path.splitext(os.path.basename(i))[0]
|
||||
dictionary = SymSpell()
|
||||
dictionary.load_dictionary(i, 0, 1, encoding="utf-8")
|
||||
loaded_dicts[key] = dictionary
|
||||
log.debug("Added dictionary for language %s " % (key,))
|
||||
ready = True
|
||||
log.debug("All dicts were loaded.")
|
||||
|
||||
def prepare_dicts(language):
|
||||
""" Copy the main dictionary file to the user's config directory so it can be modified and read without needing to require privileged sessions.
|
||||
@ language: two letter language code.
|
||||
"""
|
||||
log.debug("preparing dictionary data...")
|
||||
path = os.path.join(paths.config_path(), "dicts")
|
||||
if os.path.exists(path) == False:
|
||||
log.debug("Creating dicts folder in config directory...")
|
||||
os.mkdir(path)
|
||||
original_file = os.path.join(paths.app_path(), "dictionaries", language+".txt")
|
||||
if os.path.exists(original_file) and os.path.exists(os.path.join(paths.config_path(), "dicts", language+".txt")) == False:
|
||||
log.debug("Dictionary for language %s is not present in user config. Coppying... " % (language,))
|
||||
dst_file = shutil.copy(original_file, os.path.join(paths.config_path(), "dicts"))
|
||||
|
||||
class SpellChecker(object):
|
||||
|
||||
def __init__(self, wordlist=None, *args, **kwargs):
|
||||
self.kwargs = kwargs
|
||||
self.dictionary = None
|
||||
self.ignored_words = []
|
||||
self.word_index = 0
|
||||
|
||||
def set_language(self, lang):
|
||||
global loaded_dicts
|
||||
if loaded_dicts.get(lang) != None:
|
||||
self.dictionary = loaded_dicts[lang]
|
||||
else:
|
||||
raise ValueError("Dictionary not found for the specified language")
|
||||
|
||||
def set_text(self, text):
|
||||
self.transformed_words = text.split()
|
||||
self.word_index = 0
|
||||
|
||||
def check_words(self):
|
||||
for word in range(0, len(self.transformed_words)):
|
||||
if self.transformed_words[word] in self.ignored_words:
|
||||
continue
|
||||
suggestions = self.dictionary.lookup(self.transformed_words[word], Verbosity.CLOSEST, 2, transfer_casing=True)
|
||||
valid_word = True
|
||||
if len(suggestions) == 0:
|
||||
continue
|
||||
for s in suggestions:
|
||||
if s.distance == 0:
|
||||
valid_word = False
|
||||
if valid_word == False:
|
||||
continue
|
||||
if word <= 10:
|
||||
if len(self.transformed_words) <= 10:
|
||||
context = " ".join(self.transformed_words)
|
||||
else:
|
||||
context = " ".join(self.transformed_words[0:10])
|
||||
elif word >= len(self.transformed_words)-9:
|
||||
context = " ".join(self.transformed_words[-10])
|
||||
else:
|
||||
context = " ".join(self.transformed_words[word-5:word+5])
|
||||
self.word_index = word
|
||||
yield (suggestions, context, word)
|
||||
|
||||
def replace(self, suggestion):
|
||||
if len(self.transformed_words) < self.word_index:
|
||||
raise ValueError("Word index is not present in the current text")
|
||||
self.transformed_words[self.word_index] = suggestion
|
||||
|
||||
def replace_all(self, word):
|
||||
existing_word = self.word
|
||||
for i in range(0, len(self.transformed_words)):
|
||||
if self.transformed_words[i] == existing_word:
|
||||
self.transformed_words[i] = word
|
||||
|
||||
def ignore_word(self, word):
|
||||
self.ignored_words.append(word)
|
||||
|
||||
@property
|
||||
def text(self):
|
||||
return " ".join(self.transformed_words)
|
||||
|
||||
@property
|
||||
def word(self):
|
||||
if len(self.transformed_words) == 0 or self.word_index >= len(self.transformed_words):
|
||||
return None
|
||||
return self.transformed_words[self.word_index]
|
@@ -1,34 +1,31 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals
|
||||
import os
|
||||
import logging
|
||||
import wx_ui
|
||||
import widgetUtils
|
||||
import output
|
||||
import config
|
||||
import languageHandler
|
||||
from enchant.checker import SpellChecker
|
||||
from enchant.errors import DictNotFoundError
|
||||
from enchant import tokenize
|
||||
from platform_utils import paths
|
||||
from . import checker
|
||||
from . import wx_ui
|
||||
|
||||
log = logging.getLogger("extra.SpellChecker.spellChecker")
|
||||
|
||||
class spellChecker(object):
|
||||
def __init__(self, text, dictionary):
|
||||
def __init__(self, text):
|
||||
super(spellChecker, self).__init__()
|
||||
log.debug("Creating the SpellChecker object. Dictionary: %s" % (dictionary,))
|
||||
self.active = True
|
||||
self.checker = checker.SpellChecker()
|
||||
log.debug("Using language: %s" % (languageHandler.getLanguage(),))
|
||||
try:
|
||||
if config.app["app-settings"]["language"] == "system":
|
||||
log.debug("Using the system language")
|
||||
self.checker = SpellChecker(languageHandler.curLang, filters=[tokenize.EmailFilter, tokenize.URLFilter])
|
||||
else:
|
||||
log.debug("Using language: %s" % (languageHandler.getLanguage(),))
|
||||
self.checker = SpellChecker(languageHandler.curLang, filters=[tokenize.EmailFilter, tokenize.URLFilter])
|
||||
self.checker.set_text(text)
|
||||
except DictNotFoundError:
|
||||
print "no dict"
|
||||
log.exception("Dictionary for language %s not found." % (dictionary,))
|
||||
self.checker.set_language(languageHandler.curLang[:2])
|
||||
except ValueError:
|
||||
log.exception("Dictionary for language %s not found." % (languageHandler.curLang,))
|
||||
wx_ui.dict_not_found_error()
|
||||
self.active = False
|
||||
self.checker.set_text(text)
|
||||
self.generator = self.checker.check_words()
|
||||
if self.active == True:
|
||||
log.debug("Creating dialog...")
|
||||
self.dialog = wx_ui.spellCheckerDialog()
|
||||
@@ -38,16 +35,16 @@ class spellChecker(object):
|
||||
widgetUtils.connect_event(self.dialog.replaceAll, widgetUtils.BUTTON_PRESSED, self.replaceAll)
|
||||
self.check()
|
||||
self.dialog.get_response()
|
||||
self.fixed_text = self.checker.get_text()
|
||||
self.fixed_text = self.checker.text
|
||||
|
||||
def check(self):
|
||||
try:
|
||||
self.checker.next()
|
||||
textToSay = _(u"Misspelled word: %s") % (self.checker.word,)
|
||||
context = u"... %s %s %s" % (self.checker.leading_context(10), self.checker.word, self.checker.trailing_context(10))
|
||||
suggestions, context, self.wordIndex = next(self.generator)
|
||||
textToSay = _("Misspelled word: %s") % (self.checker.word,)
|
||||
context = context
|
||||
self.dialog.set_title(textToSay)
|
||||
output.speak(textToSay)
|
||||
self.dialog.set_word_and_suggestions(word=self.checker.word, context=context, suggestions=self.checker.suggest())
|
||||
self.dialog.set_word_and_suggestions(word=self.checker.word, context=context, suggestions=[suggestion.term for suggestion in suggestions])
|
||||
except StopIteration:
|
||||
log.debug("Process finished.")
|
||||
wx_ui.finished()
|
||||
@@ -57,7 +54,7 @@ class spellChecker(object):
|
||||
self.check()
|
||||
|
||||
def ignoreAll(self, ev):
|
||||
self.checker.ignore_always(word=self.checker.word)
|
||||
self.checker.ignore_word(word=self.checker.word)
|
||||
self.check()
|
||||
|
||||
def replace(self, ev):
|
||||
@@ -65,7 +62,7 @@ class spellChecker(object):
|
||||
self.check()
|
||||
|
||||
def replaceAll(self, ev):
|
||||
self.checker.replace_always(self.dialog.get_selected_suggestion())
|
||||
self.checker.replace_all(self.dialog.get_selected_suggestion())
|
||||
self.check()
|
||||
|
||||
def clean(self):
|
||||
|
@@ -16,6 +16,7 @@
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
############################################################
|
||||
from __future__ import unicode_literals
|
||||
import wx
|
||||
import application
|
||||
|
||||
@@ -24,25 +25,25 @@ class spellCheckerDialog(wx.Dialog):
|
||||
super(spellCheckerDialog, self).__init__(None, 1)
|
||||
panel = wx.Panel(self)
|
||||
sizer = wx.BoxSizer(wx.VERTICAL)
|
||||
word = wx.StaticText(panel, -1, _(u"&Misspelled word"))
|
||||
word = wx.StaticText(panel, -1, _("&Misspelled word"))
|
||||
self.word = wx.TextCtrl(panel, -1)
|
||||
wordBox = wx.BoxSizer(wx.HORIZONTAL)
|
||||
wordBox.Add(word, 0, wx.ALL, 5)
|
||||
wordBox.Add(self.word, 0, wx.ALL, 5)
|
||||
context = wx.StaticText(panel, -1, _(u"Con&text"))
|
||||
context = wx.StaticText(panel, -1, _("Con&text"))
|
||||
self.context = wx.TextCtrl(panel, -1)
|
||||
contextBox = wx.BoxSizer(wx.HORIZONTAL)
|
||||
contextBox.Add(context, 0, wx.ALL, 5)
|
||||
contextBox.Add(self.context, 0, wx.ALL, 5)
|
||||
suggest = wx.StaticText(panel, -1, _(u"&Suggestions"))
|
||||
suggest = wx.StaticText(panel, -1, _("&Suggestions"))
|
||||
self.suggestions = wx.ListBox(panel, -1, choices=[], style=wx.LB_SINGLE)
|
||||
suggestionsBox = wx.BoxSizer(wx.HORIZONTAL)
|
||||
suggestionsBox.Add(suggest, 0, wx.ALL, 5)
|
||||
suggestionsBox.Add(self.suggestions, 0, wx.ALL, 5)
|
||||
self.ignore = wx.Button(panel, -1, _(u"&Ignore"))
|
||||
self.ignoreAll = wx.Button(panel, -1, _(u"Ignore &all"))
|
||||
self.replace = wx.Button(panel, -1, _(u"&Replace"))
|
||||
self.replaceAll = wx.Button(panel, -1, _(u"Replace a&ll"))
|
||||
self.ignore = wx.Button(panel, -1, _("&Ignore"))
|
||||
self.ignoreAll = wx.Button(panel, -1, _("Ignore &all"))
|
||||
self.replace = wx.Button(panel, -1, _("&Replace"))
|
||||
self.replaceAll = wx.Button(panel, -1, _("Replace a&ll"))
|
||||
close = wx.Button(panel, wx.ID_CANCEL)
|
||||
btnBox = wx.BoxSizer(wx.HORIZONTAL)
|
||||
btnBox.Add(self.ignore, 0, wx.ALL, 5)
|
||||
@@ -73,7 +74,7 @@ class spellCheckerDialog(wx.Dialog):
|
||||
return self.suggestions.GetStringSelection()
|
||||
|
||||
def dict_not_found_error():
|
||||
wx.MessageDialog(None, _(u"An error has occurred. There are no dictionaries available for the selected language in {0}").format(application.name,), _(u"Error"), wx.ICON_ERROR).ShowModal()
|
||||
wx.MessageDialog(None, _("An error has occurred. There are no dictionaries available for the selected language in {0}").format(application.name,), _("Error"), wx.ICON_ERROR).ShowModal()
|
||||
|
||||
def finished():
|
||||
wx.MessageDialog(None, _(u"Spell check complete."), application.name, style=wx.OK).ShowModal()
|
||||
wx.MessageDialog(None, _("Spell check complete."), application.name, style=wx.OK).ShowModal()
|
||||
|
@@ -1,6 +1,6 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
import translator
|
||||
import platform
|
||||
from . import translator
|
||||
if platform.system() == "Windows":
|
||||
import wx_ui as gui
|
||||
from . import wx_ui as gui
|
||||
|
@@ -1,108 +1,115 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from microsofttranslator import Translator
|
||||
|
||||
def translate(text="", source="auto", target="en"):
|
||||
t = Translator("twblue", "4KZA26GYIfmVAqQA/z16Hlucbg64hVSDTIpRjT2FqIU=")
|
||||
return t.translate(text, target)
|
||||
from __future__ import unicode_literals
|
||||
from builtins import zip
|
||||
from yandex_translate import YandexTranslate
|
||||
|
||||
def translate(text="", target="en"):
|
||||
t = YandexTranslate("trnsl.1.1.20161012T134532Z.d01b9c75fc39aa74.7d1be75a5166a80583eeb020e10f584168da6bf7")
|
||||
vars = dict(text=text, lang=target)
|
||||
return t.translate(**vars)["text"][0]
|
||||
|
||||
supported_langs = None
|
||||
d = None
|
||||
languages = {
|
||||
"af": _(u"Afrikaans"),
|
||||
"sq": _(u"Albanian"),
|
||||
"am": _(u"Amharic"),
|
||||
"ar": _(u"Arabic"),
|
||||
"hy": _(u"Armenian"),
|
||||
"az": _(u"Azerbaijani"),
|
||||
"eu": _(u"Basque"),
|
||||
"be": _(u"Belarusian"),
|
||||
"bn": _(u"Bengali"),
|
||||
"bh": _(u"Bihari"),
|
||||
"bg": _(u"Bulgarian"),
|
||||
"my": _(u"Burmese"),
|
||||
"ca": _(u"Catalan"),
|
||||
"chr": _(u"Cherokee"),
|
||||
"zh": _(u"Chinese"),
|
||||
"zh-CN": _(u"Chinese_simplified"),
|
||||
"zh-TW": _(u"Chinese_traditional"),
|
||||
"hr": _(u"Croatian"),
|
||||
"cs": _(u"Czech"),
|
||||
"da": _(u"Danish"),
|
||||
"dv": _(u"Dhivehi"),
|
||||
"nl": _(u"Dutch"),
|
||||
"en": _(u"English"),
|
||||
"eo": _(u"Esperanto"),
|
||||
"et": _(u"Estonian"),
|
||||
"tl": _(u"Filipino"),
|
||||
"fi": _(u"Finnish"),
|
||||
"fr": _(u"French"),
|
||||
"gl": _(u"Galician"),
|
||||
"ka": _(u"Georgian"),
|
||||
"de": _(u"German"),
|
||||
"el": _(u"Greek"),
|
||||
"gn": _(u"Guarani"),
|
||||
"gu": _(u"Gujarati"),
|
||||
"iw": _(u"Hebrew"),
|
||||
"hi": _(u"Hindi"),
|
||||
"hu": _(u"Hungarian"),
|
||||
"is": _(u"Icelandic"),
|
||||
"id": _(u"Indonesian"),
|
||||
"iu": _(u"Inuktitut"),
|
||||
"ga": _(u"Irish"),
|
||||
"it": _(u"Italian"),
|
||||
"ja": _(u"Japanese"),
|
||||
"kn": _(u"Kannada"),
|
||||
"kk": _(u"Kazakh"),
|
||||
"km": _(u"Khmer"),
|
||||
"ko": _(u"Korean"),
|
||||
"ku": _(u"Kurdish"),
|
||||
"ky": _(u"Kyrgyz"),
|
||||
"lo": _(u"Laothian"),
|
||||
"lv": _(u"Latvian"),
|
||||
"lt": _(u"Lithuanian"),
|
||||
"mk": _(u"Macedonian"),
|
||||
"ms": _(u"Malay"),
|
||||
"ml": _(u"Malayalam"),
|
||||
"mt": _(u"Maltese"),
|
||||
"mr": _(u"Marathi"),
|
||||
"mn": _(u"Mongolian"),
|
||||
"ne": _(u"Nepali"),
|
||||
"no": _(u"Norwegian"),
|
||||
"or": _(u"Oriya"),
|
||||
"ps": _(u"Pashto"),
|
||||
"fa": _(u"Persian"),
|
||||
"pl": _(u"Polish"),
|
||||
"pt-PT": _(u"Portuguese"),
|
||||
"pa": _(u"Punjabi"),
|
||||
"ro": _(u"Romanian"),
|
||||
"ru": _(u"Russian"),
|
||||
"sa": _(u"Sanskrit"),
|
||||
"sr": _(u"Serbian"),
|
||||
"sd": _(u"Sindhi"),
|
||||
"si": _(u"Sinhalese"),
|
||||
"sk": _(u"Slovak"),
|
||||
"sl": _(u"Slovenian"),
|
||||
"es": _(u"Spanish"),
|
||||
"sw": _(u"Swahili"),
|
||||
"sv": _(u"Swedish"),
|
||||
"tg": _(u"Tajik"),
|
||||
"ta": _(u"Tamil"),
|
||||
"tl": _(u"Tagalog"),
|
||||
"te": _(u"Telugu"),
|
||||
"th": _(u"Thai"),
|
||||
"bo": _(u"Tibetan"),
|
||||
"tr": _(u"Turkish"),
|
||||
"uk": _(u"Ukrainian"),
|
||||
"ur": _(u"Urdu"),
|
||||
"uz": _(u"Uzbek"),
|
||||
"ug": _(u"Uighur"),
|
||||
"vi": _(u"Vietnamese"),
|
||||
"cy": _(u"Welsh"),
|
||||
"yi": _(u"Yiddish")
|
||||
"af": _("Afrikaans"),
|
||||
"sq": _("Albanian"),
|
||||
"am": _("Amharic"),
|
||||
"ar": _("Arabic"),
|
||||
"hy": _("Armenian"),
|
||||
"az": _("Azerbaijani"),
|
||||
"eu": _("Basque"),
|
||||
"be": _("Belarusian"),
|
||||
"bn": _("Bengali"),
|
||||
"bh": _("Bihari"),
|
||||
"bg": _("Bulgarian"),
|
||||
"my": _("Burmese"),
|
||||
"ca": _("Catalan"),
|
||||
"chr": _("Cherokee"),
|
||||
"zh": _("Chinese"),
|
||||
"zh-CN": _("Chinese_simplified"),
|
||||
"zh-TW": _("Chinese_traditional"),
|
||||
"hr": _("Croatian"),
|
||||
"cs": _("Czech"),
|
||||
"da": _("Danish"),
|
||||
"dv": _("Dhivehi"),
|
||||
"nl": _("Dutch"),
|
||||
"en": _("English"),
|
||||
"eo": _("Esperanto"),
|
||||
"et": _("Estonian"),
|
||||
"tl": _("Filipino"),
|
||||
"fi": _("Finnish"),
|
||||
"fr": _("French"),
|
||||
"gl": _("Galician"),
|
||||
"ka": _("Georgian"),
|
||||
"de": _("German"),
|
||||
"el": _("Greek"),
|
||||
"gn": _("Guarani"),
|
||||
"gu": _("Gujarati"),
|
||||
"iw": _("Hebrew"),
|
||||
"hi": _("Hindi"),
|
||||
"hu": _("Hungarian"),
|
||||
"is": _("Icelandic"),
|
||||
"id": _("Indonesian"),
|
||||
"iu": _("Inuktitut"),
|
||||
"ga": _("Irish"),
|
||||
"it": _("Italian"),
|
||||
"ja": _("Japanese"),
|
||||
"kn": _("Kannada"),
|
||||
"kk": _("Kazakh"),
|
||||
"km": _("Khmer"),
|
||||
"ko": _("Korean"),
|
||||
"ku": _("Kurdish"),
|
||||
"ky": _("Kyrgyz"),
|
||||
"lo": _("Laothian"),
|
||||
"lv": _("Latvian"),
|
||||
"lt": _("Lithuanian"),
|
||||
"mk": _("Macedonian"),
|
||||
"ms": _("Malay"),
|
||||
"ml": _("Malayalam"),
|
||||
"mt": _("Maltese"),
|
||||
"mr": _("Marathi"),
|
||||
"mn": _("Mongolian"),
|
||||
"ne": _("Nepali"),
|
||||
"no": _("Norwegian"),
|
||||
"or": _("Oriya"),
|
||||
"ps": _("Pashto"),
|
||||
"fa": _("Persian"),
|
||||
"pl": _("Polish"),
|
||||
"pt": _("Portuguese"),
|
||||
"pa": _("Punjabi"),
|
||||
"ro": _("Romanian"),
|
||||
"ru": _("Russian"),
|
||||
"sa": _("Sanskrit"),
|
||||
"sr": _("Serbian"),
|
||||
"sd": _("Sindhi"),
|
||||
"si": _("Sinhalese"),
|
||||
"sk": _("Slovak"),
|
||||
"sl": _("Slovenian"),
|
||||
"es": _("Spanish"),
|
||||
"sw": _("Swahili"),
|
||||
"sv": _("Swedish"),
|
||||
"tg": _("Tajik"),
|
||||
"ta": _("Tamil"),
|
||||
"tl": _("Tagalog"),
|
||||
"te": _("Telugu"),
|
||||
"th": _("Thai"),
|
||||
"bo": _("Tibetan"),
|
||||
"tr": _("Turkish"),
|
||||
"uk": _("Ukrainian"),
|
||||
"ur": _("Urdu"),
|
||||
"uz": _("Uzbek"),
|
||||
"ug": _("Uighur"),
|
||||
"vi": _("Vietnamese"),
|
||||
"cy": _("Welsh"),
|
||||
"yi": _("Yiddish")
|
||||
}
|
||||
|
||||
def available_languages():
|
||||
l = languages.keys()
|
||||
d = languages.values()
|
||||
l.insert(0, '')
|
||||
d.insert(0, _(u"autodetect"))
|
||||
return sorted(zip(l, d))
|
||||
global supported_langs, d
|
||||
if supported_langs == None and d == None:
|
||||
t = YandexTranslate("trnsl.1.1.20161012T134532Z.d01b9c75fc39aa74.7d1be75a5166a80583eeb020e10f584168da6bf7")
|
||||
supported_langs = t.langs
|
||||
d = []
|
||||
for i in supported_langs:
|
||||
d.append(languages[i])
|
||||
return sorted(zip(supported_langs, d))
|
||||
|
@@ -16,30 +16,29 @@
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
############################################################
|
||||
import translator
|
||||
from __future__ import unicode_literals
|
||||
import wx
|
||||
import widgetUtils
|
||||
from . import translator
|
||||
|
||||
class translateDialog(widgetUtils.BaseDialog):
|
||||
def __init__(self):
|
||||
super(translateDialog, self).__init__(None, -1, title=_(u"Translate message"))
|
||||
panel = wx.Panel(self)
|
||||
sizer = wx.BoxSizer(wx.VERTICAL)
|
||||
staticSource = wx.StaticText(panel, -1, _(u"&Source language"))
|
||||
self.source_lang = wx.ComboBox(panel, -1, choices=[x[1] for x in translator.available_languages()], style = wx.CB_READONLY)
|
||||
self.source_lang.SetFocus()
|
||||
staticDest = wx.StaticText(panel, -1, _(u"&Target language"))
|
||||
self.source_lang.SetSelection(0)
|
||||
self.dest_lang = wx.ComboBox(panel, -1, choices=[x[1] for x in translator.available_languages()], style = wx.CB_READONLY)
|
||||
listSizer = wx.BoxSizer(wx.HORIZONTAL)
|
||||
listSizer.Add(staticSource)
|
||||
listSizer.Add(self.source_lang)
|
||||
listSizer.Add(staticDest)
|
||||
listSizer.Add(self.dest_lang)
|
||||
ok = wx.Button(panel, wx.ID_OK)
|
||||
ok.SetDefault()
|
||||
cancel = wx.Button(panel, wx.ID_CANCEL)
|
||||
self.SetEscapeId(wx.ID_CANCEL)
|
||||
class translateDialog(wx.Dialog):
|
||||
def __init__(self):
|
||||
super(translateDialog, self).__init__(None, -1, title=_("Translate message"))
|
||||
panel = wx.Panel(self)
|
||||
sizer = wx.BoxSizer(wx.VERTICAL)
|
||||
staticDest = wx.StaticText(panel, -1, _("Target language"))
|
||||
self.dest_lang = wx.ComboBox(panel, -1, choices=[x[1] for x in translator.available_languages()], style = wx.CB_READONLY)
|
||||
self.dest_lang.SetFocus()
|
||||
self.dest_lang.SetSelection(0)
|
||||
listSizer = wx.BoxSizer(wx.HORIZONTAL)
|
||||
listSizer.Add(staticDest)
|
||||
listSizer.Add(self.dest_lang)
|
||||
ok = wx.Button(panel, wx.ID_OK)
|
||||
ok.SetDefault()
|
||||
cancel = wx.Button(panel, wx.ID_CANCEL)
|
||||
self.SetEscapeId(wx.ID_CANCEL)
|
||||
|
||||
def get(self, control):
|
||||
return getattr(self, control).GetSelection()
|
||||
def get(self, control):
|
||||
return getattr(self, control).GetSelection()
|
||||
|
||||
def get_response(self):
|
||||
return self.ShowModal()
|
@@ -1,6 +1,14 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
import fix_requests
|
||||
from __future__ import unicode_literals
|
||||
import sys
|
||||
from . import fix_requests
|
||||
|
||||
#if hasattr(sys, "frozen"):
|
||||
from . import fix_win32com
|
||||
from . import fix_libloader
|
||||
|
||||
def setup():
|
||||
fix_requests.fix()
|
||||
|
||||
# if hasattr(sys, "frozen"):
|
||||
fix_libloader.fix()
|
||||
fix_win32com.fix()
|
36
src/fixes/fix_libloader.py
Normal file
36
src/fixes/fix_libloader.py
Normal file
@@ -0,0 +1,36 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
import win32com
|
||||
import paths
|
||||
win32com.__build_path__=paths.com_path()
|
||||
import sys
|
||||
import os
|
||||
sys.path.append(os.path.join(win32com.__gen_path__, "."))
|
||||
from win32com.client import gencache
|
||||
from pywintypes import com_error
|
||||
from libloader import com
|
||||
|
||||
fixed=False
|
||||
|
||||
def patched_getmodule(modname):
|
||||
mod=__import__(modname)
|
||||
return sys.modules[modname]
|
||||
|
||||
def load_com(*names):
|
||||
global fixed
|
||||
if fixed==False:
|
||||
gencache._GetModule=patched_getmodule
|
||||
com.prepare_gencache()
|
||||
fixed=True
|
||||
result = None
|
||||
for name in names:
|
||||
try:
|
||||
result = gencache.EnsureDispatch(name)
|
||||
break
|
||||
except com_error:
|
||||
continue
|
||||
if result is None:
|
||||
raise com_error("Unable to load any of the provided com objects.")
|
||||
return result
|
||||
|
||||
def fix():
|
||||
com.load_com = load_com
|
@@ -1,4 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals
|
||||
import requests
|
||||
import paths
|
||||
import os
|
||||
@@ -7,5 +8,5 @@ log = logging.getLogger("fixes.fix_requests")
|
||||
|
||||
def fix():
|
||||
log.debug("Applying fix for requests...")
|
||||
os.environ["REQUESTS_CA_BUNDLE"] = paths.app_path("cacert.pem")
|
||||
log.debug("Changed CA path to %s" % (paths.app_path("cacert.pem"),))
|
||||
os.environ["REQUESTS_CA_BUNDLE"] = os.path.join(paths.app_path(), "cacert.pem")#.encode(paths.fsencoding)
|
||||
# log.debug("Changed CA path to %s" % (os.environ["REQUESTS_CA_BUNDLE"]))#.decode(paths.fsencoding)))
|
6
src/fixes/fix_win32com.py
Normal file
6
src/fixes/fix_win32com.py
Normal file
@@ -0,0 +1,6 @@
|
||||
from __future__ import unicode_literals
|
||||
import win32com.client
|
||||
def fix():
|
||||
if win32com.client.gencache.is_readonly == True:
|
||||
win32com.client.gencache.is_readonly = False
|
||||
win32com.client.gencache.Rebuild()
|
70
src/installer.nsi
Normal file
70
src/installer.nsi
Normal file
@@ -0,0 +1,70 @@
|
||||
!include "MUI2.nsh"
|
||||
!include "LogicLib.nsh"
|
||||
Unicode true
|
||||
CRCCheck on
|
||||
ManifestSupportedOS all
|
||||
XPStyle on
|
||||
Name "Socializer"
|
||||
OutFile "socializer_0.24_setup.exe"
|
||||
InstallDir "$PROGRAMFILES\socializer"
|
||||
InstallDirRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\socializer" "InstallLocation"
|
||||
RequestExecutionLevel admin
|
||||
SetCompress auto
|
||||
SetCompressor /solid lzma
|
||||
SetDatablockOptimize on
|
||||
VIAddVersionKey ProductName "Socializer"
|
||||
VIAddVersionKey LegalCopyright "Copyright 2019 Manuel Cortez."
|
||||
VIAddVersionKey ProductVersion "0.24"
|
||||
VIAddVersionKey FileVersion "0.24"
|
||||
VIProductVersion "0.24.0.0"
|
||||
VIFileVersion "0.24.0.0"
|
||||
!insertmacro MUI_PAGE_WELCOME
|
||||
!insertmacro MUI_PAGE_DIRECTORY
|
||||
var StartMenuFolder
|
||||
!insertmacro MUI_PAGE_STARTMENU startmenu $StartMenuFolder
|
||||
!insertmacro MUI_PAGE_INSTFILES
|
||||
!define MUI_FINISHPAGE_LINK "Visit Socializer website"
|
||||
!define MUI_FINISHPAGE_LINK_LOCATION "http://socializer.su"
|
||||
!define MUI_FINISHPAGE_RUN "$INSTDIR\socializer.exe"
|
||||
!insertmacro MUI_PAGE_FINISH
|
||||
!insertmacro MUI_UNPAGE_CONFIRM
|
||||
!insertmacro MUI_UNPAGE_INSTFILES
|
||||
!insertmacro MUI_LANGUAGE "Russian"
|
||||
!insertmacro MUI_LANGUAGE "English"
|
||||
!insertmacro MUI_LANGUAGE "Spanish"
|
||||
|
||||
!insertmacro MUI_RESERVEFILE_LANGDLL
|
||||
Section
|
||||
SetShellVarContext All
|
||||
SetOutPath "$INSTDIR"
|
||||
File /r dist\*
|
||||
CreateShortCut "$DESKTOP\socializer.lnk" "$INSTDIR\socializer.exe"
|
||||
!insertmacro MUI_STARTMENU_WRITE_BEGIN startmenu
|
||||
CreateDirectory "$SMPROGRAMS\$StartMenuFolder"
|
||||
CreateShortCut "$SMPROGRAMS\$StartMenuFolder\socializer.lnk" "$INSTDIR\socializer.exe"
|
||||
CreateShortCut "$SMPROGRAMS\$StartMenuFolder\Socializer on the web.lnk" "http://socializer.su"
|
||||
CreateShortCut "$SMPROGRAMS\$StartMenuFolder\Uninstall.lnk" "$INSTDIR\Uninstall.exe"
|
||||
!insertmacro MUI_STARTMENU_WRITE_END
|
||||
WriteUninstaller "$INSTDIR\Uninstall.exe"
|
||||
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\socializer" "DisplayName" "Socializer"
|
||||
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\socializer" "UninstallString" '"$INSTDIR\uninstall.exe"'
|
||||
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall" "InstallLocation" $INSTDIR
|
||||
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall" "Publisher" "Manuel Cortez"
|
||||
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\socializer" "DisplayVersion" "0.24"
|
||||
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\socializer" "URLInfoAbout" "http://socializer.su"
|
||||
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\socializer" "VersionMajor" 0
|
||||
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\socializer" "VersionMinor" 19
|
||||
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\socializer" "NoModify" 1
|
||||
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\socializer" "NoRepair" 1
|
||||
SectionEnd
|
||||
Section "Uninstall"
|
||||
SetShellVarContext All
|
||||
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\socializer"
|
||||
RMDir /r /REBOOTOK $INSTDIR
|
||||
Delete "$DESKTOP\socializer.lnk"
|
||||
!insertmacro MUI_STARTMENU_GETFOLDER startmenu $StartMenuFolder
|
||||
RMDir /r "$SMPROGRAMS\$StartMenuFolder"
|
||||
SectionEnd
|
||||
Function .onInit
|
||||
!insertmacro MUI_LANGDLL_DISPLAY
|
||||
FunctionEnd
|
70
src/installer_alpha.nsi
Normal file
70
src/installer_alpha.nsi
Normal file
@@ -0,0 +1,70 @@
|
||||
!include "MUI2.nsh"
|
||||
!include "LogicLib.nsh"
|
||||
Unicode true
|
||||
CRCCheck on
|
||||
ManifestSupportedOS all
|
||||
XPStyle on
|
||||
Name "Socializer"
|
||||
OutFile "socializer_alpha_setup.exe"
|
||||
InstallDir "$PROGRAMFILES\socializer"
|
||||
InstallDirRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\socializer" "InstallLocation"
|
||||
RequestExecutionLevel admin
|
||||
SetCompress auto
|
||||
SetCompressor /solid lzma
|
||||
SetDatablockOptimize on
|
||||
VIAddVersionKey ProductName "Socializer"
|
||||
VIAddVersionKey LegalCopyright "Copyright 2019 Manuel Cortez."
|
||||
VIAddVersionKey ProductVersion "0.24"
|
||||
VIAddVersionKey FileVersion "0.24"
|
||||
VIProductVersion "0.24.0.0"
|
||||
VIFileVersion "0.24.0.0"
|
||||
!insertmacro MUI_PAGE_WELCOME
|
||||
!insertmacro MUI_PAGE_DIRECTORY
|
||||
var StartMenuFolder
|
||||
!insertmacro MUI_PAGE_STARTMENU startmenu $StartMenuFolder
|
||||
!insertmacro MUI_PAGE_INSTFILES
|
||||
!define MUI_FINISHPAGE_LINK "Visit Socializer website"
|
||||
!define MUI_FINISHPAGE_LINK_LOCATION "http://socializer.su"
|
||||
!define MUI_FINISHPAGE_RUN "$INSTDIR\socializer.exe"
|
||||
!insertmacro MUI_PAGE_FINISH
|
||||
!insertmacro MUI_UNPAGE_CONFIRM
|
||||
!insertmacro MUI_UNPAGE_INSTFILES
|
||||
!insertmacro MUI_LANGUAGE "Russian"
|
||||
!insertmacro MUI_LANGUAGE "English"
|
||||
!insertmacro MUI_LANGUAGE "Spanish"
|
||||
|
||||
!insertmacro MUI_RESERVEFILE_LANGDLL
|
||||
Section
|
||||
SetShellVarContext All
|
||||
SetOutPath "$INSTDIR"
|
||||
File /r dist\*
|
||||
CreateShortCut "$DESKTOP\socializer.lnk" "$INSTDIR\socializer.exe"
|
||||
!insertmacro MUI_STARTMENU_WRITE_BEGIN startmenu
|
||||
CreateDirectory "$SMPROGRAMS\$StartMenuFolder"
|
||||
CreateShortCut "$SMPROGRAMS\$StartMenuFolder\socializer.lnk" "$INSTDIR\socializer.exe"
|
||||
CreateShortCut "$SMPROGRAMS\$StartMenuFolder\Socializer on the web.lnk" "http://socializer.su"
|
||||
CreateShortCut "$SMPROGRAMS\$StartMenuFolder\Uninstall.lnk" "$INSTDIR\Uninstall.exe"
|
||||
!insertmacro MUI_STARTMENU_WRITE_END
|
||||
WriteUninstaller "$INSTDIR\Uninstall.exe"
|
||||
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\socializer" "DisplayName" "Socializer"
|
||||
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\socializer" "UninstallString" '"$INSTDIR\uninstall.exe"'
|
||||
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall" "InstallLocation" $INSTDIR
|
||||
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall" "Publisher" "Manuel Cortez"
|
||||
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\socializer" "DisplayVersion" "0.24"
|
||||
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\socializer" "URLInfoAbout" "http://socializer.su"
|
||||
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\socializer" "VersionMajor" 0
|
||||
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\socializer" "VersionMinor" 19
|
||||
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\socializer" "NoModify" 1
|
||||
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\socializer" "NoRepair" 1
|
||||
SectionEnd
|
||||
Section "Uninstall"
|
||||
SetShellVarContext All
|
||||
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\socializer"
|
||||
RMDir /r /REBOOTOK $INSTDIR
|
||||
Delete "$DESKTOP\socializer.lnk"
|
||||
!insertmacro MUI_STARTMENU_GETFOLDER startmenu $StartMenuFolder
|
||||
RMDir /r "$SMPROGRAMS\$StartMenuFolder"
|
||||
SectionEnd
|
||||
Function .onInit
|
||||
!insertmacro MUI_LANGDLL_DISPLAY
|
||||
FunctionEnd
|
8
src/interactors/__init__.py
Normal file
8
src/interactors/__init__.py
Normal file
@@ -0,0 +1,8 @@
|
||||
from .base import *
|
||||
from .attach import *
|
||||
from . audioRecorder import *
|
||||
from . blacklist import *
|
||||
from .configuration import *
|
||||
from .postCreation import *
|
||||
from .postDisplayer import *
|
||||
from .profiles import *
|
93
src/interactors/attach.py
Normal file
93
src/interactors/attach.py
Normal file
@@ -0,0 +1,93 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals
|
||||
import widgetUtils
|
||||
from pubsub import pub
|
||||
from wxUI.dialogs import selector
|
||||
from wxUI.menus import attachMenu
|
||||
from . import base
|
||||
|
||||
class attachInteractor(base.baseInteractor):
|
||||
|
||||
def insert_attachment(self, attachment):
|
||||
self.view.attachments.insert_item(False, *attachment)
|
||||
|
||||
def remove_attachment(self, attachment):
|
||||
self.view.attachments.remove_item(attachment)
|
||||
|
||||
def install(self, *args, **kwargs):
|
||||
super(attachInteractor, self).install(*args, **kwargs)
|
||||
widgetUtils.connect_event(self.view.photo, widgetUtils.BUTTON_PRESSED, self.on_image)
|
||||
widgetUtils.connect_event(self.view.audio, widgetUtils.BUTTON_PRESSED, self.on_audio)
|
||||
widgetUtils.connect_event(self.view.document, widgetUtils.BUTTON_PRESSED, self.on_document)
|
||||
if hasattr(self.view, "voice_message"):
|
||||
widgetUtils.connect_event(self.view.voice_message, widgetUtils.BUTTON_PRESSED, self.on_upload_voice_message)
|
||||
widgetUtils.connect_event(self.view.remove, widgetUtils.BUTTON_PRESSED, self.on_remove_attachment)
|
||||
pub.subscribe(self.insert_attachment, self.modulename+"_insert_attachment")
|
||||
pub.subscribe(self.remove_attachment, self.modulename+"_remove_attachment")
|
||||
|
||||
def uninstall(self):
|
||||
super(attachInteractor, self).uninstall()
|
||||
pub.unsubscribe(self.insert_attachment, self.modulename+"_insert_attachment")
|
||||
pub.unsubscribe(self.remove_attachment, self.modulename+"_remove_attachment")
|
||||
|
||||
def on_image(self, *args, **kwargs):
|
||||
""" display menu for adding image attachments. """
|
||||
m = attachMenu()
|
||||
# disable add from VK as it is not supported in images, yet.
|
||||
m.add.Enable(False)
|
||||
widgetUtils.connect_event(m, widgetUtils.MENU, self.on_upload_image, menuitem=m.upload)
|
||||
self.view.PopupMenu(m, self.view.photo.GetPosition())
|
||||
|
||||
def on_audio(self, *args, **kwargs):
|
||||
""" display menu to add audio attachments."""
|
||||
m = attachMenu()
|
||||
widgetUtils.connect_event(m, widgetUtils.MENU, self.on_upload_audio, menuitem=m.upload)
|
||||
widgetUtils.connect_event(m, widgetUtils.MENU, self.on_add_audio, menuitem=m.add)
|
||||
self.view.PopupMenu(m, self.view.audio.GetPosition())
|
||||
|
||||
def on_document(self, *args, **kwargs):
|
||||
""" display menu for adding document attachments. """
|
||||
m = attachMenu()
|
||||
# disable add from VK as it is not supported in documents, yet.
|
||||
m.add.Enable(False)
|
||||
widgetUtils.connect_event(m, widgetUtils.MENU, self.on_upload_document, menuitem=m.upload)
|
||||
self.view.PopupMenu(m, self.view.photo.GetPosition())
|
||||
|
||||
def on_upload_image(self, *args, **kwargs):
|
||||
""" allows uploading an image from the computer.
|
||||
"""
|
||||
image, description = self.view.get_image()
|
||||
if image != None:
|
||||
self.presenter.upload_image(image, description)
|
||||
|
||||
def on_upload_audio(self, *args, **kwargs):
|
||||
""" Allows uploading an audio file from the computer. Only mp3 files are supported. """
|
||||
audio = self.view.get_audio()
|
||||
if audio != None:
|
||||
self.presenter.upload_audio(audio)
|
||||
|
||||
def on_upload_document(self, *args, **kwargs):
|
||||
""" allows uploading a document from the computer.
|
||||
"""
|
||||
document = self.view.get_document()
|
||||
if document != None:
|
||||
if document.endswith(".mp3") or document.endswith(".exe"):
|
||||
self.view.invalid_attachment()
|
||||
return
|
||||
self.presenter.upload_document(document)
|
||||
|
||||
def on_upload_voice_message(self, *args, **kwargs):
|
||||
self.presenter.upload_voice_message()
|
||||
|
||||
def on_add_audio(self, *args, **kwargs):
|
||||
""" Allow adding an audio directly from the user's audio library."""
|
||||
audios = self.presenter.get_available_audios()
|
||||
select = selector.selectAttachment(_("Select the audio files you want to send"), audios)
|
||||
if select.get_response() == widgetUtils.OK and select.attachments.GetCount() > 0:
|
||||
attachments = select.get_all_attachments()
|
||||
self.presenter.take_audios(attachments)
|
||||
|
||||
def on_remove_attachment(self, *args, **kwargs):
|
||||
""" Remove the currently focused item from the attachments list."""
|
||||
current_item = self.view.attachments.get_selected()
|
||||
self.presenter.remove_attachment(current_item)
|
29
src/interactors/audioRecorder.py
Normal file
29
src/interactors/audioRecorder.py
Normal file
@@ -0,0 +1,29 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals
|
||||
import widgetUtils
|
||||
from pubsub import pub
|
||||
from . import base
|
||||
|
||||
class audioRecorderInteractor(base.baseInteractor):
|
||||
def install(self, presenter, view, modulename="audiorecorder"):
|
||||
super(audioRecorderInteractor, self).install(view=view, presenter=presenter, modulename=modulename)
|
||||
widgetUtils.connect_event(view.play, widgetUtils.BUTTON_PRESSED, self.on_play)
|
||||
widgetUtils.connect_event(view.record, widgetUtils.BUTTON_PRESSED, self.on_record)
|
||||
widgetUtils.connect_event(view.discard, widgetUtils.BUTTON_PRESSED, self.on_discard)
|
||||
|
||||
def start(self):
|
||||
result = self.view.get_response()
|
||||
if result == widgetUtils.OK:
|
||||
self.on_postprocess()
|
||||
|
||||
def on_record(self, *args, **kwargs):
|
||||
self.presenter.toggle_recording()
|
||||
|
||||
def on_discard(self, *args, **kwargs):
|
||||
self.presenter.discard_recording()
|
||||
|
||||
def on_play(self, *args, **kwargs):
|
||||
self.presenter.play()
|
||||
|
||||
def on_postprocess(self):
|
||||
self.presenter.postprocess()
|
40
src/interactors/base.py
Normal file
40
src/interactors/base.py
Normal file
@@ -0,0 +1,40 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from pubsub import pub
|
||||
|
||||
class baseInteractor(object):
|
||||
|
||||
def install(self, view, presenter, modulename):
|
||||
self.modulename = modulename
|
||||
self.view = view
|
||||
self.presenter = presenter
|
||||
pub.subscribe(self.disable_control, "{modulename}_disable_control".format(modulename=modulename))
|
||||
pub.subscribe(self.enable_control, "{modulename}_enable_control".format(modulename=modulename))
|
||||
pub.subscribe(self.set_label, "{modulename}_set_label".format(modulename=modulename))
|
||||
pub.subscribe(self.focus_control, "{modulename}_focus_control".format(modulename=modulename))
|
||||
pub.subscribe(self.set_title, "{modulename}_set_title".format(modulename=modulename))
|
||||
|
||||
def uninstall(self):
|
||||
pub.unsubscribe(self.disable_control, "{modulename}_disable_control".format(modulename=self.modulename))
|
||||
pub.unsubscribe(self.enable_control, "{modulename}_enable_control".format(modulename=self.modulename))
|
||||
pub.unsubscribe(self.set_label, "{modulename}_set_label".format(modulename=self.modulename))
|
||||
pub.unsubscribe(self.focus_control, "{modulename}_focus_control".format(modulename=self.modulename))
|
||||
pub.unsubscribe(self.set_title, "{modulename}_set_title".format(modulename=self.modulename))
|
||||
self.view.Destroy()
|
||||
|
||||
def start(self):
|
||||
self.result = self.view.get_response()
|
||||
|
||||
def disable_control(self, control):
|
||||
self.view.disable(control)
|
||||
|
||||
def enable_control(self, control):
|
||||
self.view.enable(control)
|
||||
|
||||
def focus_control(self, control):
|
||||
getattr(self.view, control).SetFocus()
|
||||
|
||||
def set_label(self, control, label):
|
||||
self.view.set(control, label)
|
||||
|
||||
def set_title(self, value):
|
||||
self.view.SetTitle(value)
|
31
src/interactors/blacklist.py
Normal file
31
src/interactors/blacklist.py
Normal file
@@ -0,0 +1,31 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
import widgetUtils
|
||||
from wxUI import commonMessages
|
||||
from pubsub import pub
|
||||
from . import base
|
||||
|
||||
class blacklistInteractor(base.baseInteractor):
|
||||
|
||||
def add_items(self, control, items):
|
||||
if not hasattr(self.view, control):
|
||||
raise AttributeError("The control is not present in the view.")
|
||||
for i in items:
|
||||
getattr(self.view, control).insert_item(False, *i)
|
||||
|
||||
def install(self, *args, **kwargs):
|
||||
super(blacklistInteractor, self).install(*args, **kwargs)
|
||||
widgetUtils.connect_event(self.view.unblock, widgetUtils.BUTTON_PRESSED, self.on_unblock)
|
||||
pub.subscribe(self.add_items, self.modulename+"_add_items")
|
||||
|
||||
def uninstall(self):
|
||||
super(blacklistInteractor, self).uninstall()
|
||||
pub.unsubscribe(self.add_items, self.modulename+"_add_items")
|
||||
|
||||
|
||||
def on_unblock(self, *args, **kwargs):
|
||||
question = commonMessages.unblock_person()
|
||||
if question == widgetUtils.NO:
|
||||
return
|
||||
item = self.view.persons.get_selected()
|
||||
if self.presenter.unblock_person(item) == 1:
|
||||
self.view.persons.remove_item(item)
|
72
src/interactors/configuration.py
Normal file
72
src/interactors/configuration.py
Normal file
@@ -0,0 +1,72 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals
|
||||
import widgetUtils
|
||||
from pubsub import pub
|
||||
from wxUI.commonMessages import restart_program as restart_program_dialog
|
||||
from . import base
|
||||
|
||||
class configurationInteractor(base.baseInteractor):
|
||||
|
||||
def create_tab(self, tab, arglist=dict()):
|
||||
getattr(self.view, "create_"+tab)(**arglist)
|
||||
|
||||
def set_setting(self, tab, setting, value):
|
||||
self.view.set_value(tab, setting, value)
|
||||
|
||||
def restart(self):
|
||||
dlg = restart_program_dialog()
|
||||
if dlg == widgetUtils.YES:
|
||||
self.presenter.restart_application()
|
||||
|
||||
def set_language(self, language):
|
||||
self.view.general.language.SetSelection(language)
|
||||
|
||||
def install(self, *args, **kwargs):
|
||||
super(configurationInteractor, self).install(*args, **kwargs)
|
||||
pub.subscribe(self.create_tab, self.modulename+"_create_tab")
|
||||
pub.subscribe(self.set_setting, self.modulename+"_set")
|
||||
pub.subscribe(self.restart, self.modulename+"_restart_program")
|
||||
pub.subscribe(self.set_language, self.modulename+"_set_language")
|
||||
|
||||
def uninstall(self):
|
||||
super(configurationInteractor, self).uninstall()
|
||||
pub.unsubscribe(self.create_tab, self.modulename+"_create_tab")
|
||||
pub.unsubscribe(self.set_setting, self.modulename+"_set")
|
||||
pub.unsubscribe(self.restart, self.modulename+"_restart_program")
|
||||
pub.unsubscribe(self.set_language, self.modulename+"_set_language")
|
||||
|
||||
def start(self):
|
||||
self.view.realize()
|
||||
result = self.view.get_response()
|
||||
if result == widgetUtils.OK:
|
||||
self.on_save_settings()
|
||||
|
||||
def on_save_settings(self, *args, **kwargs):
|
||||
self.presenter.update_setting(section="buffers", setting="count_for_wall_buffers", value=self.view.get_value("buffers", "wall_buffer_count"))
|
||||
self.presenter.update_setting(section="buffers", setting="count_for_video_buffers", value=self.view.get_value("buffers", "video_buffers_count"))
|
||||
self.presenter.update_setting(section="buffers", setting="count_for_chat_buffers", value=self.view.get_value("buffers", "chat_buffers_count"))
|
||||
self.presenter.update_setting(section="general", setting="load_images", value=self.view.get_value("general", "load_images"))
|
||||
update_channel = self.presenter.get_update_channel_type(self.view.get_value("general", "update_channel"))
|
||||
if update_channel != self.presenter.session.settings["general"]["update_channel"]:
|
||||
if update_channel == "stable":
|
||||
self.presenter.update_setting(section="general", setting="update_channel", value=update_channel)
|
||||
elif update_channel == "weekly":
|
||||
dialog = self.view.weekly_channel()
|
||||
if dialog == widgetUtils.YES:
|
||||
self.presenter.update_setting(section="general", setting="update_channel", value=update_channel)
|
||||
elif update_channel == "alpha":
|
||||
dialog = self.view.alpha_channel()
|
||||
if dialog == widgetUtils.YES:
|
||||
self.presenter.update_setting(section="general", setting="update_channel", value=update_channel)
|
||||
self.presenter.update_setting(section="chat", setting="notify_online", value=self.view.get_value("chat", "notify_online"))
|
||||
self.presenter.update_setting(section="chat", setting="notify_offline", value=self.view.get_value("chat", "notify_offline"))
|
||||
self.presenter.update_setting(section="chat", setting="notifications", value=self.presenter.get_notification_type(self.view.get_value("chat", "notifications")))
|
||||
self.presenter.update_setting(section="load_at_startup", setting="audio_albums", value=self.view.get_value("startup", "audio_albums"))
|
||||
self.presenter.update_setting(section="load_at_startup", setting="video_albums", value=self.view.get_value("startup", "video_albums"))
|
||||
self.presenter.update_setting(section="load_at_startup", setting="communities", value=self.view.get_value("startup", "communities"))
|
||||
self.presenter.update_app_setting(section="app-settings", setting="language", value=self.presenter.codes[self.view.general.language.GetSelection()])
|
||||
self.presenter.update_app_setting(section="sound", setting="input_device", value=self.view.get_value("sound", "input"))
|
||||
self.presenter.update_app_setting(section="sound", setting="output_device", value=self.view.get_value("sound", "output"))
|
||||
self.presenter.update_app_setting(section="app-settings", setting="use_proxy", value=self.view.get_value("general", "use_proxy"))
|
||||
self.presenter.save_app_settings_file()
|
||||
self.presenter.save_settings_file()
|
71
src/interactors/postCreation.py
Normal file
71
src/interactors/postCreation.py
Normal file
@@ -0,0 +1,71 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals
|
||||
import widgetUtils
|
||||
from wxUI.dialogs import selector
|
||||
from pubsub import pub
|
||||
from extra import translator
|
||||
from .import base
|
||||
|
||||
class createPostInteractor(base.baseInteractor):
|
||||
|
||||
def set(self, control, value):
|
||||
if not hasattr(self.view, control):
|
||||
raise AttributeError("The control is not present in the view.")
|
||||
getattr(self.view, control).SetValue(value)
|
||||
|
||||
def add_tagged_users(self, users):
|
||||
self.view.text.SetValue(self.view.text.GetValue()+", ".join(users))
|
||||
|
||||
def install(self, *args, **kwargs):
|
||||
super(createPostInteractor, self).install(*args, **kwargs)
|
||||
widgetUtils.connect_event(self.view.spellcheck, widgetUtils.BUTTON_PRESSED, self.on_spellcheck)
|
||||
widgetUtils.connect_event(self.view.translateButton, widgetUtils.BUTTON_PRESSED, self.on_translate)
|
||||
widgetUtils.connect_event(self.view.mention, widgetUtils.BUTTON_PRESSED, self.on_mention)
|
||||
if hasattr(self.view, "attach"):
|
||||
widgetUtils.connect_event(self.view.attach, widgetUtils.BUTTON_PRESSED, self.on_add_attachments)
|
||||
pub.subscribe(self.set, self.modulename+"_set")
|
||||
pub.subscribe(self.add_tagged_users, self.modulename+"_add_tagged_users")
|
||||
|
||||
def uninstall(self):
|
||||
super(createPostInteractor, self).uninstall()
|
||||
pub.unsubscribe(self.set, self.modulename+"_set")
|
||||
pub.unsubscribe(self.add_tagged_users, self.modulename+"_add_tagged_users")
|
||||
|
||||
def start(self):
|
||||
self.result = self.view.get_response()
|
||||
if self.result == widgetUtils.OK:
|
||||
self.presenter.text = self.view.get_text()
|
||||
if hasattr(self.view, "privacy"):
|
||||
self.presenter.privacy = self.get_privacy_options()
|
||||
else:
|
||||
self.presenter.privacy = 0
|
||||
|
||||
def get_privacy_options(self):
|
||||
p = self.view.get("privacy")
|
||||
if p == _("Friends of friends"):
|
||||
privacy = 0
|
||||
elif p == _("All users"):
|
||||
privacy = 1
|
||||
return privacy
|
||||
|
||||
def on_mention(self, *args, **kwargs):
|
||||
users = self.presenter.get_friends()
|
||||
select = selector.selectPeople(users)
|
||||
if select.get_response() == widgetUtils.OK and select.users.GetCount() > 0:
|
||||
tagged_users = select.get_all_users()
|
||||
self.presenter.add_tagged_users(tagged_users)
|
||||
|
||||
def on_translate(self, *args, **kwargs):
|
||||
dlg = translator.gui.translateDialog()
|
||||
if dlg.get_response() == widgetUtils.OK:
|
||||
text_to_translate = self.view.get_text()
|
||||
dest = [x[0] for x in translator.translator.available_languages()][dlg.get("dest_lang")]
|
||||
self.presenter.translate(text_to_translate, dest)
|
||||
dlg.Destroy()
|
||||
|
||||
def on_spellcheck(self, event=None):
|
||||
text = self.view.get_text()
|
||||
self.presenter.spellcheck(text)
|
||||
|
||||
def on_add_attachments(self, *args, **kwargs):
|
||||
self.presenter.add_attachments()
|
286
src/interactors/postDisplayer.py
Normal file
286
src/interactors/postDisplayer.py
Normal file
@@ -0,0 +1,286 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals
|
||||
import six
|
||||
import widgetUtils
|
||||
import wx
|
||||
from pubsub import pub
|
||||
from wxUI import menus
|
||||
from wxUI import commonMessages
|
||||
from .import base
|
||||
|
||||
class displayPostInteractor(base.baseInteractor):
|
||||
|
||||
def set(self, control, value):
|
||||
if not hasattr(self.view, control):
|
||||
raise AttributeError("The control is not present in the view.")
|
||||
getattr(self.view, control).SetValue(value)
|
||||
|
||||
def load_image(self, image):
|
||||
image = wx.Image(stream=six.BytesIO(image.content))
|
||||
try:
|
||||
self.view.image.SetBitmap(wx.Bitmap(image))
|
||||
except ValueError:
|
||||
return
|
||||
self.view.panel.Layout()
|
||||
|
||||
def add_items(self, control, items):
|
||||
if not hasattr(self.view, control):
|
||||
raise AttributeError("The control is not present in the view.")
|
||||
for i in items:
|
||||
getattr(self.view, control).insert_item(False, *i)
|
||||
|
||||
def add_item(self, control, item, reversed=False):
|
||||
if not hasattr(self.view, control):
|
||||
raise AttributeError("The control is not present in the view.")
|
||||
getattr(self.view, control).insert_item(reversed, *item)
|
||||
|
||||
def enable_attachments(self):
|
||||
self.view.attachments.list.Enable(True)
|
||||
|
||||
def enable_photo_controls(self, navigation):
|
||||
self.view.enable_photo_controls(navigation)
|
||||
|
||||
def clean_list(self, list):
|
||||
if not hasattr(self.view, list):
|
||||
raise AttributeError("The control is not present in the view.")
|
||||
getattr(self.view, list).clear()
|
||||
|
||||
def post_deleted(self):
|
||||
msg = commonMessages.post_deleted()
|
||||
|
||||
def install(self, *args, **kwargs):
|
||||
super(displayPostInteractor, self).install(*args, **kwargs)
|
||||
if hasattr(self.view, "comments"):
|
||||
self.view.comments.list.Bind(wx.EVT_LIST_ITEM_ACTIVATED, self.on_show_comment)
|
||||
self.view.comments.list.Bind(wx.EVT_LIST_ITEM_FOCUSED, self.on_comment_changed)
|
||||
self.view.attachments.list.Bind(wx.EVT_LIST_ITEM_ACTIVATED, self.on_open_attachment)
|
||||
widgetUtils.connect_event(self.view.like, widgetUtils.BUTTON_PRESSED, self.on_like)
|
||||
widgetUtils.connect_event(self.view.comment, widgetUtils.BUTTON_PRESSED, self.on_add_comment)
|
||||
widgetUtils.connect_event(self.view.tools, widgetUtils.BUTTON_PRESSED, self.on_show_tools_menu)
|
||||
if hasattr(self.view, "likes"):
|
||||
widgetUtils.connect_event(self.view.likes, widgetUtils.BUTTON_PRESSED, self.on_show_likes_menu)
|
||||
if hasattr(self.view, "shares"):
|
||||
widgetUtils.connect_event(self.view.shares, widgetUtils.BUTTON_PRESSED, self.on_show_shares_menu)
|
||||
if hasattr(self.view, "repost"):
|
||||
widgetUtils.connect_event(self.view.repost, widgetUtils.BUTTON_PRESSED, self.on_repost)
|
||||
self.view.comments.list.Bind(wx.EVT_LIST_ITEM_FOCUSED, self.on_focus)
|
||||
if hasattr(self.view, "reply"):
|
||||
widgetUtils.connect_event(self.view.reply, widgetUtils.BUTTON_PRESSED, self.on_reply)
|
||||
if hasattr(self.view, "load_more_comments"):
|
||||
widgetUtils.connect_event(self.view.load_more_comments, widgetUtils.BUTTON_PRESSED, self.on_load_more_comments)
|
||||
# self.view.Bind(wx.EVT_LIST_ITEM_RIGHT_CLICK, self.on_show_menu, self.view.comments.list)
|
||||
# self.view.Bind(wx.EVT_LIST_KEY_DOWN, self.on_show_menu_by_key, self.view.comments.list)
|
||||
pub.subscribe(self.set, self.modulename+"_set")
|
||||
pub.subscribe(self.load_image, self.modulename+"_load_image")
|
||||
pub.subscribe(self.add_items, self.modulename+"_add_items")
|
||||
pub.subscribe(self.add_item, self.modulename+"_add_item")
|
||||
pub.subscribe(self.enable_attachments, self.modulename+"_enable_attachments")
|
||||
pub.subscribe(self.enable_photo_controls, self.modulename+"_enable_photo_controls")
|
||||
pub.subscribe(self.post_deleted, self.modulename+"_post_deleted")
|
||||
pub.subscribe(self.clean_list, self.modulename+"_clean_list")
|
||||
|
||||
def uninstall(self):
|
||||
super(displayPostInteractor, self).uninstall()
|
||||
pub.unsubscribe(self.set, self.modulename+"_set")
|
||||
pub.unsubscribe(self.load_image, self.modulename+"_load_image")
|
||||
pub.unsubscribe(self.add_items, self.modulename+"_add_items")
|
||||
pub.unsubscribe(self.add_item, self.modulename+"_add_item")
|
||||
pub.unsubscribe(self.enable_attachments, self.modulename+"_enable_attachments")
|
||||
pub.unsubscribe(self.enable_photo_controls, self.modulename+"_enable_photo_controls")
|
||||
pub.unsubscribe(self.post_deleted, self.modulename+"_post_deleted")
|
||||
pub.unsubscribe(self.clean_list, self.modulename+"_clean_list")
|
||||
|
||||
def on_focus(self, *args, **kwargs):
|
||||
item = self.view.comments.get_selected()
|
||||
if item == -1:
|
||||
self.view.reply.Enable(False)
|
||||
else:
|
||||
self.view.reply.Enable(True)
|
||||
|
||||
def on_like(self, *args, **kwargs):
|
||||
self.presenter.post_like()
|
||||
|
||||
def on_repost(self, *args, **kwargs):
|
||||
self.presenter.post_repost()
|
||||
|
||||
def on_reply(self, *args, **kwargs):
|
||||
if hasattr(self.view, "comments") and (hasattr(self.view, "repost") or not hasattr(self, "post_view")):
|
||||
comment = self.view.comments.get_selected()
|
||||
self.presenter.reply(comment)
|
||||
else:
|
||||
self.presenter.reply()
|
||||
|
||||
def on_add_comment(self, *args, **kwargs):
|
||||
self.presenter.add_comment()
|
||||
|
||||
def on_load_more_comments(self, *args, **kwargs):
|
||||
if hasattr(self.presenter, "load_more_comments"):
|
||||
self.presenter.load_more_comments()
|
||||
|
||||
def on_show_tools_menu(self, *args, **kwargs):
|
||||
menu = menus.toolsMenu()
|
||||
widgetUtils.connect_event(self.view, widgetUtils.MENU, self.on_open_url, menuitem=menu.url)
|
||||
widgetUtils.connect_event(self.view, widgetUtils.MENU, self.on_translate, menuitem=menu.translate)
|
||||
widgetUtils.connect_event(self.view, widgetUtils.MENU, self.on_spellcheck, menuitem=menu.CheckSpelling)
|
||||
self.view.PopupMenu(menu, self.view.tools.GetPosition())
|
||||
|
||||
def on_open_url(self, *args, **kwargs):
|
||||
pass
|
||||
|
||||
def on_open_attachment(self, *args, **kwargs):
|
||||
attachment = self.view.attachments.get_selected()
|
||||
self.presenter.open_attachment(attachment)
|
||||
|
||||
def on_translate(self, *args, **kwargs):
|
||||
dlg = translator.gui.translateDialog()
|
||||
if dlg.get_response() == widgetUtils.OK:
|
||||
text_to_translate = self.view.get("post_view")
|
||||
dest = [x[0] for x in translator.translator.available_languages()][dlg.get("dest_lang")]
|
||||
self.presenter.translate(text_to_translate, dest)
|
||||
dlg.Destroy()
|
||||
|
||||
def on_spellcheck(self, event=None):
|
||||
text = self.view.get("post_view")
|
||||
self.presenter.spellcheck(text)
|
||||
|
||||
def on_show_comment(self, *args, **kwargs):
|
||||
comment = self.view.comments.get_selected()
|
||||
self.presenter.show_comment(comment)
|
||||
|
||||
def on_comment_changed(self, *args, **kwargs):
|
||||
if hasattr(self.presenter, "change_comment"):
|
||||
comment = self.view.comments.get_selected()
|
||||
self.presenter.change_comment(comment)
|
||||
|
||||
def on_show_likes_menu(self, *args, **kwargs):
|
||||
self.presenter.show_likes()
|
||||
|
||||
def on_show_shares_menu(self, *args, **kwargs):
|
||||
self.presenter.show_shares()
|
||||
|
||||
class displayAudioInteractor(base.baseInteractor):
|
||||
|
||||
def set(self, control, value):
|
||||
if not hasattr(self.view, control):
|
||||
raise AttributeError("The control is not present in the view.")
|
||||
getattr(self.view, control).SetValue(value)
|
||||
|
||||
def add_items(self, control, items):
|
||||
if not hasattr(self.view, control):
|
||||
raise AttributeError("The control is not present in the view.")
|
||||
for i in items:
|
||||
getattr(self.view, control).Append(i)
|
||||
getattr(self.view, control).SetSelection(0)
|
||||
|
||||
def change_label(self, stopped):
|
||||
|
||||
if stopped == False:
|
||||
self.view.play.SetLabel(_("P&ause"))
|
||||
else:
|
||||
self.view.play.SetLabel(_("P&lay"))
|
||||
|
||||
def install(self, *args, **kwargs):
|
||||
super(displayAudioInteractor, self).install(*args, **kwargs)
|
||||
widgetUtils.connect_event(self.view.list, widgetUtils.LISTBOX_CHANGED, self.on_change)
|
||||
widgetUtils.connect_event(self.view.download, widgetUtils.BUTTON_PRESSED, self.on_download)
|
||||
widgetUtils.connect_event(self.view.play, widgetUtils.BUTTON_PRESSED, self.on_play)
|
||||
widgetUtils.connect_event(self.view.add, widgetUtils.BUTTON_PRESSED, self.on_add_to_library)
|
||||
widgetUtils.connect_event(self.view.remove, widgetUtils.BUTTON_PRESSED, self.on_remove_from_library)
|
||||
pub.subscribe(self.set, self.modulename+"_set")
|
||||
pub.subscribe(self.add_items, self.modulename+"_add_items")
|
||||
pub.subscribe(self.change_label, "playback-changed")
|
||||
|
||||
def uninstall(self):
|
||||
super(displayAudioInteractor, self).uninstall()
|
||||
pub.unsubscribe(self.set, self.modulename+"_set")
|
||||
pub.unsubscribe(self.add_items, self.modulename+"_add_items")
|
||||
pub.unsubscribe(self.change_label, "playback-changed")
|
||||
|
||||
def on_change(self, *args, **kwargs):
|
||||
post = self.view.get_audio()
|
||||
self.presenter.handle_changes(post)
|
||||
|
||||
def on_download(self, *args, **kwargs):
|
||||
post = self.view.get_audio()
|
||||
suggested_filename = self.presenter.get_suggested_filename(post)
|
||||
path = self.view.get_destination_path(suggested_filename)
|
||||
self.presenter.download(post, path)
|
||||
|
||||
def on_play(self, *args, **kwargs):
|
||||
post = self.view.get_audio()
|
||||
self.presenter.play(post)
|
||||
|
||||
def on_add_to_library(self, *args, **kwargs):
|
||||
post = self.view.get_audio()
|
||||
self.presenter.add_to_library(post)
|
||||
|
||||
def on_remove_from_library(self, *args, **kwargs):
|
||||
post = self.view.get_audio()
|
||||
self.presenter.remove_from_library(post)
|
||||
|
||||
class displayPollInteractor(base.baseInteractor):
|
||||
|
||||
def set(self, control, value):
|
||||
if not hasattr(self.view, control):
|
||||
raise AttributeError("The control is not present in the view.")
|
||||
getattr(self.view, control).SetValue(value)
|
||||
|
||||
def done(self):
|
||||
self.view.done()
|
||||
|
||||
def add_options(self, options, multiple):
|
||||
self.view.add_options(options, multiple)
|
||||
|
||||
def install(self, *args, **kwargs):
|
||||
super(displayPollInteractor, self).install(*args, **kwargs)
|
||||
pub.subscribe(self.set, self.modulename+"_set")
|
||||
pub.subscribe(self.done, self.modulename+"_done")
|
||||
pub.subscribe(self.add_options, self.modulename+"_add_options")
|
||||
|
||||
def uninstall(self):
|
||||
super(displayPollInteractor, self).uninstall()
|
||||
pub.unsubscribe(self.set, self.modulename+"_set")
|
||||
pub.unsubscribe(self.done, self.modulename+"_done")
|
||||
pub.unsubscribe(self.add_options, self.modulename+"_add_options")
|
||||
|
||||
def start(self, *args, **kwargs):
|
||||
super(displayPollInteractor, self).start(*args, **kwargs)
|
||||
if self.result == widgetUtils.OK: # USer votd.
|
||||
answers = self.view.get_answers()
|
||||
self.presenter.vote(answers)
|
||||
|
||||
class displayFriendshipInteractor(base.baseInteractor):
|
||||
|
||||
def add_items(self, control, items):
|
||||
if not hasattr(self.view, control):
|
||||
raise AttributeError("The control is not present in the view.")
|
||||
for i in items:
|
||||
getattr(self.view, control).insert_item(False, *[i])
|
||||
|
||||
def install(self, *args, **kwargs):
|
||||
super(displayFriendshipInteractor, self).install(*args, **kwargs)
|
||||
pub.subscribe(self.add_items, self.modulename+"_add_items")
|
||||
self.view.friends.list.Bind(wx.EVT_CONTEXT_MENU, self.on_context_menu)
|
||||
|
||||
def uninstall(self):
|
||||
super(displayFriendshipInteractor, self).uninstall()
|
||||
pub.unsubscribe(self.add_items, self.modulename+"_add_items")
|
||||
|
||||
def on_context_menu(self, *args, **kwargs):
|
||||
item = self.view.friends.get_selected()
|
||||
if item < 0:
|
||||
return
|
||||
menu = menus.peopleMenu(False, False, True)
|
||||
widgetUtils.connect_event(menu, widgetUtils.MENU, self.on_view_profile, menuitem=menu.view_profile)
|
||||
widgetUtils.connect_event(menu, widgetUtils.MENU, self.on_open_in_browser, menuitem=menu.open_in_browser)
|
||||
# Generally message sending is blocked.
|
||||
menu.message.Enable(False)
|
||||
self.view.PopupMenu(menu, self.view.friends.list.GetPosition())
|
||||
|
||||
def on_view_profile(self, *args, **kwargs):
|
||||
item = self.view.friends.get_selected()
|
||||
self.presenter.view_profile(item)
|
||||
|
||||
def on_open_in_browser(self, *args, **kwargs):
|
||||
item = self.view.friends.get_selected()
|
||||
self.presenter.open_in_browser(item)
|
70
src/interactors/profiles.py
Normal file
70
src/interactors/profiles.py
Normal file
@@ -0,0 +1,70 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals
|
||||
import six
|
||||
import wx
|
||||
import widgetUtils
|
||||
from pubsub import pub
|
||||
from views.dialogs import urlList
|
||||
from . import base
|
||||
|
||||
class userProfileInteractor(base.baseInteractor):
|
||||
|
||||
def enable_control(self, tab, control):
|
||||
if not hasattr(self.view, tab):
|
||||
raise AttributeError("The viw does not contain the specified tab.")
|
||||
tab = getattr(self.view, tab)
|
||||
if not hasattr(tab, control):
|
||||
raise AttributeError("The control is not present in the tab.")
|
||||
getattr(tab, control).Enable(True)
|
||||
|
||||
def set(self, tab, control, value):
|
||||
if not hasattr(self.view, tab):
|
||||
raise AttributeError("The view does not contain the specified tab.")
|
||||
tab = getattr(self.view, tab)
|
||||
if not hasattr(tab, control):
|
||||
raise AttributeError("The control is not present in the tab.")
|
||||
control = getattr(tab, control)
|
||||
control.SetValue(value)
|
||||
|
||||
def set_label(self, tab, control, value):
|
||||
if not hasattr(self.view, tab):
|
||||
raise AttributeError("The viw does not contain the specified tab.")
|
||||
tab = getattr(self.view, tab)
|
||||
if not hasattr(tab, control):
|
||||
raise AttributeError("The control is not present in the tab.")
|
||||
control = getattr(tab, control)
|
||||
control.SetLabel(value)
|
||||
|
||||
def load_image(self, image):
|
||||
image = wx.Image(stream=six.BytesIO(image.content))
|
||||
try:
|
||||
self.view.image.SetBitmap(wx.Bitmap(image))
|
||||
except ValueError:
|
||||
return
|
||||
self.view.panel.Layout()
|
||||
|
||||
def install(self, *args, **kwargs):
|
||||
super(userProfileInteractor, self).install(*args, **kwargs)
|
||||
pub.subscribe(self.set, self.modulename+"_set")
|
||||
pub.subscribe(self.load_image, self.modulename+"_load_image")
|
||||
self.view.create_controls("main_info")
|
||||
self.view.realice()
|
||||
widgetUtils.connect_event(self.view.main_info.go_site, widgetUtils.BUTTON_PRESSED, self.on_visit_website)
|
||||
|
||||
def uninstall(self):
|
||||
super(userProfileInteractor, self).uninstall()
|
||||
pub.unsubscribe(self.set, self.modulename+"_set")
|
||||
pub.unsubscribe(self.load_image, self.modulename+"_load_image")
|
||||
|
||||
|
||||
def on_visit_website(self, *args, **kwargs):
|
||||
urls = self.presenter.get_urls()
|
||||
if len(urls) == 1:
|
||||
self.presenter.visit_url(urls[0])
|
||||
else:
|
||||
dialog = urlList.urlList()
|
||||
dialog.populate_list(urls)
|
||||
if dialog.get_response() != widgetUtils.OK:
|
||||
return
|
||||
selected_url = urls[dialog.get_item()]
|
||||
self.presenter.visit_url(selected_url)
|
64
src/issueReporter/issueReporter.py
Normal file
64
src/issueReporter/issueReporter.py
Normal file
@@ -0,0 +1,64 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
############################################################
|
||||
# Copyright (c) 2018 Manuel Cortez <manuel@manuelcortez.net>
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
############################################################
|
||||
from __future__ import unicode_literals
|
||||
import wx
|
||||
import platform
|
||||
import requests
|
||||
import widgetUtils
|
||||
import application
|
||||
import paths
|
||||
from requests.auth import HTTPBasicAuth
|
||||
from mysc.thread_utils import call_threaded
|
||||
from . import wx_ui
|
||||
|
||||
class reportBug(object):
|
||||
def __init__(self):
|
||||
self.dialog = wx_ui.reportBugDialog()
|
||||
widgetUtils.connect_event(self.dialog.ok, widgetUtils.BUTTON_PRESSED, self.send)
|
||||
self.dialog.get_response()
|
||||
|
||||
def do_report(self, *args, **kwargs):
|
||||
r = requests.post(*args, **kwargs)
|
||||
if r.status_code > 300:
|
||||
wx.CallAfter(self.dialog.error)
|
||||
wx.CallAfter(self.dialog.progress.Destroy)
|
||||
wx.CallAfter(self.dialog.success, r.json()["data"]["issue"]["id"])
|
||||
|
||||
def send(self, *args, **kwargs):
|
||||
if self.dialog.get("summary") == "" or self.dialog.get("description") == "" or self.dialog.get("first_name") == "" or self.dialog.get("last_name") == "":
|
||||
self.dialog.no_filled()
|
||||
return
|
||||
if self.dialog.get("agree") == False:
|
||||
self.dialog.no_checkbox()
|
||||
return
|
||||
title = self.dialog.get("summary")
|
||||
body = self.dialog.get("description")
|
||||
issue_type = "issue" # for now just have issue
|
||||
app_type = paths.mode
|
||||
app_version = application.version
|
||||
reporter_name = "{first_name} {last_name}".format(first_name=self.dialog.get("first_name"), last_name=self.dialog.get("last_name"))
|
||||
reporter_contact_type = "email" # For now just email is supported in the issue reporter
|
||||
reporter_contact_handle = self.dialog.get("email")
|
||||
operating_system = platform.platform()
|
||||
json = dict(title=title, issue_type=issue_type, body=body, operating_system=operating_system, app_type=app_type, app_version=app_version, reporter_name=reporter_name, reporter_contact_handle=reporter_contact_handle, reporter_contact_type=reporter_contact_type)
|
||||
auth=HTTPBasicAuth(application.bts_name, application.bts_access_token)
|
||||
url = "{bts_url}/issue/new".format(bts_url=application.bts_url)
|
||||
call_threaded(self.do_report, url, json=json, auth=auth)
|
||||
self.dialog.show_progress()
|
||||
self.dialog.EndModal(wx.ID_OK)
|
110
src/issueReporter/wx_ui.py
Normal file
110
src/issueReporter/wx_ui.py
Normal file
@@ -0,0 +1,110 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
############################################################
|
||||
# Copyright (c) 2018 Manuel cortez <manuel@manuelcortez.net>
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
############################################################
|
||||
from __future__ import unicode_literals
|
||||
import wx
|
||||
import widgetUtils
|
||||
import application
|
||||
|
||||
class reportBugDialog(widgetUtils.BaseDialog):
|
||||
def __init__(self):
|
||||
super(reportBugDialog, self).__init__(parent=None, id=wx.NewId())
|
||||
self.SetTitle(_("Report an error"))
|
||||
panel = wx.Panel(self)
|
||||
sizer = wx.BoxSizer(wx.VERTICAL)
|
||||
|
||||
summaryLabel = wx.StaticText(panel, -1, _("Briefly describe what happened. You will be able to thoroughly explain it later"), size=wx.DefaultSize)
|
||||
self.summary = wx.TextCtrl(panel, -1)
|
||||
dc = wx.WindowDC(self.summary)
|
||||
dc.SetFont(self.summary.GetFont())
|
||||
self.summary.SetSize(dc.GetTextExtent("a"*80))
|
||||
summaryB = wx.BoxSizer(wx.HORIZONTAL)
|
||||
summaryB.Add(summaryLabel, 0, wx.ALL, 5)
|
||||
summaryB.Add(self.summary, 0, wx.ALL, 5)
|
||||
sizer.Add(summaryB, 0, wx.ALL, 5)
|
||||
|
||||
first_nameLabel = wx.StaticText(panel, -1, _("First Name"), size=wx.DefaultSize)
|
||||
self.first_name = wx.TextCtrl(panel, -1)
|
||||
dc = wx.WindowDC(self.first_name)
|
||||
dc.SetFont(self.first_name.GetFont())
|
||||
self.first_name.SetSize(dc.GetTextExtent("a"*40))
|
||||
first_nameB = wx.BoxSizer(wx.HORIZONTAL)
|
||||
first_nameB.Add(first_nameLabel, 0, wx.ALL, 5)
|
||||
first_nameB.Add(self.first_name, 0, wx.ALL, 5)
|
||||
sizer.Add(first_nameB, 0, wx.ALL, 5)
|
||||
|
||||
last_nameLabel = wx.StaticText(panel, -1, _("Last Name"), size=wx.DefaultSize)
|
||||
self.last_name = wx.TextCtrl(panel, -1)
|
||||
dc = wx.WindowDC(self.last_name)
|
||||
dc.SetFont(self.last_name.GetFont())
|
||||
self.last_name.SetSize(dc.GetTextExtent("a"*40))
|
||||
last_nameB = wx.BoxSizer(wx.HORIZONTAL)
|
||||
last_nameB.Add(last_nameLabel, 0, wx.ALL, 5)
|
||||
last_nameB.Add(self.last_name, 0, wx.ALL, 5)
|
||||
sizer.Add(last_nameB, 0, wx.ALL, 5)
|
||||
|
||||
emailLabel = wx.StaticText(panel, -1, _("Email address (Will not be public)"), size=wx.DefaultSize)
|
||||
self.email = wx.TextCtrl(panel, -1)
|
||||
dc = wx.WindowDC(self.email)
|
||||
dc.SetFont(self.email.GetFont())
|
||||
self.email.SetSize(dc.GetTextExtent("a"*30))
|
||||
emailB = wx.BoxSizer(wx.HORIZONTAL)
|
||||
emailB.Add(emailLabel, 0, wx.ALL, 5)
|
||||
emailB.Add(self.email, 0, wx.ALL, 5)
|
||||
sizer.Add(emailB, 0, wx.ALL, 5)
|
||||
|
||||
descriptionLabel = wx.StaticText(panel, -1, _("Here, you can describe the bug in detail"), size=wx.DefaultSize)
|
||||
self.description = wx.TextCtrl(panel, -1, style=wx.TE_MULTILINE)
|
||||
dc = wx.WindowDC(self.description)
|
||||
dc.SetFont(self.description.GetFont())
|
||||
(x, y) = dc.GetMultiLineTextExtent("0"*2000)
|
||||
self.description.SetSize((x, y))
|
||||
descBox = wx.BoxSizer(wx.HORIZONTAL)
|
||||
descBox.Add(descriptionLabel, 0, wx.ALL, 5)
|
||||
descBox.Add(self.description, 0, wx.ALL, 5)
|
||||
sizer.Add(descBox, 0, wx.ALL, 5)
|
||||
self.agree = wx.CheckBox(panel, -1, _("I know that the {0} bug system will get my email address to contact me and fix the bug quickly").format(application.name,))
|
||||
self.agree.SetValue(False)
|
||||
sizer.Add(self.agree, 0, wx.ALL, 5)
|
||||
self.ok = wx.Button(panel, wx.ID_OK, _("Send report"))
|
||||
self.ok.SetDefault()
|
||||
cancel = wx.Button(panel, wx.ID_CANCEL, _("Cancel"))
|
||||
btnBox = wx.BoxSizer(wx.HORIZONTAL)
|
||||
btnBox.Add(self.ok, 0, wx.ALL, 5)
|
||||
btnBox.Add(cancel, 0, wx.ALL, 5)
|
||||
sizer.Add(btnBox, 0, wx.ALL, 5)
|
||||
panel.SetSizer(sizer)
|
||||
self.SetClientSize(sizer.CalcMin())
|
||||
|
||||
def no_filled(self):
|
||||
wx.MessageDialog(self, _("You must fill out the following fields: first name, last name, email address and issue information."), _("Error"), wx.OK|wx.ICON_ERROR).ShowModal()
|
||||
|
||||
def no_checkbox(self):
|
||||
wx.MessageDialog(self, _("You need to mark the checkbox to provide us your email address to contact you if it is necessary."), _("Error"), wx.ICON_ERROR).ShowModal()
|
||||
|
||||
def success(self, id):
|
||||
wx.MessageDialog(self, _("Thanks for reporting this bug! In future versions, you may be able to find it in the changes list. You have received an email with more information regarding your report. You've reported the bug number %i") % (id), _("reported"), wx.OK).ShowModal()
|
||||
self.Destroy()
|
||||
|
||||
def error(self):
|
||||
wx.MessageDialog(self, _("Something unexpected occurred while trying to report the bug. Please, try again later"), _("Error while reporting"), wx.ICON_ERROR|wx.OK).ShowModal()
|
||||
self.Destroy()
|
||||
|
||||
def show_progress(self):
|
||||
self.progress = wx.ProgressDialog(title=_("Sending report..."), message=_("Please wait while your report is being send."), maximum=100, parent=self)
|
||||
self.progress.ShowModal()
|
@@ -1,4 +1,9 @@
|
||||
import __builtin__
|
||||
from __future__ import unicode_literals
|
||||
from future import standard_library
|
||||
standard_library.install_aliases()
|
||||
from builtins import zip
|
||||
from builtins import str
|
||||
import builtins
|
||||
import os
|
||||
import sys
|
||||
import ctypes
|
||||
@@ -25,12 +30,12 @@ def localeNameToWindowsLCID(localeName):
|
||||
func_LocaleNameToLCID=getattr(ctypes.windll.kernel32,'LocaleNameToLCID',None)
|
||||
if func_LocaleNameToLCID is not None:
|
||||
localeName=localeName.replace('_','-')
|
||||
LCID=func_LocaleNameToLCID(unicode(localeName),0)
|
||||
LCID=func_LocaleNameToLCID(str(localeName),0)
|
||||
else: #Windows doesn't have this functionality, manually search Python's windows_locale dictionary for the LCID
|
||||
localeName=locale.normalize(localeName)
|
||||
if '.' in localeName:
|
||||
localeName=localeName.split('.')[0]
|
||||
LCList=[x[0] for x in locale.windows_locale.iteritems() if x[1]==localeName]
|
||||
LCList=[x[0] for x in locale.windows_locale.items() if x[1]==localeName]
|
||||
if len(LCList)>0:
|
||||
LCID=LCList[0]
|
||||
else:
|
||||
@@ -77,7 +82,7 @@ def getAvailableLanguages():
|
||||
"""
|
||||
#Make a list of all the locales found in NVDA's locale dir
|
||||
l=[x for x in os.listdir(paths.locale_path()) if not x.startswith('.')]
|
||||
l=[x for x in l if os.path.isfile(paths.locale_path('%s/LC_MESSAGES/%s.po' % (x, application.short_name)))]
|
||||
l=[x for x in l if os.path.isfile(os.path.join(paths.locale_path(), '%s/LC_MESSAGES/%s.po' % (x, application.short_name)))]
|
||||
#Make sure that en (english) is in the list as it may not have any locale files, but is default
|
||||
if 'en' not in l:
|
||||
l.append('en')
|
||||
@@ -93,7 +98,7 @@ def getAvailableLanguages():
|
||||
# Translators: the label for the Windows default NVDA interface language.
|
||||
d.append(_("User default"))
|
||||
#return a zipped up version of both the lists (a list with tuples of locale,label)
|
||||
return zip(l,d)
|
||||
return list(zip(l,d))
|
||||
|
||||
def makePgettext(translations):
|
||||
"""Obtaina pgettext function for use with a gettext translations instance.
|
||||
@@ -103,15 +108,15 @@ def makePgettext(translations):
|
||||
"""
|
||||
if isinstance(translations, gettext.GNUTranslations):
|
||||
def pgettext(context, message):
|
||||
message = unicode(message)
|
||||
message = str(message)
|
||||
try:
|
||||
# Look up the message with its context.
|
||||
return translations._catalog[u"%s\x04%s" % (context, message)]
|
||||
return translations._catalog["%s\x04%s" % (context, message)]
|
||||
except KeyError:
|
||||
return message
|
||||
else:
|
||||
def pgettext(context, message):
|
||||
return unicode(message)
|
||||
return str(message)
|
||||
return pgettext
|
||||
|
||||
def setLanguage(lang):
|
||||
@@ -161,7 +166,10 @@ def setLanguage(lang):
|
||||
except IOError:
|
||||
trans=gettext.translation(application.short_name, fallback=True)
|
||||
curLang="en"
|
||||
trans.install(unicode=True)
|
||||
if sys.version[0] == "3":
|
||||
trans.install()
|
||||
else:
|
||||
trans.install(unicode=True)
|
||||
# Install our pgettext function.
|
||||
# __builtin__.__dict__["pgettext"] = makePgettext(trans)
|
||||
|
||||
|
@@ -1,7 +0,0 @@
|
||||
from .libloader import *
|
||||
|
||||
__version__ = 0.1
|
||||
__author__ = 'Christopher Toth <q@q-continuum.net>'
|
||||
__doc__ = """
|
||||
Quickly and easily load shared libraries from various platforms. Also includes a libloader.com module for loading com modules on Windows.
|
||||
"""
|
@@ -1,34 +0,0 @@
|
||||
from pywintypes import com_error
|
||||
import win32com
|
||||
import paths
|
||||
win32com.__gen_path__=paths.data_path(u"com_cache")
|
||||
import sys
|
||||
import os
|
||||
sys.path.append(os.path.join(win32com.__gen_path__, "."))
|
||||
from win32com.client import gencache
|
||||
fixed=False
|
||||
|
||||
def prepare_gencache():
|
||||
gencache.is_readonly = False
|
||||
gencache.GetGeneratePath()
|
||||
|
||||
def patched_getmodule(modname):
|
||||
mod=__import__(modname)
|
||||
return sys.modules[modname]
|
||||
|
||||
def load_com(*names):
|
||||
global fixed
|
||||
if fixed==False:
|
||||
gencache._GetModule=patched_getmodule
|
||||
fixed=True
|
||||
result = None
|
||||
for name in names:
|
||||
try:
|
||||
result = gencache.EnsureDispatch(name)
|
||||
break
|
||||
except com_error:
|
||||
continue
|
||||
if result is None:
|
||||
raise com_error("Unable to load any of the provided com objects.")
|
||||
return result
|
||||
|
@@ -1,56 +0,0 @@
|
||||
import ctypes
|
||||
import collections
|
||||
import platform
|
||||
import os
|
||||
|
||||
TYPES = {
|
||||
'Linux': {
|
||||
'loader': ctypes.CDLL,
|
||||
'functype': ctypes.CFUNCTYPE,
|
||||
'prefix': 'lib',
|
||||
'extension': '.so'
|
||||
},
|
||||
'Darwin': {
|
||||
'loader': ctypes.CDLL,
|
||||
'functype': ctypes.CFUNCTYPE,
|
||||
'prefix': 'lib',
|
||||
'extension': '.dylib'
|
||||
},
|
||||
}
|
||||
if platform.system() == 'Windows':
|
||||
TYPES['Windows'] = {
|
||||
'loader': ctypes.WinDLL,
|
||||
'functype': ctypes.WINFUNCTYPE,
|
||||
'prefix': "",
|
||||
'extension': '.dll'
|
||||
}
|
||||
|
||||
class LibraryLoadError(OSError): pass
|
||||
|
||||
def load_library(library, x86_path='.', x64_path='.', *args, **kwargs):
|
||||
lib = find_library_path(library, x86_path=x86_path, x64_path=x64_path)
|
||||
loaded = _do_load(lib, *args, **kwargs)
|
||||
if loaded is not None:
|
||||
return loaded
|
||||
raise LibraryLoadError('unable to load %r. Provided library path: %r' % (library, lib))
|
||||
|
||||
def _do_load(file, *args, **kwargs):
|
||||
loader = TYPES[platform.system()]['loader']
|
||||
return loader(file, *args, **kwargs)
|
||||
|
||||
def find_library_path(libname, x86_path='.', x64_path='.'):
|
||||
libname = '%s%s' % (TYPES[platform.system()]['prefix'], libname)
|
||||
if platform.architecture()[0] == '64bit':
|
||||
path = os.path.join(x64_path, libname)
|
||||
else:
|
||||
path = os.path.join(x86_path, libname)
|
||||
ext = get_library_extension()
|
||||
path = '%s%s' % (path, ext)
|
||||
return os.path.abspath(path)
|
||||
|
||||
|
||||
def get_functype():
|
||||
return TYPES[platform.system()]['functype']
|
||||
|
||||
def get_library_extension():
|
||||
return TYPES[platform.system()]['extension']
|
BIN
src/locales/es/LC_MESSAGES/socializer-doc.mo
Normal file
BIN
src/locales/es/LC_MESSAGES/socializer-doc.mo
Normal file
Binary file not shown.
535
src/locales/es/LC_MESSAGES/socializer-doc.po
Normal file
535
src/locales/es/LC_MESSAGES/socializer-doc.po
Normal file
@@ -0,0 +1,535 @@
|
||||
# SOME DESCRIPTIVE TITLE.
|
||||
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
|
||||
# This file is distributed under the same license as the PACKAGE package.
|
||||
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Socializer\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2016-06-29 13:33-0500\n"
|
||||
"PO-Revision-Date: 2016-06-29 16:25-0600\n"
|
||||
"Last-Translator: \n"
|
||||
"Language-Team: Manuel Cortez <manuel@manuelcortez.net>\n"
|
||||
"Language: es\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"X-Generator: Poedit 1.6.11\n"
|
||||
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
||||
|
||||
#. Translators: the label for the Windows default NVDA interface language.
|
||||
msgid "User default"
|
||||
msgstr ""
|
||||
|
||||
msgid "socializer's manual "
|
||||
msgstr "Manual de Socializer"
|
||||
|
||||
msgid "## Introduction"
|
||||
msgstr "## Introducción"
|
||||
|
||||
msgid ""
|
||||
"Socializer is an application to use [VK.com](https://vk.com) in an easy and "
|
||||
"accessible way with minimal CPU resource usage. Socializer will allow you to "
|
||||
"interact with the VK social network by giving you access to the most "
|
||||
"relevant features such as:"
|
||||
msgstr ""
|
||||
"Socializer es una aplicación para usar [vk.com](http://vk.com) de forma "
|
||||
"fácil y accesible, con un consumo de CPU mínimo. Socializer te permitirá "
|
||||
"interactuar con la red social VK, brindándote acceso a las características "
|
||||
"más relevantes, tales como:"
|
||||
|
||||
msgid "* Basic post creation in your wall (including photos)."
|
||||
msgstr ""
|
||||
"* Creación básica de publicaciones en tu muro (incluyendo subida de fotos)"
|
||||
|
||||
msgid "* Audio addition, removal, download and search."
|
||||
msgstr "* Añadir, descargar y buscar archivos de audio."
|
||||
|
||||
msgid "* audio albums management (create, delete and add audios)."
|
||||
msgstr ""
|
||||
"* Administración de albums de audio (crear, eliminar y añadir audios dentro "
|
||||
"de albums)."
|
||||
|
||||
msgid "* Post comments."
|
||||
msgstr "* Publicar comentarios."
|
||||
|
||||
msgid "* like, unlike and repost other's posts."
|
||||
msgstr ""
|
||||
"* Indicar que te gusta, que ya no te gusta o compartir publicaciones de "
|
||||
"otros usuarios."
|
||||
|
||||
msgid ""
|
||||
"* Open other's timelines so you could track someone's friends, posts or "
|
||||
"audio files."
|
||||
msgstr ""
|
||||
"* Abrir líneas temporales de otros usuarios para poder ver sus "
|
||||
"publicaciones, audios o amigos."
|
||||
|
||||
msgid "* Basic chat features."
|
||||
msgstr "* Características básicas de chat."
|
||||
|
||||
msgid ""
|
||||
"Note: When new features are added to socializer they will be added to this "
|
||||
"section."
|
||||
msgstr ""
|
||||
"Nota: Cuando sean añadidas, las nuevas características se incluirán aquí."
|
||||
|
||||
msgid "## Running"
|
||||
msgstr "## Abriendo socializer"
|
||||
|
||||
msgid ""
|
||||
"If you are using a built version, unzip the file in a new directory with no "
|
||||
"special characters, and open the socializer.exe file. If you haven't "
|
||||
"configured your VK account, you will see a dialogue, just press yes and a "
|
||||
"new dialogue will prompt for an user email or phone number and the password "
|
||||
"for your account. Take into account that the provided information will be "
|
||||
"saved in a config file as plain text. This application will need your "
|
||||
"information for renegotiating the access token when it expires."
|
||||
msgstr ""
|
||||
"Si estás usando una versión compilada (distribuible), descomprime el archivo "
|
||||
"ZIP en un nuevo directorio que no contenga caracteres especiales, y abre el "
|
||||
"archivo socializer.exe. Si no has configurado tu cuenta de VK, verás un "
|
||||
"diálogo donde se te preguntará si deseas configurar una. Si presionas en sí, "
|
||||
"podrás introducir tus datos. Toma en cuenta que la información proporcionada "
|
||||
"ha de guardarse en un archivo de configuración, como texto plano. La "
|
||||
"aplicación necesitará tu información para renovar el código de acceso cuando "
|
||||
"expire."
|
||||
|
||||
msgid ""
|
||||
"Note: Every time you grant access to socializer, probably You will receive "
|
||||
"an email from VK by telling you that someone has accessed to your account. "
|
||||
"It means that a new token has been negotiated between VK and socializer by "
|
||||
"using an authomatic process, you should ignore those advices, unless you "
|
||||
"receive an email when you are not logged in VK with socializer or other "
|
||||
"application. You can see your authorised applications in the configuration "
|
||||
"section in the VK website. New tokens are renegotiated every 24 hours."
|
||||
msgstr ""
|
||||
"Nota: Cada que se brinde acceso a socializer, probablemente recibirás un "
|
||||
"correo electrónico de VK diciéndote que puede que alguien haya entrado a tu "
|
||||
"cuenta. Significa que un nuevo código de acceso ha sido generado entre VK y "
|
||||
"Socializer mediante un proceso automático. Deberías ignorar estos avisos, a "
|
||||
"no ser que hayas recibido un correo cuando no estés usando Socializer o "
|
||||
"alguna otra aplicación. Puedes ver tus aplicaciones autorizadas en la página "
|
||||
"de tu perfil en el sitio web de VK. Un nuevo código de acceso debe ser "
|
||||
"generado cada 24 horas."
|
||||
|
||||
msgid "## Main interface"
|
||||
msgstr "## Interfaz"
|
||||
|
||||
msgid ""
|
||||
"If you have used [TWBlue](https://github.com/manuelcortez/twblue) before, "
|
||||
"the socializer's interface is quite similar. Once you have authorised your "
|
||||
"account, you will see a window with the following elements:"
|
||||
msgstr ""
|
||||
"Si alguna vez has usado [TWBlue](https//github.com/manuelcortez/twblue) "
|
||||
"anteriormente, te darás cuenta que la interfaz gráfica de socializer es muy "
|
||||
"parecida. Una vez que hayas autorizado tu cuenta, Podrás ver una ventana con "
|
||||
"los siguientes elementos:"
|
||||
|
||||
msgid ""
|
||||
"* A tree view at the left of the window, where you will see the list of "
|
||||
"buffers. These buffers are divided in three categories, posts, music and "
|
||||
"people. You could expand each category for seeing the child buffers. There "
|
||||
"are some additional buffers, timelines and chats, wich will be filled with "
|
||||
"timelines for your friends or with chats, when you start or receive a chat "
|
||||
"session."
|
||||
msgstr ""
|
||||
"* Una vista de árbol en la parte izquierda de laventana, donde podrás ver la "
|
||||
"lista de buffers. Los buffers están divididos en tres categorías, "
|
||||
"publicaciones, música y gente. Puedes expandir cada categoría para ver los "
|
||||
"elementos hijos. Hay además buffers adicionales, líneas temporales y chats, "
|
||||
"que serán usados para guardar líneas temporales para tus amigos, o chats "
|
||||
"cuando recibas o envíes un mensaje."
|
||||
|
||||
msgid "* A button for making a post to your wall."
|
||||
msgstr "* Un botón para publicar en tu muro."
|
||||
|
||||
msgid "* In audio buffers, Two buttons: Play and play all."
|
||||
msgstr ""
|
||||
"* En buffers de audio, un par de botones: Reproducir y reproducir todo."
|
||||
|
||||
msgid ""
|
||||
"* In audio album buffers, a button for loading music. By default, albums are "
|
||||
"empty, you have to press the load button for getting the album's items."
|
||||
msgstr ""
|
||||
"* En buffers para albums de audio, un botón llamado cargar álbum. De manera "
|
||||
"predeterminada, los álbumes se encuentran vacíos, debes pulsar el botón "
|
||||
"cargar álbum para descargar la información necesaria que permitirá mostrar "
|
||||
"la música dentro del buffer del álbum."
|
||||
|
||||
msgid ""
|
||||
"* A list where you will see the posts for the currently selected buffer."
|
||||
msgstr "* Una lista donde podrás ver los elementos del buffer seleccionado."
|
||||
|
||||
msgid ""
|
||||
"* In people buffers, like the friends buffer, a button for sending a message "
|
||||
"to your friends. Pressing that button will cause a chat buffer to be created."
|
||||
msgstr ""
|
||||
"* En buffers de amigos, un botón que permite enviar un mensaje a la persona "
|
||||
"seleccionada. Si es activado, el botón creará un buffer de chat "
|
||||
"automáticamente."
|
||||
|
||||
msgid ""
|
||||
"* A status bar where the program will put some useful information about what "
|
||||
"it's doing at the moment."
|
||||
msgstr ""
|
||||
"* Una barra de estado, donde el programa escribirá información importante "
|
||||
"sobre lo que se encuentra haciendo en cada momento."
|
||||
|
||||
msgid "* And a menu bar."
|
||||
msgstr "* Y una barra de menú."
|
||||
|
||||
msgid ""
|
||||
"When socializer starts, it will try to load your news items, wall, audios "
|
||||
"(your audios, recommended and populars) and friends. At the moment there are "
|
||||
"only a few supported actions for these items:"
|
||||
msgstr ""
|
||||
"Cuando socializer inicia, intentará cargar los elementos en el buffer "
|
||||
"principal, publicaciones en tu muro, canciones en tus buffers de audio (mis "
|
||||
"audios, populares y recomendaciones), así como tus amigos. Por el momento "
|
||||
"solo se pueden hacer pocas acciones para cada uno de estos tipos de elemento."
|
||||
|
||||
msgid ""
|
||||
"* Audio files: You can play the currently selected song, view the song's "
|
||||
"details (including lyrics, if available), add or remove from your library, "
|
||||
"and download it to a desired place in your hard drive. You can find audio "
|
||||
"files in your news feed or in your own audios buffers. You can find audios "
|
||||
"as post's attachments. You can create an audios timeline for displaying "
|
||||
"other's audios."
|
||||
msgstr ""
|
||||
"* Archivos de audio: Puedes reproducir el audio seleccionado, ver los "
|
||||
"detalles de la canción (incluyendo letras, si las tiene), añadirlo y "
|
||||
"eliminarlo de tu biblioteca, y descargar la canción a tu disco duro. Puedes "
|
||||
"encontrar archivos de audio en tus propios buffers de audio, en el buffer "
|
||||
"principal y pueden estar incluidos como adjuntos en publicaciones. Puedes "
|
||||
"abrir una línea temporal de audios para ver los audios de otros usuarios de "
|
||||
"VK."
|
||||
|
||||
msgid ""
|
||||
"* News feed's post: In your news feed buffer, you can press return in any "
|
||||
"post and socializer will open a new dialogue which can be different, "
|
||||
"depending in the kind of post you are when the return key was pressed. For "
|
||||
"example it will open the post if you are focusing a \"normal\" post, a list "
|
||||
"of people if you are in a post wich indicates that someone has added "
|
||||
"friends, an audio displayer if you are in a post wich indicates that someone "
|
||||
"has added an audio, etc."
|
||||
msgstr ""
|
||||
"* Publicaciones en el buffer principal: En el buffer principal, puedes "
|
||||
"pulsar la tecla intro y socializer abrirá un diálogo que puede ser "
|
||||
"diferente, dependiendo del tipo de publicación que estaba enfocada cuando se "
|
||||
"presionó la tecla. Por ejemplo, abrirá la publicación si estabas en una "
|
||||
"publicación \"normal\", una lista de personas si estabas en una publicación "
|
||||
"que indicaba que alguien había añadido amigos, el visualizador de detalles "
|
||||
"de audios si estabas en una publicación que indicaba que alguien había "
|
||||
"añadido audios, etc."
|
||||
|
||||
msgid ""
|
||||
"* Wall posts: It will show the post in a dialogue so you could interact with "
|
||||
"its attachments, view and post comments, or like/unlike/share the post."
|
||||
msgstr ""
|
||||
"* publicaciones en el muro: Mostrará la publicación en un nuevo diálogo, que "
|
||||
"te permitirá interactuar con el post, ver los adjuntos, ver y publicar "
|
||||
"comentarios, así como indicar si te gusta, ya no te gusta y compartir la "
|
||||
"publicación."
|
||||
|
||||
msgid ""
|
||||
"* You can send a message to someone by pressing the send message button in "
|
||||
"the buffer where you are, if available. Deactivated accounts cannot receive "
|
||||
"messages."
|
||||
msgstr ""
|
||||
"* Puedes enviar un mensaje a alguien pulsando el botón Enviar mensaje, si "
|
||||
"está disponible. Los usuarios con cuentas desactivadas no pueden recibir "
|
||||
"mensajes."
|
||||
|
||||
msgid "### Making a post"
|
||||
msgstr "### Haciendo una publicación"
|
||||
|
||||
msgid ""
|
||||
"When you press the post button, a new dialogue will show up. This dialogue "
|
||||
"allows you to post something in your wall. In this dialogue you have to "
|
||||
"write a message. You can translate your message and fix your spelling "
|
||||
"mistakes. Also you can post an URL address, socializer will try to add it as "
|
||||
"an attachment, so you will not have to worry about this. When you're ready, "
|
||||
"just press the send button and it'll be done."
|
||||
msgstr ""
|
||||
"Cuando pulses el botón para publicar, se mostrará un diálogo. Este diálogo "
|
||||
"te permitirá publicar algo en tu muro. En este diálogo tienes que escribir "
|
||||
"un mensaje. Puedes traducir el mensaje y corregir tus errores ortográficos. "
|
||||
"También puedes publicar una dirección URL, y socializer intentará enviarla "
|
||||
"como un adjunto a tu publicación, por lo que no tienes que preocuparte. "
|
||||
"Cuando estés listo, solo presiona el botón enviar, y estará listo."
|
||||
|
||||
msgid ""
|
||||
"If you want to add some photos, you can press the attach button, then press "
|
||||
"the kind of attachment you want to add. After this, select the file you want "
|
||||
"to add and you will see it in the list, once processed. When you are done "
|
||||
"with attachments, press the OK button, and continue with your post. When you "
|
||||
"are ready, press the send button. Your post could take some time to be "
|
||||
"published, depending in the amount of files you have added, but it should be "
|
||||
"displayed in your wall and newsfeed as soon as it is posted."
|
||||
msgstr ""
|
||||
"Si quieres añadir algunas fotos, presiona el botón adjuntar, seguidamente "
|
||||
"encuentra el botón del elemento que quieres añadir. Después, selecciona el "
|
||||
"archivo a adjuntar y lo podrás ver en la lista de archivos a cargar una vez "
|
||||
"sea procesado por el programa. Cuando hayas terminado con los adjuntos, "
|
||||
"presiona el botón aceptar, y continúa con tu publicación. Cuando esté todo "
|
||||
"listo, pulsa el botón enviar. Tu publicación podría tomar un tiempo en ser "
|
||||
"enviada, dependiendo de la cantidad y el tamaño de los adjuntos que "
|
||||
"añadiste, pero debería aparecer publicada en tu muro y en el buffer "
|
||||
"principal tan rápidamente como sea publicada."
|
||||
|
||||
msgid "### Working with posts in news feed"
|
||||
msgstr "### Trabajando con publicaciones en el buffer principal."
|
||||
|
||||
msgid ""
|
||||
"You can press the return key in any post in your news feed for opening a new "
|
||||
"dialogue with some information. The information and dialogue will be "
|
||||
"different if you are viewing a friendship's notification (when someone has "
|
||||
"added some friends), an audio file, or a regular post."
|
||||
msgstr ""
|
||||
"Puedes pulsar la tecla intro en cualquier publicación de tu buffer principal "
|
||||
"para abrir un nuevo diálogo con información. La información puede variar si "
|
||||
"estás viendo una notificación de nuevos amigos (cuando alguien añade "
|
||||
"amigos), un archivo de audio, o una publicación regular."
|
||||
|
||||
msgid ""
|
||||
"If you open a regular post in your newsfeed, you will be able to see the "
|
||||
"comments in a list, indicate if you do like or dislike the post, repost or "
|
||||
"add a new comment. If the post has some attachments, you'll find a list "
|
||||
"populated with them, you can press return in an attachment to execute its "
|
||||
"default action, wich will be different depending on the kind of attachment "
|
||||
"that you are viewing."
|
||||
msgstr ""
|
||||
"Si abres una publicación regular en tu buffer principal, serás capaz de leer "
|
||||
"los comentarios en una lista, indicar si te gusta o ya no te gusta la "
|
||||
"publicación, compartirla o añadir un nuevo comentario. Si la publicación "
|
||||
"contiene adjuntos, encontrarás una lista con ellos. Puedes pulsar intro "
|
||||
"sobre uno de ellos para abrir la acción predeterminada. La acción "
|
||||
"predeterminada para cada archivo dependerá del tipo de archivo en el que te "
|
||||
"enfoques."
|
||||
|
||||
msgid ""
|
||||
"For friend notifications, you can only view the new added friends in a list "
|
||||
"and there are some kind of posts that aren't handled. It should be improved."
|
||||
msgstr ""
|
||||
"Para las notificaciones de nuevos amigos, solo puedes ver las personas que "
|
||||
"han sido añadidas. También hay algunas publicaciones que no se muestran por "
|
||||
"defecto."
|
||||
|
||||
msgid ""
|
||||
"Additionally, you can press the menu Key or the right click for displaying "
|
||||
"a menu with some quick actions available for the post you are focusing. "
|
||||
"These actions are different for every post type."
|
||||
msgstr ""
|
||||
"Además, puedes pulsar la tecla de aplicaciones o el botón derecho del ratón "
|
||||
"para mostrar un menú de acciones rápidas que están disponibles para el "
|
||||
"elemento seleccionado. Las acciones son diferentes para cada tipo de "
|
||||
"publicación."
|
||||
|
||||
msgid "### Working with songs"
|
||||
msgstr "### Trabajando con audios"
|
||||
|
||||
msgid "Note: the following applies to audio timelines too."
|
||||
msgstr "Nota: Lo siguiente también es aplicable a líneas temporales de audio."
|
||||
|
||||
msgid ""
|
||||
"If you want to play or view audio's details, you'll have to navigate to the "
|
||||
"tree view, and, using the down arrow, look for \"my audios\", \"populars\" "
|
||||
"or \"Recommendations\". You will see two more buttons, play and play all. "
|
||||
"The play button will play the currently selected audio, and the play all "
|
||||
"button will play audios in the current buffer, starting with the current "
|
||||
"selected item. You can go to the song's list, look for a desired song and "
|
||||
"press the play button, or Ctrl+return, which is a keyboard shorcut. Take in "
|
||||
"to account that there are some keyboard shorcuts that only work in the list "
|
||||
"of items."
|
||||
msgstr ""
|
||||
"Si quieres reproducir o ver los detalles de un archivo de audio, debes "
|
||||
"navegar hasta la vista de árbol y, utilizando las flechas de cursor, ubicar "
|
||||
"algún buffer de audio (mis audios, populares o recomendaciones). Verás dos "
|
||||
"botones extras, reproducir y reproducir todo. El botón reproducir "
|
||||
"reproducirá el audio seleccionado, y el botón reproducir todo comenzará a "
|
||||
"reproducir, a partir del audio seleccionado y hasta el final, todos los "
|
||||
"audios del buffer. Puedes ir a la lista de canciones, buscar una canción que "
|
||||
"te guste y pulsar el botón reproducir, o pulsar Control intro, que es un "
|
||||
"atajo de teclado. Ten en cuenta que algunos atajos de teclado solo funcionan "
|
||||
"cuando estás en la lista de elementos."
|
||||
|
||||
msgid ""
|
||||
"You can play audio from any buffer, just press ctrl+return for making the "
|
||||
"audio playback possible."
|
||||
msgstr ""
|
||||
"Puedes reproducir audios desde cualquier buffer, solo presiona Control intro "
|
||||
"para hacer posible la reproducción."
|
||||
|
||||
msgid ""
|
||||
"If someone has added multiple audios at once to his library, you will see "
|
||||
"something like this in your newsfeed: \"(friend) has added 4 audios: audio "
|
||||
"1, audio2, audio3 and audio4\". You can press return in the post for "
|
||||
"opening the audio's details dialogue, where you will be able to see a list "
|
||||
"with these audios. By default the first detected song is selected, which "
|
||||
"means that you could read its details by pressing tab, download or add it to "
|
||||
"your library. If you change the audio in the list, the information will be "
|
||||
"updated and you will see details and actions will take effect in the new "
|
||||
"selected audio."
|
||||
msgstr ""
|
||||
"Si alguien ha añadido más de un audio a su biblioteca, podrás ver algo como "
|
||||
"lo siguiente: \"(alguien) ha añadido 4 audios: audio1, audio2, audio3 y "
|
||||
"audio4\". Puedes pulsar intro en la publicación para abrir el diálogo del "
|
||||
"visualizador de detalles de audios, donde podrás verlos todos en una lista. "
|
||||
"De forma predeterminada, el primer audio detectado está seleccionado, lo que "
|
||||
"significa que puedes pulsar tab para ver sus detalles, descargarlo y "
|
||||
"añadirlo a la biblioteca. Si cambias la canción en la lista, notarás que la "
|
||||
"información se actualizará y ahora los detalles y acciones a mostrar tendrán "
|
||||
"efecto en el nuevo audio seleccionado."
|
||||
|
||||
msgid ""
|
||||
"When an audio file is playing, you can press f5 and f6 for decreasing and "
|
||||
"increasing volume, respectively, or control+shift+return for play/pause."
|
||||
msgstr ""
|
||||
"Cuando un archivo de audio está siendo reproducido, puedes pulsar las teclas "
|
||||
"f5 y f6 para bajar y subir volumen, respectivamente. También puedes pulsar "
|
||||
"Control Shift Intro para pausar/reproducir la canción."
|
||||
|
||||
msgid ""
|
||||
"If you want to see some details for the selected audio file, you can do it "
|
||||
"by pressing the return key. You will be able to read some useful "
|
||||
"information (title, artist, duration and the lyric, if available). Also you "
|
||||
"will be able to download the song to your hard drive, you have to press the "
|
||||
"download button in the details' dialogue."
|
||||
msgstr ""
|
||||
"Si quieres ver algunos detalles para el audio seleccionado, pulsa intro "
|
||||
"sobre él. Podrás leer información importante sobre la canción (título, "
|
||||
"artista, duración y la letra, si está disponible). También podrás descargar "
|
||||
"la canción a tu disco duro, solo tienes que pulsar el botón descargar en el "
|
||||
"diálogo de detalles de audio."
|
||||
|
||||
msgid ""
|
||||
"When the download starts, you can close the details dialogue and check the "
|
||||
"status bar in the main window for seeing the current progress."
|
||||
msgstr ""
|
||||
"Cuando la descarga inicie, puedes cerrar el visualizador de detalles de "
|
||||
"audio y revisar la barra de estado para ver el progreso."
|
||||
|
||||
msgid ""
|
||||
"Additionally, you can search for audios by using the menu bar, in the buffer "
|
||||
"menu, select search, then audio. It will display a dialog where you have to "
|
||||
"set your search preferences."
|
||||
msgstr ""
|
||||
"Además, puedes hacer una búsqueda de canciones usando la barra de menú, en "
|
||||
"el menú buffer, buscar, luego audio. Mostrará un diálogo donde deberás "
|
||||
"establecer tus preferencias de búsqueda."
|
||||
|
||||
msgid ""
|
||||
"If you press the menu key, you will see a menu where you will be able to do "
|
||||
"some actions, for example, add the audio to an album, or add/remove the song "
|
||||
"from your library."
|
||||
msgstr ""
|
||||
"Si presionas la tecla de aplicaciones podrás ver un menú desde el que puedes "
|
||||
"realizar algunas acciones, por ejemplo mover la canción a un álbum, o "
|
||||
"agregarlo/eliminarlo de tu biblioteca."
|
||||
|
||||
msgid "## menu Bar"
|
||||
msgstr "## barra de menú"
|
||||
|
||||
msgid ""
|
||||
"You can go to the menu bar by pressing ALT. Right now, there are three "
|
||||
"menus, application, buffer and help:"
|
||||
msgstr ""
|
||||
"Puedes ir a la barra de menú pulsando la tecla ALT. Actualmente existen tres "
|
||||
"menús: aplicación, buffer y ayuda."
|
||||
|
||||
msgid "### Application menu"
|
||||
msgstr "### Menú aplicación"
|
||||
|
||||
msgid ""
|
||||
"* Create. Here you can create some things in VK. The only supported item at "
|
||||
"this moment is the audio album."
|
||||
msgstr ""
|
||||
"* Crear. Aquí puedes crear algunas cosas en VK. Actualmente solo se "
|
||||
"encuentra soportada la creación de álbumes de audio."
|
||||
|
||||
msgid ""
|
||||
"* Delete: Removes items from the VK servers. The only supported item here is "
|
||||
"the audio album."
|
||||
msgstr ""
|
||||
"* eliminar. Elimina elementos desde el servidor de VK. Actualmente solo se "
|
||||
"encuentra soportado el borrado de álbumes de audio."
|
||||
|
||||
msgid ""
|
||||
"* you can set your preferences by opening the preferences dialog located in "
|
||||
"this menu."
|
||||
msgstr ""
|
||||
"* Puedes establecer tus preferencias desde el diálogo de preferencias, "
|
||||
"ubicado en este menú."
|
||||
|
||||
msgid "### Buffer menu"
|
||||
msgstr "### Menú buffer"
|
||||
|
||||
msgid ""
|
||||
"* new timeline: This option allows you to create a new timeline. This kind "
|
||||
"of buffers is capable of download all posts in an user's profile."
|
||||
msgstr ""
|
||||
"* Nueva línea temporal: Esta opción permite crear una línea temporal para "
|
||||
"otro usuario de VK. Las líneas temporales pueden descargar publicaciones de "
|
||||
"otros usuarios."
|
||||
|
||||
msgid ""
|
||||
"* search: This submenu allows you to create a new buffer, at the moment, "
|
||||
"you can create only a kind of buffer, an audio search. The audio search will "
|
||||
"be located in the music category and will have the last 299 results of your "
|
||||
"query."
|
||||
msgstr ""
|
||||
"* Buscar: permite hacer una búsqueda en VK. Por el momento solo se pueden "
|
||||
"buscar archivos de audio. Las búsquedas de audio se añadirán en el buffer de "
|
||||
"música y contendrán los últimos 299 resultados."
|
||||
|
||||
msgid ""
|
||||
"* Update current buffer: perform an update operation in the selected buffer, "
|
||||
"which will retrieve the new items."
|
||||
msgstr ""
|
||||
"* Actualizar buffer: Realiza una operación de actualización en el buffer "
|
||||
"actual, lo que recuperará los nuevos elementos."
|
||||
|
||||
msgid ""
|
||||
"* Load previous items: Get the previous items for the currently focused "
|
||||
"buffer."
|
||||
msgstr ""
|
||||
"* Cargar elementos anteriores: Carga los elementos anteriormente publicados "
|
||||
"en el buffer actual."
|
||||
|
||||
msgid ""
|
||||
"* Remove buffer: Tries to remove the current buffer. Default buffers can't "
|
||||
"be removed."
|
||||
msgstr ""
|
||||
"* Eliminar buffer: Intenta remover el buffer actual. Los buffers "
|
||||
"predeterminados no pueden eliminarse."
|
||||
|
||||
msgid "The help menu is self explanatory."
|
||||
msgstr "El menú ayuda se explica por sí solo."
|
||||
|
||||
msgid "## Contributing"
|
||||
msgstr "## Contribuir"
|
||||
|
||||
msgid ""
|
||||
"If you notice some errors in this document, or features that are not "
|
||||
"documented yet, you can suggest those changes by contacting me (more "
|
||||
"information can be find in the following section)."
|
||||
msgstr ""
|
||||
"Si notas algún error en este documento, alguna sección no cubierta o "
|
||||
"simplemente quieres sugerir algo, puedes hacerlo mediante las formas de "
|
||||
"contacto (lee la siguiente sección)."
|
||||
|
||||
msgid "## contact"
|
||||
msgstr "## Contacto"
|
||||
|
||||
msgid ""
|
||||
"If you have questions, don't esitate to contact me in [Twitter,](https://"
|
||||
"twitter.com/manuelcortez00) or sending me an email to "
|
||||
"manuel(at)manuelcortez(dot)net. Just replace the words in parentheses with "
|
||||
"the original signs."
|
||||
msgstr ""
|
||||
"Si tienes preguntas, no dudes en contactarme mediante [Twitter,](https://"
|
||||
"twitter.com/manuelcortez00) o envíame un correo electrónico a "
|
||||
"manuel(arroba)manuelcortez(punto)net. Solo asegúrate de remplazar las "
|
||||
"palabras entre paréntesis por el símbolo original."
|
Binary file not shown.
File diff suppressed because it is too large
Load Diff
BIN
src/locales/es/LC_MESSAGES/wxstd.mo
Normal file
BIN
src/locales/es/LC_MESSAGES/wxstd.mo
Normal file
Binary file not shown.
BIN
src/locales/ru/LC_MESSAGES/socializer-documentation.mo
Normal file
BIN
src/locales/ru/LC_MESSAGES/socializer-documentation.mo
Normal file
Binary file not shown.
3123
src/locales/ru/LC_MESSAGES/socializer-documentation.po
Normal file
3123
src/locales/ru/LC_MESSAGES/socializer-documentation.po
Normal file
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
BIN
src/locales/ru/LC_MESSAGES/wxstd.mo
Normal file
BIN
src/locales/ru/LC_MESSAGES/wxstd.mo
Normal file
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user