rbeesoft 2.0.3__py3-none-any.whl → 2.0.5__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.
@@ -1,4 +1,5 @@
1
1
  import base64
2
+ import argparse
2
3
  import json
3
4
  import time
4
5
  from pathlib import Path
@@ -49,19 +50,23 @@ def sign_license(payload: dict, priv: Ed25519PrivateKey) -> dict:
49
50
  }
50
51
 
51
52
  def main():
52
- priv_path = Path.home() / 'keys/ed25519_private.key'
53
- out_path = Path("license.json")
54
-
53
+ parser = argparse.ArgumentParser()
54
+ parser.add_argument('private_key_path', help='Path to private key file')
55
+ parser.add_argument('output_dir', help='Path to output directory where license.json is written')
56
+ parser.add_argument('product', help='Name of product')
57
+ parser.add_argument('expires_days_from_now', help='Number of days to expire', type=int)
58
+ parser.add_argument('--features', help='Feature list', default='')
59
+ args = parser.parse_args()
60
+ priv_path = Path(args.private_key_path) # Path.home() / 'keys/ed25519_private.key'
61
+ out_path = Path(args.output_dir) / 'license.json'
55
62
  priv = load_private_key(priv_path)
56
-
57
63
  payload = make_license_payload(
58
- customer="Ralph Example",
59
- product="MyPySideApp Pro",
60
- expires_days_from_now=30,
61
- features=["pro", "export_pdf"],
64
+ customer='Default customer',
65
+ product=args.product,
66
+ expires_days_from_now=args.expires_days_from_now,
67
+ features=[x.strip() for x in args.features.split(',')],
62
68
  machine_fp=None, # set to a fingerprint to bind to a device
63
69
  )
64
-
65
70
  signed = sign_license(payload, priv)
66
71
  out_path.write_text(json.dumps(signed, indent=2, ensure_ascii=False), encoding="utf-8")
67
72
  print(f"Wrote signed license to: {out_path.resolve()}")
@@ -35,13 +35,13 @@ class RbeesoftMainWindow(QMainWindow):
35
35
  self.setWindowTitle(self.app_title())
36
36
  self.addDockWidget(Qt.DockWidgetArea.TopDockWidgetArea, self.central_dockwidget())
37
37
  self.addDockWidget(Qt.DockWidgetArea.BottomDockWidgetArea, self.log_dockwidget())
38
+ LOG.info(f'Settings path: {self.settings().fileName()}')
38
39
  if self.app_icon():
39
40
  self.setWindowIcon(self.app_icon())
40
41
  self.load_geometry_and_state()
41
42
  self.init_default_menus()
42
43
  self.check_license()
43
44
  self.statusBar().showMessage('Ready')
44
- LOG.info(f'Settings path: {self.settings().fileName()}')
45
45
 
46
46
  def init_default_menus(self):
47
47
  # Application menu
@@ -117,12 +117,13 @@ class RbeesoftMainWindow(QMainWindow):
117
117
  if file_path:
118
118
  try:
119
119
  self._license = self.license_manager().verify(file_path)
120
+ LOG.info(f'License found at {file_path}')
120
121
  LOG.info('License OK')
121
122
  return True
122
123
  except LicenseException as e:
123
- LOG.error(e)
124
+ LOG.info(e)
124
125
  return False
125
- LOG.warning('No license found')
126
+ LOG.info('No license found')
126
127
  return False
127
128
 
128
129
  def load_geometry_and_state(self):
@@ -5,11 +5,12 @@ from PySide6.QtWidgets import QWidget
5
5
  class Page(QWidget):
6
6
  page_changed = Signal(str)
7
7
 
8
- def __init__(self, name, title, settings):
8
+ def __init__(self, name, title, settings, license=None):
9
9
  super(Page, self).__init__()
10
10
  self._name = name
11
11
  self._title = title
12
12
  self._settings = settings
13
+ self._license = license
13
14
 
14
15
  def name(self):
15
16
  return self._name
@@ -20,5 +21,8 @@ class Page(QWidget):
20
21
  def settings(self):
21
22
  return self._settings
22
23
 
24
+ def license(self):
25
+ return self._license
26
+
23
27
  def switch_to_page(self, name):
24
28
  self.page_changed.emit(name)
@@ -28,6 +28,8 @@ class LicenseManager:
28
28
  def verify(self, file_path):
29
29
  if isinstance(file_path, str):
30
30
  file_path = Path(file_path)
31
+ if not file_path.exists():
32
+ raise LicenseException('No license found')
31
33
  try:
32
34
  signed = json.loads(file_path.read_text(encoding='utf-8'))
33
35
  payload = signed['payload']
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: rbeesoft
3
- Version: 2.0.3
3
+ Version: 2.0.5
4
4
  Summary:
5
5
  Author: Brecheisen
6
6
  Author-email: r.brecheisen@maastrichtuniversity.nl
@@ -4,27 +4,27 @@ rbeesoft/app/core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU
4
4
  rbeesoft/app/generatekeys.py,sha256=YVxIhKhyo0JY6HFxCTNZdD5bU_K6Vb1zkRKdsYQ80Ew,1243
