pytodo-qt 0.2.4__tar.gz → 0.2.6__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.

Potentially problematic release.


This version of pytodo-qt might be problematic. Click here for more details.

Files changed (38) hide show
  1. pytodo-qt-0.2.6/PKG-INFO +81 -0
  2. pytodo-qt-0.2.6/README.md +65 -0
  3. {pytodo-qt-0.2.4 → pytodo-qt-0.2.6}/pyproject.toml +6 -6
  4. {pytodo-qt-0.2.4/src/todo → pytodo-qt-0.2.6/src/pytodo_qt}/__main__.py +9 -7
  5. {pytodo-qt-0.2.4/src/todo → pytodo-qt-0.2.6/src/pytodo_qt}/core/Logger.py +19 -5
  6. {pytodo-qt-0.2.4/src/todo → pytodo-qt-0.2.6/src/pytodo_qt}/core/TodoDatabase.py +7 -5
  7. {pytodo-qt-0.2.4/src/todo → pytodo-qt-0.2.6/src/pytodo_qt}/core/__init__.py +1 -1
  8. {pytodo-qt-0.2.4/src/todo → pytodo-qt-0.2.6/src/pytodo_qt}/core/json_helpers.py +5 -4
  9. pytodo-qt-0.2.6/src/pytodo_qt/core/settings.py +37 -0
  10. {pytodo-qt-0.2.4/src/todo → pytodo-qt-0.2.6/src/pytodo_qt}/gui/MainWindow.py +49 -19
  11. {pytodo-qt-0.2.4/src/todo → pytodo-qt-0.2.6/src/pytodo_qt}/net/tcp_client_lib.py +1 -1
  12. {pytodo-qt-0.2.4/src/todo → pytodo-qt-0.2.6/src/pytodo_qt}/net/tcp_server_lib.py +5 -6
  13. pytodo-qt-0.2.6/src/pytodo_qt.egg-info/PKG-INFO +81 -0
  14. pytodo-qt-0.2.6/src/pytodo_qt.egg-info/SOURCES.txt +29 -0
  15. pytodo-qt-0.2.6/src/pytodo_qt.egg-info/entry_points.txt +2 -0
  16. pytodo-qt-0.2.6/src/pytodo_qt.egg-info/top_level.txt +1 -0
  17. pytodo-qt-0.2.4/PKG-INFO +0 -62
  18. pytodo-qt-0.2.4/README.md +0 -46
  19. pytodo-qt-0.2.4/src/pytodo_qt.egg-info/PKG-INFO +0 -62
  20. pytodo-qt-0.2.4/src/pytodo_qt.egg-info/SOURCES.txt +0 -29
  21. pytodo-qt-0.2.4/src/pytodo_qt.egg-info/entry_points.txt +0 -2
  22. pytodo-qt-0.2.4/src/pytodo_qt.egg-info/top_level.txt +0 -1
  23. pytodo-qt-0.2.4/src/todo/core/settings.py +0 -37
  24. {pytodo-qt-0.2.4 → pytodo-qt-0.2.6}/COPYING +0 -0
  25. {pytodo-qt-0.2.4 → pytodo-qt-0.2.6}/setup.cfg +0 -0
  26. {pytodo-qt-0.2.4/src/todo → pytodo-qt-0.2.6/src/pytodo_qt}/__init__.py +0 -0
  27. {pytodo-qt-0.2.4/src/todo → pytodo-qt-0.2.6/src/pytodo_qt}/crypto/AESCipher.py +0 -0
  28. {pytodo-qt-0.2.4/src/todo → pytodo-qt-0.2.6/src/pytodo_qt}/crypto/__init__.py +0 -0
  29. {pytodo-qt-0.2.4/src/todo → pytodo-qt-0.2.6/src/pytodo_qt}/gui/AddTodoDialog.py +0 -0
  30. {pytodo-qt-0.2.4/src/todo → pytodo-qt-0.2.6/src/pytodo_qt}/gui/SyncDialog.py +0 -0
  31. {pytodo-qt-0.2.4/src/todo → pytodo-qt-0.2.6/src/pytodo_qt}/gui/__init__.py +0 -0
  32. {pytodo-qt-0.2.4/src/todo → pytodo-qt-0.2.6/src/pytodo_qt}/gui/icons/minus.png +0 -0
  33. {pytodo-qt-0.2.4/src/todo → pytodo-qt-0.2.6/src/pytodo_qt}/gui/icons/plus.png +0 -0
  34. /pytodo-qt-0.2.4/src/todo/gui/icons/todo.png → /pytodo-qt-0.2.6/src/pytodo_qt/gui/icons/pytodo-qt.png +0 -0
  35. {pytodo-qt-0.2.4/src/todo → pytodo-qt-0.2.6/src/pytodo_qt}/net/__init__.py +0 -0
  36. {pytodo-qt-0.2.4/src/todo → pytodo-qt-0.2.6/src/pytodo_qt}/net/sync_operations.py +0 -0
  37. {pytodo-qt-0.2.4 → pytodo-qt-0.2.6}/src/pytodo_qt.egg-info/dependency_links.txt +0 -0
  38. {pytodo-qt-0.2.4 → pytodo-qt-0.2.6}/src/pytodo_qt.egg-info/requires.txt +0 -0
