znote 1.2.6__tar.gz → 1.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 (31) hide show
  1. {znote-1.2.6/znote.egg-info → znote-1.2.8}/PKG-INFO +1 -1
  2. {znote-1.2.6 → znote-1.2.8}/znote/client.py +17 -4
  3. {znote-1.2.6 → znote-1.2.8}/znote/core/client/settings.py +2 -2
  4. {znote-1.2.6 → znote-1.2.8/znote.egg-info}/PKG-INFO +1 -1
  5. {znote-1.2.6 → znote-1.2.8}/LICENSE +0 -0
  6. {znote-1.2.6 → znote-1.2.8}/README.md +0 -0
  7. {znote-1.2.6 → znote-1.2.8}/setup.cfg +0 -0
  8. {znote-1.2.6 → znote-1.2.8}/znote/__init__.py +0 -0
  9. {znote-1.2.6 → znote-1.2.8}/znote/app/display.p +0 -0
  10. {znote-1.2.6 → znote-1.2.8}/znote/app/display.py +0 -0
  11. {znote-1.2.6 → znote-1.2.8}/znote/app/input.py +0 -0
  12. {znote-1.2.6 → znote-1.2.8}/znote/core/auth.py +0 -0
  13. {znote-1.2.6 → znote-1.2.8}/znote/core/client/connect.py +0 -0
  14. {znote-1.2.6 → znote-1.2.8}/znote/core/client/fetch.py +0 -0
  15. {znote-1.2.6 → znote-1.2.8}/znote/core/client/metafile.py +0 -0
  16. {znote-1.2.6 → znote-1.2.8}/znote/core/client/token.py +0 -0
  17. {znote-1.2.6 → znote-1.2.8}/znote/core/config.py +0 -0
  18. {znote-1.2.6 → znote-1.2.8}/znote/core/editor.py +0 -0
  19. {znote-1.2.6 → znote-1.2.8}/znote/core/gen.py +0 -0
  20. {znote-1.2.6 → znote-1.2.8}/znote/core/pack.py +0 -0
  21. {znote-1.2.6 → znote-1.2.8}/znote/core/server/note.py +0 -0
  22. {znote-1.2.6 → znote-1.2.8}/znote/core/server/settings.py +0 -0
  23. {znote-1.2.6 → znote-1.2.8}/znote/core/workspace.py +0 -0
  24. {znote-1.2.6 → znote-1.2.8}/znote/main.py +0 -0
  25. {znote-1.2.6 → znote-1.2.8}/znote/model/models.py +0 -0
  26. {znote-1.2.6 → znote-1.2.8}/znote/server.py +0 -0
  27. {znote-1.2.6 → znote-1.2.8}/znote.egg-info/SOURCES.txt +0 -0
  28. {znote-1.2.6 → znote-1.2.8}/znote.egg-info/dependency_links.txt +0 -0
  29. {znote-1.2.6 → znote-1.2.8}/znote.egg-info/entry_points.txt +0 -0
  30. {znote-1.2.6 → znote-1.2.8}/znote.egg-info/requires.txt +0 -0
  31. {znote-1.2.6 → znote-1.2.8}/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.2.6
3
+ Version: 1.2.8
4
4
  Summary: Vault de prise de note
5
5
  Author:
6
6
  License: mit
@@ -187,7 +187,12 @@ class Client():
187
187
  {'module': 'app.display', 'submodule': ['logs', 'notify']},
188
188
  )
189
189
  def publish_file(self, file, expanded_path, channel_name):
190
- logs(f"Envoi de {os.path.relpath(file, expanded_path)}")
190
+ if expanded_path:
191
+ filename = os.path.relpath(file, expanded_path)
192
+ else:
193
+ filename = os.path.basename(file)
194
+
195
+ logs(f"Envoi de {filename}")
191
196
  with open(file, 'rb') as f:
192
197
  content = f.read()
193
198
  content_hash = hashlib.sha256(content).hexdigest()
@@ -196,7 +201,7 @@ class Client():
196
201
  'method': 'channel',
197
202
  'action': 'publish',
198
203
  'channel_name': channel_name,
199
- 'name': os.path.relpath(file, expanded_path),
204
+ 'name': filename,
200
205
  'content': content,
201
206
  'hash': content_hash,
202
207
  'token': __main__.settings.token
@@ -481,8 +486,16 @@ class Client():
481
486
 
482
487
  expanded_path = os.path.expanduser(path)
483
488
 
484
- files = glob(f"{expanded_path}/**/*", recursive=True)
485
- #files = [os.path.relpath(p, expanded_path) for p in results]
489
+ if not os.path.exists(expanded_path):
490
+ logs("La source n'existe pas", "error")
491
+
492
+ if os.path.isdir(expanded_path):
493
+ files = glob(f"{expanded_path}/**/*", recursive=True)
494
+ #files = [os.path.relpath(p, expanded_path) for p in results]
495
+ else:
496
+ files = [expanded_path]
497
+ expanded_path = None
498
+
486
499
  push_file = []
487
500
 
488
501
  for file in files:
@@ -133,10 +133,10 @@ class Settings():
133
133
  if host:
134
134
  self.config.set('client.host', host)
135
135
 
136
- if port and isinstance(port, int):
136
+ if port and port.isdigit():
137
137
  self.config.set('client.port', int(port))
138
138
 
139
- if key_size and isinstance(key_size, int):
139
+ if key_size and key_size.isdigit():
140
140
  self.config.set('client.key_size', int(key_size))
141
141
 
142
142
  if key_otp:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: znote
3
- Version: 1.2.6
3
+ Version: 1.2.8
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