pytodo-qt 0.2.6__tar.gz → 0.2.8__tar.gz

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.
Files changed (32) hide show
  1. {pytodo-qt-0.2.6/src/pytodo_qt.egg-info → pytodo-qt-0.2.8}/PKG-INFO +1 -1
  2. {pytodo-qt-0.2.6 → pytodo-qt-0.2.8}/pyproject.toml +1 -1
  3. pytodo-qt-0.2.8/setup.py +3 -0
  4. {pytodo-qt-0.2.6 → pytodo-qt-0.2.8}/src/pytodo_qt/__main__.py +2 -11
  5. {pytodo-qt-0.2.6 → pytodo-qt-0.2.8}/src/pytodo_qt/core/settings.py +1 -1
  6. {pytodo-qt-0.2.6 → pytodo-qt-0.2.8}/src/pytodo_qt/gui/MainWindow.py +43 -17
  7. {pytodo-qt-0.2.6 → pytodo-qt-0.2.8}/src/pytodo_qt/net/tcp_client_lib.py +5 -2
  8. {pytodo-qt-0.2.6 → pytodo-qt-0.2.8}/src/pytodo_qt/net/tcp_server_lib.py +1 -1
  9. {pytodo-qt-0.2.6 → pytodo-qt-0.2.8/src/pytodo_qt.egg-info}/PKG-INFO +1 -1
  10. {pytodo-qt-0.2.6 → pytodo-qt-0.2.8}/src/pytodo_qt.egg-info/SOURCES.txt +1 -0
  11. {pytodo-qt-0.2.6 → pytodo-qt-0.2.8}/COPYING +0 -0
  12. {pytodo-qt-0.2.6 → pytodo-qt-0.2.8}/README.md +0 -0
  13. {pytodo-qt-0.2.6 → pytodo-qt-0.2.8}/setup.cfg +0 -0
  14. {pytodo-qt-0.2.6 → pytodo-qt-0.2.8}/src/pytodo_qt/__init__.py +0 -0
  15. {pytodo-qt-0.2.6 → pytodo-qt-0.2.8}/src/pytodo_qt/core/Logger.py +0 -0
  16. {pytodo-qt-0.2.6 → pytodo-qt-0.2.8}/src/pytodo_qt/core/TodoDatabase.py +0 -0
  17. {pytodo-qt-0.2.6 → pytodo-qt-0.2.8}/src/pytodo_qt/core/__init__.py +0 -0
  18. {pytodo-qt-0.2.6 → pytodo-qt-0.2.8}/src/pytodo_qt/core/json_helpers.py +0 -0
  19. {pytodo-qt-0.2.6 → pytodo-qt-0.2.8}/src/pytodo_qt/crypto/AESCipher.py +0 -0
  20. {pytodo-qt-0.2.6 → pytodo-qt-0.2.8}/src/pytodo_qt/crypto/__init__.py +0 -0
  21. {pytodo-qt-0.2.6 → pytodo-qt-0.2.8}/src/pytodo_qt/gui/AddTodoDialog.py +0 -0
  22. {pytodo-qt-0.2.6 → pytodo-qt-0.2.8}/src/pytodo_qt/gui/SyncDialog.py +0 -0
  23. {pytodo-qt-0.2.6 → pytodo-qt-0.2.8}/src/pytodo_qt/gui/__init__.py +0 -0
  24. {pytodo-qt-0.2.6 → pytodo-qt-0.2.8}/src/pytodo_qt/gui/icons/minus.png +0 -0
  25. {pytodo-qt-0.2.6 → pytodo-qt-0.2.8}/src/pytodo_qt/gui/icons/plus.png +0 -0
  26. {pytodo-qt-0.2.6 → pytodo-qt-0.2.8}/src/pytodo_qt/gui/icons/pytodo-qt.png +0 -0
  27. {pytodo-qt-0.2.6 → pytodo-qt-0.2.8}/src/pytodo_qt/net/__init__.py +0 -0
  28. {pytodo-qt-0.2.6 → pytodo-qt-0.2.8}/src/pytodo_qt/net/sync_operations.py +0 -0
  29. {pytodo-qt-0.2.6 → pytodo-qt-0.2.8}/src/pytodo_qt.egg-info/dependency_links.txt +0 -0
  30. {pytodo-qt-0.2.6 → pytodo-qt-0.2.8}/src/pytodo_qt.egg-info/entry_points.txt +0 -0
  31. {pytodo-qt-0.2.6 → pytodo-qt-0.2.8}/src/pytodo_qt.egg-info/requires.txt +0 -0
  32. {pytodo-qt-0.2.6 → pytodo-qt-0.2.8}/src/pytodo_qt.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pytodo-qt