@@ -0,0 +1,81 @@
1
+ Metadata-Version: 2.1
2
+ Name: pytodo-qt
3
+ Version: 0.2.6
4
+ Summary: A small cross-platform to-do application written in Python 3 and PyQt6
5
+ Author-email: Michael Berry <trismegustis@gmail.com>
6
+ License: GPLv3
7
+ Project-URL: Homepage, https://github.com/berrym/pytodo-qt
8
+ Classifier: Programming Language :: Python :: 3
9
+ Classifier: License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)
10
+ Classifier: Operating System :: OS Independent
11
+ Requires-Python: >=3.8
12
+ Description-Content-Type: text/markdown
13
+ License-File: COPYING
14
+ Requires-Dist: PyQt6
15
+ Requires-Dist: pycryptodomex
16
+
17
+ # pytodo-qt
18
+
19
+ A simple to-do list program.
20
+
21
+ ## Description
22
+
23
+ A small cross-platform application to manage multiple to-do lists written in Python 3 and PyQt6
24
+
25
+ ## Getting started
26
+
27
+ - Install a recent version of Python, needs **at least** version *3.8*
28
+ - For a package install you will need `pip` or `pipx`
29
+ - For a manual install you will need `git` and the python modules `setuptools`, `wheel`, `build` and `PyQt6`
30
+ You can install these via your package manager or via `pip`
31
+
32
+ ## Installation
33
+
34
+ - Install a package. **Recommended**.
35
+
36
+ It can be installed from PyPi via pip or preferably pipx, all three of these methods should work
37
+
38
+ $ pipx install pytodo-qt # for a local virtualenv install
39
+ $ pip install pytodo-qt # for a systemwide install
40
+ $ pip install --user pytodo-qt # for a user local install
41
+
42
+ - Manual install
43
+
44
+ It can be installed by cloning the git repository and building the package:
45
+
46
+ $ git clone https://github.com/berrym/pytodo-qt.git
47
+ $ cd pytodo-qt
48
+ $ python3 -m venv /path/to/pytodo-qt/venv
49
+ $ sh /path/to/pytodo-qt/venv/bin/activate # for linux/unix, activate the appropriate script for your os
50
+ $ python3 -m build
51
+ $ /path/to/pytodo-qt/venv/bin/pip install .
52
+
53
+ ### Executing program
54
+
55
+ If you installed a package then a script named `todo` was installed
56
+
57
+ $ todo # launches the application
58
+
59
+ If you followed the manual local build instructions
60
+
61
+ $ /path/to/pytodo-qt/venv/bin/todo # launches the application
62
+
63
+ ## Help
64
+
65
+ $ todo --help
66
+
67
+ ## Copyright
68
+
69
+ Copyright 2024 Michael Berry <trismegustis@gmail.com>
70
+
71
+ ## Latest release
72
+
73
+ - v0.2.5
74
+
75
+ ## License
76
+
77
+ This project is licensed under the GNU General Public License version 3, or at your option any later version.
78
+ See the COPYING file included in the git repository.
79
+
80
+ [![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)
81
+ [![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
@@ -0,0 +1,65 @@
1
+ # pytodo-qt
2
+
3
+ A simple to-do list program.
4
+
5
+ ## Description
6
+
7
+ A small cross-platform application to manage multiple to-do lists written in Python 3 and PyQt6
8
+
9
+ ## Getting started
10
+
11
+ - Install a recent version of Python, needs **at least** version *3.8*
12
+ - For a package install you will need `pip` or `pipx`
13
+ - For a manual install you will need `git` and the python modules `setuptools`, `wheel`, `build` and `PyQt6`
14
+ You can install these via your package manager or via `pip`
15
+
16
+ ## Installation
17
+
18
+ - Install a package. **Recommended**.
19
+
20
+ It can be installed from PyPi via pip or preferably pipx, all three of these methods should work
21
+
22
+ $ pipx install pytodo-qt # for a local virtualenv install
23
+ $ pip install pytodo-qt # for a systemwide install
24
+ $ pip install --user pytodo-qt # for a user local install
25
+
26
+ - Manual install
27
+
28
+ It can be installed by cloning the git repository and building the package:
29
+
30
+ $ git clone https://github.com/berrym/pytodo-qt.git
31
+ $ cd pytodo-qt
32
+ $ python3 -m venv /path/to/pytodo-qt/venv
33
+ $ sh /path/to/pytodo-qt/venv/bin/activate # for linux/unix, activate the appropriate script for your os
34
+ $ python3 -m build
35
+ $ /path/to/pytodo-qt/venv/bin/pip install .
36
+
37
+ ### Executing program
38
+
39
+ If you installed a package then a script named `todo` was installed
40
+
41
+ $ todo # launches the application
42
+
43
+ If you followed the manual local build instructions
44
+
45
+ $ /path/to/pytodo-qt/venv/bin/todo # launches the application
46
+
47
+ ## Help
48
+
49
+ $ todo --help
50
+
51
+ ## Copyright
52
+
53
+ Copyright 2024 Michael Berry <trismegustis@gmail.com>
54
+
55
+ ## Latest release
56
+
57
+ - v0.2.5
58
+
59
+ ## License
60
+
61
+ This project is licensed under the GNU General Public License version 3, or at your option any later version.
62
+ See the COPYING file included in the git repository.
63
+
64
+ [![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)
65
+ [![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
@@ -6,13 +6,13 @@ build-backend = "setuptools.build_meta"
6
6
  where = ["src"]
7
7
 
8
8
  [tool.setuptools.package-data]
9
- todo = ["*.png"]
10
- "todo.gui.icons" = ["*.png"]
9
+ pytodo_qt = ["*.png"]
10
+ "pytodo_qt.gui.icons" = ["*.png"]
11
11
 
12
12
  [project]
13
13
  name = "pytodo-qt"
14
- version = "0.2.4"
15
- description = "A simple To-Do list app written in PyQt6"
14
+ version = "0.2.6"
15
+ description = "A small cross-platform to-do application written in Python 3 and PyQt6"
16
16
  readme = "README.md"
17
17
  authors = [
18
18
  {name = "Michael Berry", email = "trismegustis@gmail.com"},
@@ -30,7 +30,7 @@ license = {text = "GPLv3"}
30
30
  requires-python = ">=3.8"
31
31
 
32
32
  [project.urls]
33
- Homepage = "https://github.com/berrym/todo"
33
+ Homepage = "https://github.com/berrym/pytodo-qt"
34
34
 
35
35
  [project.scripts]
36
- todo = "todo.__main__:main"
36
+ pytodo-qt = "pytodo_qt.__main__:main"
@@ -1,5 +1,7 @@
1
1
  """__main__.py
2
2
 
3
+ pytodo-qt
4
+
3
5
  A to-do list program written in Python using PyQt6
4
6
 
5
7
  Copyright (C) 2024 Michael Berry <trismegustis@gmail.com>
@@ -39,18 +41,18 @@ def main():
39
41
  for i in range(0, len(sys.path)):
40
42
  if sys.path[i].__contains__("site-packages"):
41
43
  location = sys.path[i]
42
- location += "/todo"
44
+ location += "/pytodo_qt"
43
45
  os.chdir(location)
44
46
  break
45
47
 
46
48
  if location == "":
47
49
  logger.log.exception("Unknown installation or invocation, exiting")
48
- sys.exit(0)
50
+ sys.exit(1)
49
51
 
50
52
  # create a command line arg_parser
51
53
  arg_parser = argparse.ArgumentParser(
52
- prog="To-Do",
53
- description="To-Do List Application written in Python with Qt6",
54
+ prog="pytodo-qt",
55
+ description="To-Do List Application written in Python 3 and PyQt6",
54
56
  epilog="Copyright Michael Berry 2024",
55
57
  )
56
58
 
@@ -73,7 +75,7 @@ def main():
73
75
  action="store",
74
76
  type=str,
75
77
  choices=["yes", "no"],
76
- help="allow remote users to grab your lists",
78
+ help="allow remote users to copy your lists",
77
79
  )
78
80
 
79
81
  server_group.add_argument(
@@ -86,14 +88,14 @@ def main():
86
88
  )
87
89
 
88
90
  server_group.add_argument(
89
- "-i", "--ip", type=str, help="set the servers ip addresses."
91
+ "-i", "--ip", type=str, help="set the database server's IP address."
90
92
  )
91
93
 
92
94
  server_group.add_argument(
93
95
  "-p",
94
96
  "--port",
95
97
  type=int,
96
- help="specify which port the network server will bind to",
98
+ help="specify which port the database server will bind to",
97
99
  )
98
100
 
99
101
  arg_parser.add_argument(
@@ -4,18 +4,32 @@ A Generic logging class.
4
4
  """
5
5
 
6
6
  import logging
7
- import os
8
7
  import sys
9
8
 
9
+ from pathlib import Path
10
10
 
11
- home_dir = os.getenv("HOME")
11
+ home_dir = Path.home()
12
12
  if home_dir is not None:
13
- todo_dir = os.path.join(home_dir, ".todo")
13
+ app_dir = Path.joinpath(home_dir, ".pytodo-qt")
14
14
  else:
15
- print("Error: unable to write log file, exiting")
15
+ print("Error: unable to get home directory, exiting")
16
16
  sys.exit(1)
17
17
 
18
- log_fn = os.path.join(todo_dir, "todo.log")
18
+ if not Path.exists(app_dir):
19
+ try:
20
+ Path.mkdir(app_dir)
21
+ except OSError as e:
22
+ print(f"Error: failed to create pytodo-qt directory {app_dir}: {e}")
23
+ sys.exit(1)
24
+
25
+ log_fn = Path.joinpath(app_dir, "pytodo-qt.log")
26
+
27
+ if not Path.exists(log_fn):
28
+ try:
29
+ log_fn.touch()
30
+ except OSError as e:
31
+ print(f"Error: failed to create pytodo-qt log file {log_fn}: {e}")
32
+ sys.exit(1)
19
33
 
20
34
 
21
35
  class Logger:
@@ -4,10 +4,11 @@ This module implements the to-do database.
4
4
  """
5
5
 
6
6
  import configparser
7
- import os
8
7
  import sys
9
8
  import threading
10
9
 
10
+ from pathlib import Path
11
+
11
12
  from PyQt6.QtCore import QObject
12
13
 
13
14
  from ..core import settings
@@ -39,7 +40,7 @@ class TodoDatabase(QObject):
39
40
 
40
41
  # create an ini config parser
41
42
  self.config = configparser.ConfigParser()
42
- if not os.path.exists(settings.ini_fn):
43
+ if not Path.exists(settings.ini_fn):
43
44
  self.write_default_config()
44
45
  self.parse_config()
45
46
 
@@ -65,7 +66,7 @@ class TodoDatabase(QObject):
65
66
  self.config["server"] = {}
66
67
  self.config["server"]["key"] = "BewareTheBlackGuardian"
67
68
  self.config["server"]["run"] = "yes"
68
- self.config["server"]["address"] = "127.0.0.1"
69
+ self.config["server"]["address"] = "0.0.0.0"
69
70
  self.config["server"]["port"] = "5364"
70
71
  self.config["server"]["pull"] = "yes"
71
72
  self.config["server"]["push"] = "yes"
@@ -86,6 +87,7 @@ class TodoDatabase(QObject):
86
87
  self.config["database"]["reverse_sort"] = "yes"
87
88
  else:
88
89
  self.config["database"]["reverse_sort"] = "no"
90
+ self.config["server"]["key"] = settings.options["key"]
89
91
  if settings.options["run"]:
90
92
  self.config["server"]["run"] = "yes"
91
93
  else:
@@ -155,14 +157,14 @@ class TodoDatabase(QObject):
155
157
  if fn is None:
156
158
  return
157
159
 
158
- logger.log.info("Writing todo list to file %s", fn)
160
+ logger.log.info("Writing pytodo-qt list to file %s", fn)
159
161
  try:
160
162
  with open(fn, "w", encoding="utf-8") as f:
161
163
  f.write(f"{self.active_list:*^60}\n\n")
162
164
  for todo in self.todo_lists[self.active_list]:
163
165
  f.write(f'{todo["reminder"]}\n')
164
166
  except IOError as e:
165
- logger.log.exception("Unable to write todo list to %s: %s", fn, e)
167
+ logger.log.exception("Unable to write pytodo-qt list to %s: %s", fn, e)
166
168
 
167
169
  def server_running(self):
168
170
  """Determine if the server is running"""
@@ -1,6 +1,6 @@
1
1
  """__init__.py
2
2
 
3
- todo.core: A decorator to make security checks on the to-do database.
3
+ pytodo-qt.core: A decorator to make security checks on the to-do database.
4
4
  """
5
5
 
6
6
  import sys
@@ -1,7 +1,8 @@
1
1
  import json
2
- import os
3
2
  import sys
4
3
 
4
+ from pathlib import Path
5
+
5
6
  from ..core import error_on_none_db, settings
6
7
  from ..core.Logger import Logger
7
8
 
@@ -21,9 +22,9 @@ def merge_todo_lists(*todo_lists):
21
22
 
22
23
 
23
24
  @error_on_none_db
24
- def read_json_data(fn=settings.lists_fn):
25
+ def read_json_data(fn=settings.db_fn):
25
26
  """Read in to-do lists from a JSON file."""
26
- if not os.path.exists(fn):
27
+ if not Path.exists(fn):
27
28
  msg = f"JSON file {fn} does not exist"
28
29
  logger.log.warning(msg)
29
30
  return False, msg
@@ -69,7 +70,7 @@ def read_json_data(fn=settings.lists_fn):
69
70
 
70
71
 
71
72
  @error_on_none_db
72
- def write_json_data(fn=settings.lists_fn):
73
+ def write_json_data(fn=settings.db_fn):
73
74
  """Write to-do lists as a JSON file."""
74
75
  logger.log.info("Writing JSON file %s", fn)
75
76
  try:
@@ -0,0 +1,37 @@
1
+ """settings.py
2
+
3
+ This module creates To-Do core global variables and functions.
4
+ """
5
+
6
+ import sys
7
+
8
+ from pathlib import Path
9
+
10
+ from ..core.Logger import Logger
11
+
12
+
13
+ logger = Logger(__name__)
14
+
15
+
16
+ __version__ = "0.2.6"
17
+ options = {}
18
+ DB = None
19
+
20
+ home_dir = Path.home()
21
+ if home_dir is not None:
22
+ app_dir = Path.joinpath(home_dir, ".pytodo-qt")
23
+ else:
24
+ logger.log.exception("Unable to get home directory, exiting")
25
+ sys.exit(1)
26
+
27
+ if not Path.exists(app_dir):
28
+ try:
29
+ Path.mkdir(app_dir)
30
+ except OSError as e:
31
+ logger.log.exception("Error creating pytodo-qt configuration directory: %s", e)
32
+ sys.exit(1)
33
+
34
+
35
+ # private files
36
+ ini_fn = Path.joinpath(app_dir, "pytodo-qt.ini")
37
+ db_fn = Path.joinpath(app_dir, "pytodo-qt-db.json")
@@ -3,7 +3,6 @@
3
3
  This module implements the GUI for To-Do.
4
4
  """
5
5
 
6
- import os
7
6
  import sys
8
7
 
9
8
  from pathlib import Path
@@ -28,6 +27,7 @@ from PyQt6.QtPrintSupport import QPrinter, QPrintDialog
28
27
 
29
28
  from ..core import error_on_none_db, settings, json_helpers
30
29
  from ..core.Logger import Logger
30
+ from ..crypto.AESCipher import AESCipher
31
31
  from ..gui.AddTodoDialog import AddTodoDialog
32
32
  from ..gui.SyncDialog import SyncDialog
33
33
  from ..net.sync_operations import sync_operations
@@ -49,7 +49,7 @@ 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/todo.png"))
52
+ self.setWindowIcon(QIcon("gui/icons/pytodo-qt.png"))
53
53
  self.setWindowTitle("To-Do")
54
54
  self.setToolTip("Python3 + Qt5 = Happy <u>To-Do</u> Programmer!")
55
55
  QToolTip.setFont(QFont("Helvetica", 10))
@@ -68,7 +68,7 @@ class MainWindow(QMainWindow):
68
68
  # create some actions
69
69
  printer = QAction(QIcon(), "Print", self)
70
70
  printer.setShortcut("Ctrl+P")
71
- printer.triggered.connect(self.printlist)
71
+ printer.triggered.connect(self.print_list)
72
72
 
73
73
  _quit = QAction(QIcon(), "Exit", self)
74
74
  _quit.setShortcut("Ctrl+Q")
@@ -83,12 +83,12 @@ class MainWindow(QMainWindow):
83
83
  delete.setShortcut("-")
84
84
  delete.triggered.connect(self.delete_todo)
85
85
 
86
- toggle = QAction(QIcon("gui/icons/todo.png"), "Toggle to-do Status", self)
86
+ toggle = QAction(QIcon("gui/icons/pytodo-qt.png"), "Toggle to-do Status", self)
87
87
  toggle.setShortcut("%")
88
88
  toggle.triggered.connect(self.toggle_todo)
89
89
 
90
90
  # list actions
91
- list_add = QAction(QIcon(), "Add new list", self)
91
+ list_add = QAction(QIcon("gui/icons/plus.png"), "Add new list", self)
92
92
  list_add.setShortcut("Ctrl++")
93
93
  list_add.triggered.connect(self.add_list)
94
94
 
@@ -126,9 +126,12 @@ class MainWindow(QMainWindow):
126
126
  change_bind_address = QAction(QIcon(), "Change network server address", self)
127
127
  change_bind_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)
131
+
129
132
  # fanfare
130
133
  about = QAction(QIcon(), "About To-Do", self)
131
- about.triggered.connect(self.about_todo)
134
+ about.triggered.connect(self.about_app)
132
135
 
133
136
  about_qt = QAction(QIcon(), "About Qt", self)
134
137
  about_qt.triggered.connect(self.about_qt)
@@ -184,6 +187,7 @@ class MainWindow(QMainWindow):
184
187
  server_menu.addAction(stop_server)
185
188
  server_menu.addAction(change_port)
186
189
  server_menu.addAction(change_bind_address)
190
+ server_menu.addAction(change_crypto_key)
187
191
  else:
188
192
  msg = "Could not populate server menu, exiting"
189
193
  QMessageBox.warning(self, "Creation Error", msg)
@@ -245,10 +249,11 @@ class MainWindow(QMainWindow):
245
249
  QMessageBox.critical(self, "Creation Error", msg)
246
250
  logger.log.exception(msg)
247
251
  sys.exit(1)
252
+ self.update_status_bar()
248
253
 
249
254
  # system tray icon
250
255
  self.tray_icon = QSystemTrayIcon(self)
251
- self.tray_icon.setIcon(QIcon("gui/icons/todo.png"))
256
+ self.tray_icon.setIcon(QIcon("gui/icons/pytodo-qt.png"))
252
257
 
253
258
  # system tray menu actions
254
259
  show_action = QAction("Show", self)
@@ -287,7 +292,7 @@ class MainWindow(QMainWindow):
287
292
 
288
293
  def read_todo_data(self):
289
294
  """Read lists of to-dos from database."""
290
- if os.path.exists(settings.lists_fn):
295
+ if Path.exists(settings.db_fn):
291
296
  self.update_progress_bar(0)
292
297
  self.update_status_bar("Reading in JSON data")
293
298
  result, msg = json_helpers.read_json_data()
@@ -304,8 +309,7 @@ class MainWindow(QMainWindow):
304
309
  def write_todo_data(self, *args, **kwargs):
305
310
  """Write to-do lists to a JSON file."""
306
311
  if len(settings.DB.todo_lists.keys()) == 0:
307
- msg = "No to-do information, aborting write"
308
- QMessageBox.warning(self, "Write Error", msg)
312
+ logger.log.info("No to-do information, aborting write")
309
313
  return
310
314
 
311
315
  self.update_progress_bar(0)
@@ -395,7 +399,7 @@ class MainWindow(QMainWindow):
395
399
  def db_server_bind_address(self, *args, **kwargs):
396
400
  """Bind database server to an ip address."""
397
401
  address, ok = QInputDialog.getText(
398
- self, "Change server ip address", "IP Address: "
402
+ self, "Change server IP address", "IP Address: "
399
403
  )
400
404
  if not ok:
401
405
  return
@@ -420,6 +424,33 @@ class MainWindow(QMainWindow):
420
424
  settings.DB.write_config()
421
425
  self.refresh()
422
426
 
427
+ @error_on_none_db
428
+ def db_change_crypto_key(self, *args, **kwargs):
429
+ """Change network AES cipher."""
430
+ key, ok = QInputDialog.getText(self, "Change network AES cipher", "Cipher: ")
431
+ if not ok:
432
+ return
433
+
434
+ if settings.options["key"] == key:
435
+ QMessageBox.information(self, "Info", f"AES cipher is already {key}")
436
+ return
437
+
438
+ settings.options["key"] = key
439
+ settings.DB.db_client.aes_cipher = AESCipher(key)
440
+ settings.DB.db_server.aes_cipher = AESCipher(key)
441
+ if settings.DB.server_running():
442
+ reply = QMessageBox.question(
443
+ self,
444
+ "Restart Database Server?",
445
+ "The server needs to be restarted for changes to take effect, would you like to do that now?",
446
+ QMessageBox.StandardButton.Yes,
447
+ QMessageBox.StandardButton.No,
448
+ )
449
+ if reply == QMessageBox.StandardButton.Yes:
450
+ settings.DB.restart_server()
451
+ settings.DB.write_config()
452
+ self.refresh()
453
+
423
454
  @error_on_none_db
424
455
  def add_list(self, *args, **kwargs):
425
456
  """Add a new list of to-dos."""
@@ -575,7 +606,6 @@ class MainWindow(QMainWindow):
575
606
 
576
607
  if not ok:
577
608
  msg = "Did not finishing exporting list"
578
- QMessageBox.warning(self, "Export List", msg)
579
609
  logger.log.warning(msg)
580
610
  return
581
611
 
@@ -592,7 +622,7 @@ class MainWindow(QMainWindow):
592
622
  self.update_status_bar(msg)
593
623
  self.update_progress_bar()
594
624
 
595
- def printlist(self):
625
+ def print_list(self):
596
626
  """Print the active list."""
597
627
  self.update_progress_bar(0)
598
628
 
@@ -601,7 +631,7 @@ class MainWindow(QMainWindow):
601
631
  self.update_progress_bar()
602
632
  return
603
633
 
604
- tmp_fn = Path.home().joinpath(settings.todo_dir, ".todo_printer.tmp")
634
+ tmp_fn = Path.home().joinpath(settings.app_dir, ".todo_printer.tmp")
605
635
 
606
636
  accept = QPrintDialog(self.printer).exec()
607
637
  if accept:
@@ -628,7 +658,7 @@ class MainWindow(QMainWindow):
628
658
  doc = QTextDocument(string)
629
659
  doc.print(self.printer)
630
660
 
631
- msg = "Finished printing todo list"
661
+ msg = "Finished printing pytodo-qt list"
632
662
  QMessageBox.information(self, "Print List", msg)
633
663
  logger.log.info(msg)
634
664
  self.update_progress_bar()
@@ -753,9 +783,9 @@ class MainWindow(QMainWindow):
753
783
  ] = new_text
754
784
  self.write_todo_data()
755
785
 
756
- def about_todo(self):
786
+ def about_app(self):
757
787
  """Display a message box with Program/Author information."""
758
- text = """<b><u>To-Do v0.2.4</u></b>
788
+ text = """<b><u>pytodo-qt v0.2.6</u></b>
759
789
  <br><br>To-Do list program that works with multiple To-Do
760
790
  lists locally and over a network.
761
791
  <br><br>License: <a href="http://www.fsf.org/licenses/gpl.html">GPLv3</a>
@@ -779,7 +809,7 @@ class MainWindow(QMainWindow):
779
809
  """Update the progress bar.
780
810
 
781
811
  Maximum value should be set to the total to-do count,
782
- while value should be the number of completed todos.
812
+ while value should be the number of completed to-dos.
783
813
  This makes the progress bar show the total percentage
784
814
  of completed to-dos.
785
815
  """
@@ -819,7 +849,7 @@ class MainWindow(QMainWindow):
819
849
  def refresh(self, sync_occurred=0, *args, **kwargs):
820
850
  """Redraw the table and update the progress and status bars."""
821
851
  if sync_occurred:
822
- logger.log.info("Sync operation occurred, refresh todo list")
852
+ logger.log.info("Sync operation occurred, refresh pytodo-qt list")
823
853
 
824
854
  self.update_status_bar("Redrawing table")
825
855
 
@@ -77,7 +77,7 @@ class DatabaseClient(QObject):
77
77
  return False, e
78
78
 
79
79
  # write data to a temporary file, then read it in
80
- tmp = Path.joinpath(settings.todo_dir, ".todo_lists.tmp")
80
+ tmp = Path.joinpath(settings.app_dir, ".todo_lists.tmp")
81
81
  try:
82
82
  with open(tmp, "w", encoding="utf-8") as f:
83
83
  f.write(deserialized)
@@ -4,11 +4,12 @@ This module implements a threaded tcp socket server and request handler for To-D
4
4
  """
5
5
 
6
6
  import json
7
- import os
8
7
  import socketserver
9
8
  import sys
10
9
  import time
11
10
 
11
+ from pathlib import Path
12
+
12
13
  from PyQt6.QtWidgets import QMessageBox
13
14
 
14
15
  from ..core import error_on_none_db, settings
@@ -67,11 +68,9 @@ class TCPRequestHandler(socketserver.StreamRequestHandler):
67
68
  self.request.send(self.encrypted_reply)
68
69
  return
69
70
 
70
- if os.path.exists(settings.lists_fn):
71
- self.data = ""
72
- with open(settings.lists_fn, encoding="utf-8") as f:
73
- for line in f:
74
- self.data += line
71
+ if Path.exists(settings.db_fn):
72
+ with settings.db_fn.open(mode="r", encoding="utf-8") as db_file:
73
+ self.data = db_file.read()
75
74
 
76
75
  if self.data is not None:
77
76
  logger.log.info("PULL_REQUEST ACCEPTED")
@@ -0,0 +1,81 @@
1
+ Metadata-Version: 2.1
2
+ Name: pytodo-qt
3
+ Version: 0.2.6
4
+ Summary: A small cross-platform to-do application written in Python 3 and PyQt6
5
+ Author-email: Michael Berry <trismegustis@gmail.com>
6
+ License: GPLv3
7
+ Project-URL: Homepage, https://github.com/berrym/pytodo-qt
8
+ Classifier: Programming Language :: Python :: 3
9
+ Classifier: License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)
10
+ Classifier: Operating System :: OS Independent
11
+ Requires-Python: >=3.8
12
+ Description-Content-Type: text/markdown
13
+ License-File: COPYING
14
+ Requires-Dist: PyQt6
15
+ Requires-Dist: pycryptodomex
16
+
17
+ # pytodo-qt
18
+
19
+ A simple to-do list program.
20
+
21
+ ## Description
22
+
23
+ A small cross-platform application to manage multiple to-do lists written in Python 3 and PyQt6
24
+
25
+ ## Getting started
26
+
27
+ - Install a recent version of Python, needs **at least** version *3.8*
28
+ - For a package install you will need `pip` or `pipx`
29
+ - For a manual install you will need `git` and the python modules `setuptools`, `wheel`, `build` and `PyQt6`
30
+ You can install these via your package manager or via `pip`
31
+
32
+ ## Installation
33
+
34
+ - Install a package. **Recommended**.
35
+
36
+ It can be installed from PyPi via pip or preferably pipx, all three of these methods should work
37
+
38
+ $ pipx install pytodo-qt # for a local virtualenv install
39
+ $ pip install pytodo-qt # for a systemwide install
40
+ $ pip install --user pytodo-qt # for a user local install
41
+
42
+ - Manual install
43
+
44
+ It can be installed by cloning the git repository and building the package:
45
+
46
+ $ git clone https://github.com/berrym/pytodo-qt.git
47
+ $ cd pytodo-qt
48
+ $ python3 -m venv /path/to/pytodo-qt/venv
49
+ $ sh /path/to/pytodo-qt/venv/bin/activate # for linux/unix, activate the appropriate script for your os
50
+ $ python3 -m build
51
+ $ /path/to/pytodo-qt/venv/bin/pip install .
52
+
53
+ ### Executing program
54
+
55
+ If you installed a package then a script named `todo` was installed
56
+
57
+ $ todo # launches the application
58
+
59
+ If you followed the manual local build instructions
60
+
61
+ $ /path/to/pytodo-qt/venv/bin/todo # launches the application
62
+
63
+ ## Help
64
+
65
+ $ todo --help
66
+
67
+ ## Copyright
68
+
69
+ Copyright 2024 Michael Berry <trismegustis@gmail.com>
70
+
71
+ ## Latest release
72
+
73
+ - v0.2.5
74
+
75
+ ## License
76
+
77
+ This project is licensed under the GNU General Public License version 3, or at your option any later version.
78
+ See the COPYING file included in the git repository.
79
+
80
+ [![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)
81
+ [![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
@@ -0,0 +1,29 @@
1
+ COPYING
2
+ README.md
3
+ pyproject.toml
4
+ src/pytodo_qt/__init__.py
5
+ src/pytodo_qt/__main__.py
6
+ src/pytodo_qt.egg-info/PKG-INFO
7
+ src/pytodo_qt.egg-info/SOURCES.txt
8
+ src/pytodo_qt.egg-info/dependency_links.txt
9
+ src/pytodo_qt.egg-info/entry_points.txt
10
+ src/pytodo_qt.egg-info/requires.txt
11
+ src/pytodo_qt.egg-info/top_level.txt
12
+ src/pytodo_qt/core/Logger.py
13
+ src/pytodo_qt/core/TodoDatabase.py
14
+ src/pytodo_qt/core/__init__.py
15
+ src/pytodo_qt/core/json_helpers.py
16
+ src/pytodo_qt/core/settings.py
17
+ src/pytodo_qt/crypto/AESCipher.py
18
+ src/pytodo_qt/crypto/__init__.py
19
+ src/pytodo_qt/gui/AddTodoDialog.py
20
+ src/pytodo_qt/gui/MainWindow.py
21
+ src/pytodo_qt/gui/SyncDialog.py
22
+ src/pytodo_qt/gui/__init__.py
23
+ src/pytodo_qt/gui/icons/minus.png
24
+ src/pytodo_qt/gui/icons/plus.png
25
+ src/pytodo_qt/gui/icons/pytodo-qt.png
26
+ src/pytodo_qt/net/__init__.py
27
+ src/pytodo_qt/net/sync_operations.py
28
+ src/pytodo_qt/net/tcp_client_lib.py
29
+ src/pytodo_qt/net/tcp_server_lib.py
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ pytodo-qt = pytodo_qt.__main__:main
@@ -0,0 +1 @@
1
+ pytodo_qt
pytodo-qt-0.2.4/PKG-INFO DELETED
@@ -1,62 +0,0 @@
1
- Metadata-Version: 2.1
2
- Name: pytodo-qt
3
- Version: 0.2.4
4
- Summary: A simple To-Do list app written in PyQt6
5
- Author-email: Michael Berry <trismegustis@gmail.com>
6
- License: GPLv3
7
- Project-URL: Homepage, https://github.com/berrym/todo
8
- Classifier: Programming Language :: Python :: 3
9
- Classifier: License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)
10
- Classifier: Operating System :: OS Independent
11
- Requires-Python: >=3.8
12
- Description-Content-Type: text/markdown
13
- License-File: COPYING
14
- Requires-Dist: PyQt6
15
- Requires-Dist: pycryptodomex
16
-
17
- # To-Do
18
-
19
- A simple to-do list program.
20
-
21
- ## Description
22
-
23
- A small application to manage multiple to-do lists written in Python 3 and Qt5
24
-
25
- ## Getting started
26
-
27
- * Clone the git repository from https://github.com/berrym/todo.git
28
-
29
- * Install a recent version of Python, needs version 3.8+.
30
-
31
- * A requirements.txt is provided in the repository so required packages can be installed using pip.
32
- * pip install -r requirements.txt --user
33
-
34
- ### Executing program
35
-
36
- The main script can be executed from the command line, e.g.
37
-
38
- * python3 todo.py
39
-
40
- ## Help
41
-
42
- python3 todo.py --help
43
-
44
- ## Authors
45
-
46
- Copyright 2020
47
- Michael Berry <trismegustis@gmail.com>
48
-
49
- ## Version History
50
- * 0.1.1
51
- * Needs Python 3.8 for walrus operator.
52
- * Improved dialogs for syncing.
53
- * Serialize network I/O with json.
54
-
55
- * 0.1.0
56
- * Initial Release
57
-
58
- ## License
59
-
60
- This project is licensed under the GNU General Public License version 3, or at your option any later version.
61
-
62
- See the COPYING file included in the git repository.
pytodo-qt-0.2.4/README.md DELETED
@@ -1,46 +0,0 @@
1
- # To-Do
2
-
3
- A simple to-do list program.
4
-
5
- ## Description
6
-
7
- A small application to manage multiple to-do lists written in Python 3 and Qt5
8
-
9
- ## Getting started
10
-
11
- * Clone the git repository from https://github.com/berrym/todo.git
12
-
13
- * Install a recent version of Python, needs version 3.8+.
14
-
15
- * A requirements.txt is provided in the repository so required packages can be installed using pip.
16
- * pip install -r requirements.txt --user
17
-
18
- ### Executing program
19
-
20
- The main script can be executed from the command line, e.g.
21
-
22
- * python3 todo.py
23
-
24
- ## Help
25
-
26
- python3 todo.py --help
27
-
28
- ## Authors
29
-
30
- Copyright 2020
31
- Michael Berry <trismegustis@gmail.com>
32
-
33
- ## Version History
34
- * 0.1.1
35
- * Needs Python 3.8 for walrus operator.
36
- * Improved dialogs for syncing.
37
- * Serialize network I/O with json.
38
-
39
- * 0.1.0
40
- * Initial Release
41
-
42
- ## License
43
-
44
- This project is licensed under the GNU General Public License version 3, or at your option any later version.
45
-
46
- See the COPYING file included in the git repository.
@@ -1,62 +0,0 @@
1
- Metadata-Version: 2.1
2
- Name: pytodo-qt
3
- Version: 0.2.4
4
- Summary: A simple To-Do list app written in PyQt6
5
- Author-email: Michael Berry <trismegustis@gmail.com>
6
- License: GPLv3
7
- Project-URL: Homepage, https://github.com/berrym/todo
8
- Classifier: Programming Language :: Python :: 3
9
- Classifier: License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)
10
- Classifier: Operating System :: OS Independent
11
- Requires-Python: >=3.8
12
- Description-Content-Type: text/markdown
13
- License-File: COPYING
14
- Requires-Dist: PyQt6
15
- Requires-Dist: pycryptodomex
16
-
17
- # To-Do
18
-
19
- A simple to-do list program.
20
-
21
- ## Description
22
-
23
- A small application to manage multiple to-do lists written in Python 3 and Qt5
24
-
25
- ## Getting started
26
-
27
- * Clone the git repository from https://github.com/berrym/todo.git
28
-
29
- * Install a recent version of Python, needs version 3.8+.
30
-
31
- * A requirements.txt is provided in the repository so required packages can be installed using pip.
32
- * pip install -r requirements.txt --user
33
-
34
- ### Executing program
35
-
36
- The main script can be executed from the command line, e.g.
37
-
38
- * python3 todo.py
39
-
40
- ## Help
41
-
42
- python3 todo.py --help
43
-
44
- ## Authors
45
-
46
- Copyright 2020
47
- Michael Berry <trismegustis@gmail.com>
48
-
49
- ## Version History
50
- * 0.1.1
51
- * Needs Python 3.8 for walrus operator.
52
- * Improved dialogs for syncing.
53
- * Serialize network I/O with json.
54
-
55
- * 0.1.0
56
- * Initial Release
57
-
58
- ## License
59
-
60
- This project is licensed under the GNU General Public License version 3, or at your option any later version.
61
-
62
- See the COPYING file included in the git repository.
@@ -1,29 +0,0 @@
1
- COPYING
2
- README.md
3
- pyproject.toml
4
- src/pytodo_qt.egg-info/PKG-INFO
5
- src/pytodo_qt.egg-info/SOURCES.txt
6
- src/pytodo_qt.egg-info/dependency_links.txt
7
- src/pytodo_qt.egg-info/entry_points.txt
8
- src/pytodo_qt.egg-info/requires.txt
9
- src/pytodo_qt.egg-info/top_level.txt
10
- src/todo/__init__.py
11
- src/todo/__main__.py
12
- src/todo/core/Logger.py
13
- src/todo/core/TodoDatabase.py
14
- src/todo/core/__init__.py
15
- src/todo/core/json_helpers.py
16
- src/todo/core/settings.py
17
- src/todo/crypto/AESCipher.py
18
- src/todo/crypto/__init__.py
19
- src/todo/gui/AddTodoDialog.py
20
- src/todo/gui/MainWindow.py
21
- src/todo/gui/SyncDialog.py
22
- src/todo/gui/__init__.py
23
- src/todo/gui/icons/minus.png
24
- src/todo/gui/icons/plus.png
25
- src/todo/gui/icons/todo.png
26
- src/todo/net/__init__.py
27
- src/todo/net/sync_operations.py
28
- src/todo/net/tcp_client_lib.py
29
- src/todo/net/tcp_server_lib.py
@@ -1,2 +0,0 @@
1
- [console_scripts]
2
- todo = todo.__main__:main
@@ -1 +0,0 @@
1
- todo
@@ -1,37 +0,0 @@
1
- """settings.py
2
-
3
- This module creates To-Do core global variables and functions.
4
- """
5
-
6
- import sys
7
-
8
- from pathlib import Path
9
-
10
- from ..core.Logger import Logger
11
-
12
-
13
- logger = Logger(__name__)
14
-
15
-
16
- __version__ = "0.2.4"
17
- options = {}
18
- DB = None
19
-
20
- home_dir = Path.home()
21
- if home_dir is not None:
22
- todo_dir = Path.joinpath(home_dir, ".todo")
23
- else:
24
- logger.log.exception("Unable to write log file, exiting")
25
- sys.exit(1)
26
-
27
- if not Path.exists(todo_dir):
28
- try:
29
- Path.mkdir(todo_dir)
30
- except OSError as e:
31
- logger.log.exception("Error creating To-Do configuration directory: %s", e)
32
- sys.exit(1)
33
-
34
-
35
- # private files
36
- ini_fn = Path.joinpath(todo_dir, "todo.ini")
37
- lists_fn = Path.joinpath(todo_dir, "todo_lists.json")
File without changes
File without changes