znote 1.1.0__tar.gz → 1.2.0__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 (30) hide show
  1. {znote-1.1.0/znote.egg-info → znote-1.2.0}/PKG-INFO +1 -1
  2. {znote-1.1.0 → znote-1.2.0}/znote/core/client/settings.py +14 -6
  3. {znote-1.1.0 → znote-1.2.0}/znote/core/server/settings.py +10 -7
  4. {znote-1.1.0 → znote-1.2.0/znote.egg-info}/PKG-INFO +1 -1
  5. {znote-1.1.0 → znote-1.2.0}/LICENSE +0 -0
  6. {znote-1.1.0 → znote-1.2.0}/README.md +0 -0
  7. {znote-1.1.0 → znote-1.2.0}/setup.cfg +0 -0
  8. {znote-1.1.0 → znote-1.2.0}/znote/__init__.py +0 -0
  9. {znote-1.1.0 → znote-1.2.0}/znote/app/display.py +0 -0
  10. {znote-1.1.0 → znote-1.2.0}/znote/app/input.py +0 -0
  11. {znote-1.1.0 → znote-1.2.0}/znote/client.py +0 -0
  12. {znote-1.1.0 → znote-1.2.0}/znote/core/auth.py +0 -0
  13. {znote-1.1.0 → znote-1.2.0}/znote/core/client/connect.py +0 -0
  14. {znote-1.1.0 → znote-1.2.0}/znote/core/client/fetch.py +0 -0
  15. {znote-1.1.0 → znote-1.2.0}/znote/core/client/metafile.py +0 -0
  16. {znote-1.1.0 → znote-1.2.0}/znote/core/client/token.py +0 -0
  17. {znote-1.1.0 → znote-1.2.0}/znote/core/config.py +0 -0
  18. {znote-1.1.0 → znote-1.2.0}/znote/core/editor.py +0 -0
  19. {znote-1.1.0 → znote-1.2.0}/znote/core/gen.py +0 -0
  20. {znote-1.1.0 → znote-1.2.0}/znote/core/pack.py +0 -0
  21. {znote-1.1.0 → znote-1.2.0}/znote/core/server/note.py +0 -0
  22. {znote-1.1.0 → znote-1.2.0}/znote/core/workspace.py +0 -0
  23. {znote-1.1.0 → znote-1.2.0}/znote/main.py +0 -0
  24. {znote-1.1.0 → znote-1.2.0}/znote/model/models.py +0 -0
  25. {znote-1.1.0 → znote-1.2.0}/znote/server.py +0 -0
  26. {znote-1.1.0 → znote-1.2.0}/znote.egg-info/SOURCES.txt +0 -0
  27. {znote-1.1.0 → znote-1.2.0}/znote.egg-info/dependency_links.txt +0 -0
  28. {znote-1.1.0 → znote-1.2.0}/znote.egg-info/entry_points.txt +0 -0
  29. {znote-1.1.0 → znote-1.2.0}/znote.egg-info/requires.txt +0 -0
  30. {znote-1.1.0 → znote-1.2.0}/znote.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: znote
3
- Version: 1.1.0
3
+ Version: 1.2.0
4
4
  Summary: Vault de prise de note
5
5
  Author:
6
6
  License: mit
@@ -14,12 +14,12 @@ class Settings():
14
14
  {'module': 'core.client.token','submodule': ['get_token']}
15
15
  )
16
16
  def __init__(self, config_file):
17
- self.config_dir = os.path.abspath(os.path.expanduser('~/.config/znote'))
18
-
19
- self.token_file = os.path.join(self.config_dir, ".token")
17
+ if config_file:
18
+ config_dir = os.path.abspath(os.path.expanduser('~/.config/znote'))
19
+ config_file = os.path.join(config_dir, "config.yml")
20
20
 
21
- if not config_file:
22
- config_file = os.path.join(self.config_dir, "config.yml")
21
+ if not os.path.exists(os.path.dirname(config_file)):
22
+ os.makedirs(os.path.dirname(config_file), exist_ok=True)
23
23
 
24
24
  self.config = Config(f"{config_file}")
25
25
 
@@ -28,8 +28,12 @@ class Settings():
28
28
  self.host = self.config.get('client.host', default="127.0.0.1", auto_set=True)
29
29
  self.port = self.config.get('client.port', default=40017, auto_set=True)
30
30
  self.key_size = self.config.get('client.key_size', default=2048, auto_set=True)