3
- Version: 0.2.6
3
+ Version: 0.2.8
4
4
  Summary: A small cross-platform to-do application written in Python 3 and PyQt6
5
5
  Author-email: Michael Berry <trismegustis@gmail.com>
6
6
  License: GPLv3
@@ -11,7 +11,7 @@ pytodo_qt = ["*.png"]
11
11
 
12
12
  [project]
13
13
  name = "pytodo-qt"
14
- version = "0.2.6"
14
+ version = "0.2.8"
15
15
  description = "A small cross-platform to-do application written in Python 3 and PyQt6"
16
16
  readme = "README.md"
17
17
  authors = [
@@ -0,0 +1,3 @@
1
+ from setuptools import setup
2
+
3
+ setup()
@@ -37,17 +37,8 @@ logger = Logger(__name__)
37
37
 
38
38
  # Main function
39
39
  def main():
40
- location = ""
41
- for i in range(0, len(sys.path)):
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(
@@ -13,7 +13,7 @@ from ..core.Logger import Logger
13
13
  logger = Logger(__name__)
14
14
 
15
15
 
16
- __version__ = "0.2.6"
16
+ __version__ = "0.2.8"
17
17
  options = {}
18
18
  DB = None
19
19
 
@@ -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.db_server_port)
124
+ change_port.triggered.connect(self.db_server_bind_port)
125
125
 
126
- change_bind_address = QAction(QIcon(), "Change network server address", self)
127
- change_bind_address.triggered.connect(self.db_server_bind_address)
126
+ change_address = QAction(QIcon(), "Change network server address", self)
127
+ change_address.triggered.connect(self.db_server_bind_address)
128
128
 
129
- change_crypto_key = QAction(QIcon(), "Change network AES cipher", self)
130
- change_crypto_key.triggered.connect(self.db_change_crypto_key)
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(change_bind_address)
190
- server_menu.addAction(change_crypto_key)
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.refresh)
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("Waiting for input")
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
- QMessageBox.information(
356
- self, "Info", "The database server is already running."
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
- QMessageBox.information(self, "Info", "The database server was started.")
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
- QMessageBox.information(self, "Info", "The database server was stopped.")
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 db_server_port(self, *args, **kwargs):
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 db_change_crypto_key(self, *args, **kwargs):
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.6</u></b>
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>
@@ -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(int)
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(1)
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
@@ -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 Sync", msg)
118
+ QMessageBox.warning(None, "Sync Push", msg)
119
119
  logger.log.warning(msg)
120
120
  return
121
121
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pytodo-qt
3
- Version: 0.2.6
3
+ Version: 0.2.8
4
4
  Summary: A small cross-platform to-do application written in Python 3 and PyQt6
5
5
  Author-email: Michael Berry <trismegustis@gmail.com>
6
6
  License: GPLv3
@@ -1,6 +1,7 @@
1
1
  COPYING
2
2
  README.md
3
3
  pyproject.toml
4
+ setup.py
4
5
  src/pytodo_qt/__init__.py
5
6
  src/pytodo_qt/__main__.py
6
7
  src/pytodo_qt.egg-info/PKG-INFO
File without changes
File without changes
File without changes