pytodo-qt 0.2.6__py3-none-any.whl → 0.2.8__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of pytodo-qt might be problematic. Click here for more details.
- pytodo_qt/__main__.py +2 -11
- pytodo_qt/core/settings.py +1 -1
- pytodo_qt/gui/MainWindow.py +43 -17
- pytodo_qt/net/tcp_client_lib.py +5 -2
- pytodo_qt/net/tcp_server_lib.py +1 -1
- {pytodo_qt-0.2.6.dist-info → pytodo_qt-0.2.8.dist-info}/METADATA +1 -1
- {pytodo_qt-0.2.6.dist-info → pytodo_qt-0.2.8.dist-info}/RECORD +11 -11
- {pytodo_qt-0.2.6.dist-info → pytodo_qt-0.2.8.dist-info}/COPYING +0 -0
- {pytodo_qt-0.2.6.dist-info → pytodo_qt-0.2.8.dist-info}/WHEEL +0 -0
- {pytodo_qt-0.2.6.dist-info → pytodo_qt-0.2.8.dist-info}/entry_points.txt +0 -0
- {pytodo_qt-0.2.6.dist-info → pytodo_qt-0.2.8.dist-info}/top_level.txt +0 -0
pytodo_qt/__main__.py
CHANGED
|
@@ -37,17 +37,8 @@ logger = Logger(__name__)
|
|
|
37
37
|
|
|
38
38
|
# Main function
|
|
39
39
|
def main():
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
if sys.path[i].__contains__("site-packages"):
|
|
43
|
-
location = sys.path[i]
|
|
44
|
-
location += "/pytodo_qt"
|
|
45
|
-
os.chdir(location)
|
|
46
|
-
break
|
|
47
|
-
|
|
48
|
-
if location == "":
|
|
49
|
-
logger.log.exception("Unknown installation or invocation, exiting")
|
|
50
|
-
sys.exit(1)
|
|
40
|
+
# move to main module dir
|
|
41
|
+
os.chdir(os.path.dirname(__file__))
|
|
51
42
|
|
|
52
43
|
# create a command line arg_parser
|
|
53
44
|
arg_parser = argparse.ArgumentParser(
|
pytodo_qt/core/settings.py
CHANGED
pytodo_qt/gui/MainWindow.py
CHANGED
|
@@ -49,8 +49,8 @@ class MainWindow(QMainWindow):
|
|
|
49
49
|
|
|
50
50
|
# create the window, set title and tooltip, resize and center window
|
|
51
51
|
super().__init__()
|
|
52
|
-
self.setWindowIcon(QIcon("gui/icons/pytodo-qt.png"))
|
|
53
52
|
self.setWindowTitle("To-Do")
|
|
53
|
+
self.setWindowIcon(QIcon("gui/icons/pytodo-qt.png"))
|
|
54
54
|
self.setToolTip("Python3 + Qt5 = Happy <u>To-Do</u> Programmer!")
|
|
55
55
|
QToolTip.setFont(QFont("Helvetica", 10))
|
|
56
56
|
self.resize(800, 500)
|
|
@@ -121,13 +121,13 @@ class MainWindow(QMainWindow):
|
|
|
121
121
|
stop_server.triggered.connect(self.db_stop_server)
|
|
122
122
|
|
|
123
123
|
change_port = QAction(QIcon(), "Change network server port", self)
|
|
124
|
-
change_port.triggered.connect(self.
|
|
124
|
+
change_port.triggered.connect(self.db_server_bind_port)
|
|
125
125
|
|
|
126
|
-
|
|
127
|
-
|
|
126
|
+
change_address = QAction(QIcon(), "Change network server address", self)
|
|
127
|
+
change_address.triggered.connect(self.db_server_bind_address)
|
|
128
128
|
|
|
129
|
-
|
|
130
|
-
|
|
129
|
+
change_aes_cipher = QAction(QIcon(), "Change network AES cipher", self)
|
|
130
|
+
change_aes_cipher.triggered.connect(self.db_change_aes_cipher)
|
|
131
131
|
|
|
132
132
|
# fanfare
|
|
133
133
|
about = QAction(QIcon(), "About To-Do", self)
|
|
@@ -186,8 +186,8 @@ class MainWindow(QMainWindow):
|
|
|
186
186
|
server_menu.addAction(start_server)
|
|
187
187
|
server_menu.addAction(stop_server)
|
|
188
188
|
server_menu.addAction(change_port)
|
|
189
|
-
server_menu.addAction(
|
|
190
|
-
server_menu.addAction(
|
|
189
|
+
server_menu.addAction(change_address)
|
|
190
|
+
server_menu.addAction(change_aes_cipher)
|
|
191
191
|
else:
|
|
192
192
|
msg = "Could not populate server menu, exiting"
|
|
193
193
|
QMessageBox.warning(self, "Creation Error", msg)
|
|
@@ -280,7 +280,7 @@ class MainWindow(QMainWindow):
|
|
|
280
280
|
self.printer = QPrinter()
|
|
281
281
|
|
|
282
282
|
# Refresh after every sync
|
|
283
|
-
settings.DB.db_client.sync_occurred.connect(self.
|
|
283
|
+
settings.DB.db_client.sync_occurred.connect(self.db_sync_occurred)
|
|
284
284
|
|
|
285
285
|
# show the window
|
|
286
286
|
self.show()
|
|
@@ -290,6 +290,16 @@ class MainWindow(QMainWindow):
|
|
|
290
290
|
|
|
291
291
|
logger.log.info("Main window created")
|
|
292
292
|
|
|
293
|
+
@QtCore.pyqtSlot(str)
|
|
294
|
+
def db_sync_occurred(self, msg):
|
|
295
|
+
self.tray_icon.showMessage(
|
|
296
|
+
"Sync Event",
|
|
297
|
+
msg,
|
|
298
|
+
QIcon(),
|
|
299
|
+
8000,
|
|
300
|
+
)
|
|
301
|
+
self.refresh()
|
|
302
|
+
|
|
293
303
|
def read_todo_data(self):
|
|
294
304
|
"""Read lists of to-dos from database."""
|
|
295
305
|
if Path.exists(settings.db_fn):
|
|
@@ -327,12 +337,24 @@ class MainWindow(QMainWindow):
|
|
|
327
337
|
self.update_progress_bar(0)
|
|
328
338
|
self.update_status_bar("Sync Pull")
|
|
329
339
|
SyncDialog(sync_operations["PULL_REQUEST"].name).exec()
|
|
340
|
+
self.tray_icon.showMessage(
|
|
341
|
+
"Sync Event",
|
|
342
|
+
"Pulled to-do lists from remote host",
|
|
343
|
+
QIcon(),
|
|
344
|
+
8000,
|
|
345
|
+
)
|
|
330
346
|
|
|
331
347
|
def db_sync_push(self):
|
|
332
348
|
"""Push lists to another computer."""
|
|
333
349
|
self.update_progress_bar(0)
|
|
334
|
-
self.update_status_bar("
|
|
350
|
+
self.update_status_bar("Sync Push")
|
|
335
351
|
SyncDialog(sync_operations["PUSH_REQUEST"].name).exec()
|
|
352
|
+
self.tray_icon.showMessage(
|
|
353
|
+
"Sync Event",
|
|
354
|
+
"Pushed to-do lists to remote host",
|
|
355
|
+
QIcon(),
|
|
356
|
+
8000,
|
|
357
|
+
)
|
|
336
358
|
|
|
337
359
|
@error_on_none_db
|
|
338
360
|
def db_update_active_list(self, list_name, *args, **kwargs):
|
|
@@ -352,12 +374,14 @@ class MainWindow(QMainWindow):
|
|
|
352
374
|
def db_start_server(self, *args, **kwargs):
|
|
353
375
|
"""Start the database server."""
|
|
354
376
|
if settings.DB.server_running():
|
|
355
|
-
|
|
356
|
-
|
|
377
|
+
self.tray_icon.showMessage(
|
|
378
|
+
"Info", "The database server is already running.", QIcon(), 8000
|
|
357
379
|
)
|
|
358
380
|
else:
|
|
359
381
|
settings.DB.start_server()
|
|
360
|
-
|
|
382
|
+
self.tray_icon.showMessage(
|
|
383
|
+
"Info", "The database server was started.", QIcon(), 8000
|
|
384
|
+
)
|
|
361
385
|
|
|
362
386
|
@error_on_none_db
|
|
363
387
|
def db_stop_server(self, *args, **kwargs):
|
|
@@ -366,10 +390,12 @@ class MainWindow(QMainWindow):
|
|
|
366
390
|
QMessageBox.information(self, "Info", "The database server is not running.")
|
|
367
391
|
else:
|
|
368
392
|
settings.DB.stop_server()
|
|
369
|
-
|
|
393
|
+
self.tray_icon.showMessage(
|
|
394
|
+
"Info", "The database server was stopped.", QIcon(), 8000
|
|
395
|
+
)
|
|
370
396
|
|
|
371
397
|
@error_on_none_db
|
|
372
|
-
def
|
|
398
|
+
def db_server_bind_port(self, *args, **kwargs):
|
|
373
399
|
"""Change the port the database server listens too."""
|
|
374
400
|
port, ok = QInputDialog.getInt(self, "Change database server port", "Port: ")
|
|
375
401
|
if not ok:
|
|
@@ -425,7 +451,7 @@ class MainWindow(QMainWindow):
|
|
|
425
451
|
self.refresh()
|
|
426
452
|
|
|
427
453
|
@error_on_none_db
|
|
428
|
-
def
|
|
454
|
+
def db_change_aes_cipher(self, *args, **kwargs):
|
|
429
455
|
"""Change network AES cipher."""
|
|
430
456
|
key, ok = QInputDialog.getText(self, "Change network AES cipher", "Cipher: ")
|
|
431
457
|
if not ok:
|
|
@@ -785,7 +811,7 @@ class MainWindow(QMainWindow):
|
|
|
785
811
|
|
|
786
812
|
def about_app(self):
|
|
787
813
|
"""Display a message box with Program/Author information."""
|
|
788
|
-
text = """<b><u>pytodo-qt v0.2.
|
|
814
|
+
text = """<b><u>pytodo-qt v0.2.8</u></b>
|
|
789
815
|
<br><br>To-Do list program that works with multiple To-Do
|
|
790
816
|
lists locally and over a network.
|
|
791
817
|
<br><br>License: <a href="http://www.fsf.org/licenses/gpl.html">GPLv3</a>
|
pytodo_qt/net/tcp_client_lib.py
CHANGED
|
@@ -24,7 +24,7 @@ logger = Logger(__name__)
|
|
|
24
24
|
class DatabaseClient(QObject):
|
|
25
25
|
"""To-Do database client class."""
|
|
26
26
|
|
|
27
|
-
sync_occurred = pyqtSignal(
|
|
27
|
+
sync_occurred = pyqtSignal(str)
|
|
28
28
|
|
|
29
29
|
def __init__(self):
|
|
30
30
|
"""Initialize client."""
|
|
@@ -49,6 +49,7 @@ class DatabaseClient(QObject):
|
|
|
49
49
|
"""Process remote host's response to a request."""
|
|
50
50
|
msg = f"{host} responded to {request} with {response}"
|
|
51
51
|
logger.log.info(msg)
|
|
52
|
+
self.sync_occurred.emit(msg)
|
|
52
53
|
|
|
53
54
|
if response == sync_operations["ACCEPT"].name:
|
|
54
55
|
if request == sync_operations["PULL_REQUEST"].name:
|
|
@@ -87,6 +88,7 @@ class DatabaseClient(QObject):
|
|
|
87
88
|
if not result:
|
|
88
89
|
return False, e
|
|
89
90
|
Path.unlink(tmp)
|
|
91
|
+
self.sync_occurred.emit(msg)
|
|
90
92
|
return True, msg
|
|
91
93
|
except IOError as e:
|
|
92
94
|
msg = f"Unable to write temporary file: {e}"
|
|
@@ -116,7 +118,7 @@ class DatabaseClient(QObject):
|
|
|
116
118
|
"""Synchronize database with another by pulling it from a host."""
|
|
117
119
|
logger.log.info("Performing a Sync Pull")
|
|
118
120
|
result, msg = self.synchronize(host, sync_operations["PULL_REQUEST"].name)
|
|
119
|
-
self.sync_occurred.emit(
|
|
121
|
+
self.sync_occurred.emit(f"PULL_REQUEST sent to {host}")
|
|
120
122
|
return result, msg
|
|
121
123
|
|
|
122
124
|
def sync_push(self, host):
|
|
@@ -128,4 +130,5 @@ class DatabaseClient(QObject):
|
|
|
128
130
|
"""
|
|
129
131
|
logger.log.info("Performing a Sync Push")
|
|
130
132
|
result, msg = self.synchronize(host, sync_operations["PUSH_REQUEST"].name)
|
|
133
|
+
self.sync_occurred.emit(f"PUSH_REQUEST sent to {host}")
|
|
131
134
|
return result, msg
|
pytodo_qt/net/tcp_server_lib.py
CHANGED
|
@@ -115,7 +115,7 @@ class TCPRequestHandler(socketserver.StreamRequestHandler):
|
|
|
115
115
|
sync_operations["REJECT"].name
|
|
116
116
|
)
|
|
117
117
|
self.request.send(self.encrypted_reply)
|
|
118
|
-
QMessageBox.warning(None, "Push
|
|
118
|
+
QMessageBox.warning(None, "Sync Push", msg)
|
|
119
119
|
logger.log.warning(msg)
|
|
120
120
|
return
|
|
121
121
|
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
pytodo_qt/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
-
pytodo_qt/__main__.py,sha256=
|
|
2
|
+
pytodo_qt/__main__.py,sha256=U1JjHGH6QUcRjh9lP8Sxp1BYK6CDtbBeZ9dGNQmZzBM,2850
|
|
3
3
|
pytodo_qt/core/Logger.py,sha256=93NJnJLX0NPNkt4tdSo-W-3xFBT0-kWlk3UoIiBGY1k,1655
|
|
4
4
|
pytodo_qt/core/TodoDatabase.py,sha256=yRay90KlwKraRcWNsJpP9pczCyOR8Yoj15iRqB7KoTw,8463
|
|
5
5
|
pytodo_qt/core/__init__.py,sha256=a_tV_r52RVl0GjCAdSZ399YZpnzTA04EnyHaxljY24s,901
|
|
6
6
|
pytodo_qt/core/json_helpers.py,sha256=kj3oQ2guLmqC6VPl6sdllr4yDjT1Tfi6M7esRN7iKHE,2880
|
|
7
|
-
pytodo_qt/core/settings.py,sha256=
|
|
7
|
+
pytodo_qt/core/settings.py,sha256=18slYt7JrT5mC2amtzlUyqDJRe8HYHtc08_X-SN4q_I,738
|
|
8
8
|
pytodo_qt/crypto/AESCipher.py,sha256=yufNqgebBwrzQvZoeoH_RniMKA9QfARv4MffNH2nllU,1766
|
|
9
9
|
pytodo_qt/crypto/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
10
10
|
pytodo_qt/gui/AddTodoDialog.py,sha256=ZocnEdP33R8tfaq1qELwynYFmcqHcWzSgIGTq70XJ88,2636
|
|
11
|
-
pytodo_qt/gui/MainWindow.py,sha256=
|
|
11
|
+
pytodo_qt/gui/MainWindow.py,sha256=nEAEi5UPq-eIUpbwJbeO8JKOzrHh5_-C3RhseIvf5b0,34388
|
|
12
12
|
pytodo_qt/gui/SyncDialog.py,sha256=Js6A8cMgfvMGiCbVrrsLuH9ampK-G-rsrdg6vaA4MAI,3164
|
|
13
13
|
pytodo_qt/gui/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
14
14
|
pytodo_qt/gui/icons/minus.png,sha256=PoaZl2RAW8wrkOBvz7bY03xEAdaBNd6HNKaodHbgdMc,217
|
|
@@ -16,11 +16,11 @@ pytodo_qt/gui/icons/plus.png,sha256=VywdidKhN2IdJLPkBVQB3O2GmFXzfSDMV1rLkpKDoGg,
|
|
|
16
16
|
pytodo_qt/gui/icons/pytodo-qt.png,sha256=kBRWlulLIqDxB5-XtlCz-OYhzrjyj5eEWN36nXWMYzI,659
|
|
17
17
|
pytodo_qt/net/__init__.py,sha256=jY3HhV1Lr6AoLpVUgE9_fNeMz5xV7fEliIt4rFqQZ0s,538
|
|
18
18
|
pytodo_qt/net/sync_operations.py,sha256=TSa7p-tgdd6jiwcQ1Cy3PNJw26eqRlVRrYFqLc9LNz8,279
|
|
19
|
-
pytodo_qt/net/tcp_client_lib.py,sha256=
|
|
20
|
-
pytodo_qt/net/tcp_server_lib.py,sha256=
|
|
21
|
-
pytodo_qt-0.2.
|
|
22
|
-
pytodo_qt-0.2.
|
|
23
|
-
pytodo_qt-0.2.
|
|
24
|
-
pytodo_qt-0.2.
|
|
25
|
-
pytodo_qt-0.2.
|
|
26
|
-
pytodo_qt-0.2.
|
|
19
|
+
pytodo_qt/net/tcp_client_lib.py,sha256=5Bk66_4WpT9sJLqV9-AvyhKBRCFOoQgZtWC0g_MbZpE,4846
|
|
20
|
+
pytodo_qt/net/tcp_server_lib.py,sha256=8Ml1eT81DUCmMx5fw1gAh9fwVHG6XRLyXk0VjsiFTzo,4682
|
|
21
|
+
pytodo_qt-0.2.8.dist-info/COPYING,sha256=jOtLnuWt7d5Hsx6XXB2QxzrSe2sWWh3NgMfFRetluQM,35147
|
|
22
|
+
pytodo_qt-0.2.8.dist-info/METADATA,sha256=jOEkOh3rhwY_hdGW6v9BjtTbZCGT_-LkoxhcR8CHEgg,2575
|
|
23
|
+
pytodo_qt-0.2.8.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
|
|
24
|
+
pytodo_qt-0.2.8.dist-info/entry_points.txt,sha256=iowesQoQ9xPjG4VHx-2I8nhRhTYdU5hnQw1BhzcDp-I,54
|
|
25
|
+
pytodo_qt-0.2.8.dist-info/top_level.txt,sha256=WbyuH1YqSlLNj_l8F-VQNoWyTariUw_0FrrVzAWH5nE,10
|
|
26
|
+
pytodo_qt-0.2.8.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|