5
5
  rbeesoft/app/license.json,sha256=m8ukgKJdiJ3fU4nsFIrE2fm6Qk_SdIdwoqkapM2MnlI,374
6
6
  rbeesoft/app/main.py,sha256=AsDayu8MZoLnd9ODZmHL-AA-dqS8exodKv4LcHKw44o,2886
7
- rbeesoft/app/signlicense.py,sha256=9dQG4TNUdTmXTNhzQLghLn59fE_yx1BKYEwvKVAUj_w,2122
7
+ rbeesoft/app/signlicense.py,sha256=Zp5bZOnmtHsFOACgU3iGRwy0Ko0nb4GZ97lB4BKTWMw,2704
8
8
  rbeesoft/app/ui/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
9
9
  rbeesoft/app/ui/processes/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
10
10
  rbeesoft/app/ui/processes/dummyprocess.py,sha256=4r97xwHv7ZaoK85zBxR00zzYnYpoFAxZfBPmxFJYDkM,470
11
11
  rbeesoft/app/ui/processes/process.py,sha256=qMrXKvT06oRe1yRSe3DLO9ObhV2qzzZLI5R-PwryOYs,1694
12
12
  rbeesoft/app/ui/processes/processrunner.py,sha256=HqDQ3ZMlqCqQkyuEgV5sJCkzD35ENvp58z9D-TtnVdA,1170
13
- rbeesoft/app/ui/rbeesoftmainwindow.py,sha256=F-oUd4gOJ6GepTP4Ysu1bN8NqvTJ3HmVqIuwcrH9mvc,5654
13
+ rbeesoft/app/ui/rbeesoftmainwindow.py,sha256=Fjy5m5cMzEbs4J_tVphJT7OzBFn32MWppDBOnlcFN1Y,5709
14
14
  rbeesoft/app/ui/settings.py,sha256=JeUBdQgah9s2XbSqsgEEYzFN2yvUwFMk8L7KFsa55WM,2200
15
15
  rbeesoft/app/ui/widgets/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
16
16
  rbeesoft/app/ui/widgets/centraldockwidget.py,sha256=kK0x-Sz4yz7D4icaIepWpAtct7ZQ9BNroi9EccAvABA,1376
17
17
  rbeesoft/app/ui/widgets/logdockwidget.py,sha256=DZkQQitarE5B82qvNCSnUWDWXxhWsuTauboULFoh7eI,1810
18
18
  rbeesoft/app/ui/widgets/pages/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
19
- rbeesoft/app/ui/widgets/pages/page.py,sha256=_YI8y-VP3MLz4C6xChIJhrDwZ2QbcQBY2g7zvAI8r4M,554
19
+ rbeesoft/app/ui/widgets/pages/page.py,sha256=huzUrbvyx8qZmeelKRhLimB9RFfuj9bK_EsG_56AK_E,661
20
20
  rbeesoft/app/ui/widgets/pages/pagerouter.py,sha256=L5EKEMWVibSI7IpabQBkLsCDw1xBt1wfYY50iR56VZA,1460
21
21
  rbeesoft/common/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
22
22
  rbeesoft/common/licenseexception.py,sha256=oapxaf0e9Fbl3iAa5e3c2EYxNhD0e1im1mwJfimsZ3Q,44
23
- rbeesoft/common/licensemanager.py,sha256=UxsEvWbzXHTAI5sqI-MsZZP-aG1GK14YBY_ky2M5JyE,1554
23
+ rbeesoft/common/licensemanager.py,sha256=K-F9fpnBXOG-tjfhO5YAK706gXDk623ZtYQVi12-4Iw,1646
24
24
  rbeesoft/common/logmanager.py,sha256=K_qCbPjrzoV5le3KSvLOSSXYa-_MWLJ3FdFNTEGYSxg,1391
25
25
  rbeesoft/common/logmanagerlistener.py,sha256=Gaig07yjBnyQq9I8sN85olTEeDCDyCFQnEJdwzvmgvc,99
26
26
  rbeesoft/common/singleton.py,sha256=FV0k_LlOCmFhlWN6gf1c2x7YXWyd8-7DsIMvOKrI6NY,224
27
27
  rbeesoft/webapp/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
28
- rbeesoft-2.0.3.dist-info/METADATA,sha256=_60oXjgLbPCAIMrQOamK4sL-OHQj_7hQrxQ9a0t8spc,378
29
- rbeesoft-2.0.3.dist-info/WHEEL,sha256=3ny-bZhpXrU6vSQ1UPG34FoxZBp3lVcvK0LkgUz6VLk,88
30
- rbeesoft-2.0.3.dist-info/RECORD,,
28
+ rbeesoft-2.0.5.dist-info/METADATA,sha256=MLufddI91YLdHBYByzCtZgb7ZpzKZv0rJqU4Ye6Ymlw,378
29
+ rbeesoft-2.0.5.dist-info/WHEEL,sha256=3ny-bZhpXrU6vSQ1UPG34FoxZBp3lVcvK0LkgUz6VLk,88
30
+ rbeesoft-2.0.5.dist-info/RECORD,,