31
- self.key_otp = self.config.get('client.key_otp', default='JBSWY3DPEHPK3PXP', auto_set=True)
31
+ self.key_otp = self.config.get('client.key_otp', default='JBSWY3DPEHPK3PXP', auto_set=True)
32
+ self.config_dir = self.config.get('server.working_dir', default=os.path.abspath(os.path.expanduser('~/.config/znote')), auto_set=True)
33
+
32
34
  self.totp = pyotp.TOTP(self.key_otp)
35
+
36
+ self.token_file = os.path.join(self.config_dir, ".token")
33
37
 
34
38
  self.PubServ = None
35
39
  self.keyC = None
@@ -123,6 +127,7 @@ class Settings():
123
127
  port = input(f"{fg('dark_gray')}port [{fg('cyan')}{self.port}{fg('dark_gray')}]: ")
124
128
  key_size = input(f"{fg('dark_gray')}key_size [{fg('cyan')}{self.key_size}{fg('dark_gray')}]: ")
125
129
  key_otp = input(f"{fg('dark_gray')}key_otp [{fg('cyan')}{self.key_otp}{fg('dark_gray')}]: ")
130
+ working_dir = input(f"{fg('dark_gray')}working_dir [{fg('cyan')}{self.working_dir}{fg('dark_gray')}]: ")
126
131
  verbose = input(f"{fg('dark_gray')}verbose [{fg('cyan')}{self.verbose}{fg('dark_gray')}]: ")
127
132
 
128
133
  if host:
@@ -137,6 +142,9 @@ class Settings():
137
142
  if key_otp:
138
143
  self.config.set('server.key_otp', key_otp)
139
144
 
145
+ if working_dir:
146
+ self.config.set('server.working_dir', working_dir)
147
+
140
148
  if verbose:
141
149
  self.config.set('server.verbose', verbose)
142
150
 
@@ -10,14 +10,12 @@ class Settings:
10
10
  {'module': 'core.config', 'submodule': ['Config']},
11
11
  )
12
12
  def __init__(self, config_file=None):
13
- self.config_dir = os.path.abspath(os.path.expanduser('~/.config/znote'))
13
+ if config_file:
14
+ config_dir = os.path.abspath(os.path.expanduser('~/.config/znote'))
15
+ config_file = os.path.join(config_dir, "config.yml")
14
16
 
15
- if not os.path.exists(self.config_dir):
16
- os.makedirs(self.config_dir, exist_ok=True)
17
-
18
- if not config_file:
19
- config_file = os.path.join(self.config_dir, "config.yml")
20
- #config_file = "config.toml"
17
+ if not os.path.exists(os.path.dirname(config_file)):
18
+ os.makedirs(os.path.dirname(config_file), exist_ok=True)
21
19
 
22
20
  self.config = Config(config_file)
23
21
 
@@ -27,6 +25,7 @@ class Settings:
27
25
  self.port = self.config.get('server.port', default=40017, auto_set=True)
28
26
  self.key_size = self.config.get('server.key_size', default=2048, auto_set=True)
29
27
  self.key_otp = self.config.get('server.key_otp', default='JBSWY3DPEHPK3PXP', auto_set=True)
28
+ self.config_dir = self.config.get('server.working_dir', default=os.path.abspath(os.path.expanduser('~/.config/znote')), auto_set=True)
30
29
 
31
30
  #Initialisation de l'OTP pour la connexion initiale
32
31
  if not re.match(r'^[A-Z0-9]{16}$', self.key_otp):
@@ -127,6 +126,7 @@ class Settings:
127
126
  key_size = input(f"{fg('dark_gray')}key_size [{fg('cyan')}{self.key_size}{fg('dark_gray')}]: ")
128
127
  key_otp = input(f"{fg('dark_gray')}key_otp [{fg('cyan')}{self.key_otp}{fg('dark_gray')}]: ")
129
128
  data_dir = input(f"{fg('dark_gray')}data_dir [{fg('cyan')}{self.data_dir}{fg('dark_gray')}]: ")
129
+ working_dir = input(f"{fg('dark_gray')}working_dir [{fg('cyan')}{self.working_dir}{fg('dark_gray')}]: ")
130
130
  verbose = input(f"{fg('dark_gray')}verbose [{fg('cyan')}{self.verbose}{fg('dark_gray')}]: ")
131
131
 
132
132
  if host:
@@ -144,5 +144,8 @@ class Settings:
144
144
  if data_dir:
145
145
  self.config.set('server.data_dir', data_dir)
146
146
 
147
+ if working_dir:
148
+ self.config.set('server.working_dir', working_dir)
149
+
147
150
  if verbose:
148
151
  self.config.set('server.verbose', verbose)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: znote
3
- Version: 1.1.0
3
+ Version: 1.2.0
4
4
  Summary: Vault de prise de note
5
5
  Author:
6
6
  License: mit
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes