rccn-gen 1.3.2__py3-none-any.whl → 1.3.3__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.
rccn_gen/systems.py CHANGED
@@ -169,6 +169,9 @@ class Application(Subsystem):
169
169
  'main_template': os.path.join(self.text_modules_main_path, 'main.txt'),
170
170
  'cargo_toml': os.path.join(self.export_directory, 'rccn_usr_'+snakecase(self.name), 'Cargo.toml'),
171
171
  'cargo_toml_template': os.path.join(self.text_modules_path, 'cargo_toml', 'cargo.txt'),
172
+ 'cargo_toml_generated_snapshot': os.path.join(self.snapshot_directory, 'generated', 'rccn_usr_'+snakecase(self.name), 'cargo.toml'),
173
+ 'cargo_toml_user_snapshot': os.path.join(self.user_snapshot_path(), 'rccn_usr_'+snakecase(self.name), 'cargo.toml'),
174
+ 'cargo_toml_diff': os.path.join(self.diff_directory, 'rccn_usr_'+snakecase(self.name), 'cargo.diff'),
172
175
  }
173
176
  return paths
174
177
 
@@ -407,12 +410,34 @@ class Application(Subsystem):
407
410
 
408
411
  def generate_cargo_toml_file(self):
409
412
  """
410
- Generate the Cargo.toml file for the application.
413
+ Generate the cargo.toml file for the application.
414
+
415
+ Performs several tasks:
416
+ 1. Creates diff file if both current and snapshot files exist
417
+ 2. Creates snapshot of current main with user changes if snapshots are enabled
418
+ 3. Generates new cargo.toml file from template
419
+ 4. Creates snapshot of newly generated main if snapshots are enabled
420
+ 5. Applies user changes from diff file if rebase_changes is enabled
411
421
  """
422
+ # Create cargo_toml.diff file
423
+ if os.path.exists(self.file_paths()['cargo_toml']) and os.path.exists(self.file_paths()['cargo_toml_generated_snapshot']):
424
+ os.maked(os.path.dirname(self.file_paths()['cargo_toml_diff']), exist_ok=True)
425
+ self.generate_diff_file('cargo_toml', 'cargo_toml_generated_snapshot', 'cargo_toml_diff')
426
+ # Create snapshot of cargo_toml with user changes if instructed
427
+ if self.snapshots and os.path.exists(self.file_paths()['cargo_toml']):
428
+ self.generate_snapshot('cargo_toml', 'cargo_toml_user_snapshot')
429
+ # Generate cargo_toml file
412
430
  with open(self.file_paths()['cargo_toml_template'], 'r') as file:
413
431
  cargo_toml_template_text = file.read()
414
432
  with open(self.file_paths()['cargo_toml'], 'w') as file:
415
- file.write(cargo_toml_template_text)
433
+ new_cargo_toml_text = self.find_and_replace_keywords(cargo_toml_template_text)
434
+ file.write("".join(new_cargo_toml_text))
435
+ # Create snapshot of newly generated cargo_toml if instructed
436
+ if self.snapshots:
437
+ self.generate_snapshot('cargo_toml', 'cargo_toml_generated_snapshot')
438
+ # Rebase cargo_toml.diff on cargo_toml if instructed
439
+ if self.rebase_changes and os.path.exists(self.file_paths()['cargo_toml_diff']):
440
+ os.system('patch '+self.file_paths()['cargo_toml']+' < '+self.file_paths()['cargo_toml_diff'])
416
441
 
417
442
 
418
443
  class Service(Subsystem):
@@ -1,7 +1,7 @@
1
1
  [package]
2
- name = "rccn_usr_example_app"
2
+ name = "rccn_user_<<VAR_APP_NAME_SCASE>>"
3
3
  version = "0.1.0"
4
- edition = "2021"
4
+ edition = "2025"
5
5
 
6
6
  [dependencies]
7
7
  anyhow = "1.0.91"
@@ -14,4 +14,7 @@ spacepackets = "0.12.0"
14
14
  tokio = "1.41.1"
15
15
  env_logger = { version = "0.11.7", default-features = false, features = ["color", "humantime"] }
16
16
  num-derive = "0.4"
17
- num-traits = "0.2"
17
+ num-traits = "0.2"
18
+ rccn_usr_bitstruct_derive = { version = "0.1.0", path = "../rccn_usr_bitstruct_derive" }
19
+ rccn_usr_pus_macros = { version = "0.1.0", path = "../rccn_usr_pus_macros" }
20
+ chrono = "0.4.40"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: rccn_gen
3
- Version: 1.3.2
3
+ Version: 1.3.3
4
4
  Summary: A python based generator for RACCOON OS source files in Rust from yamcs-pymdb config files.
5
5
  Project-URL: Homepage, https://gitlab.com/rccn/pymdb_code_generation
6
6
  Project-URL: Issues, https://gitlab.com/rccn/pymdb_code_generation/issues
@@ -8,7 +8,7 @@ Author-email: Fabian Krech <f.krech@tu-berlin.de>
8
8
  License-Expression: GPL-3.0
9
9
  Classifier: Operating System :: OS Independent
10
10
  Classifier: Programming Language :: Python :: 3
11
- Requires-Python: >=3.8
11
+ Requires-Python: >=3.12
12
12
  Requires-Dist: case-converter>=1.2.0
13
13
  Requires-Dist: inflect>=7.5.0
14
14
  Requires-Dist: yamcs-pymdb>=0.1.0
@@ -1,8 +1,8 @@
1
1
  rccn_gen/LICENSE,sha256=ixuiBLtpoK3iv89l7ylKkg9rs2GzF9ukPH7ynZYzK5s,35148
2
2
  rccn_gen/__init__.py,sha256=rBnqIw3uQk-uBbRh9VnungoTRSr2V0Bqos32xFZ44Eo,168
3
- rccn_gen/systems.py,sha256=vaagjFcQX3PmnylEdi0ThfS_JkBHlIuguUu6VLfn5DE,83907
3
+ rccn_gen/systems.py,sha256=X7GuD49wCer8zrZkAveIF-4t4S1L2FvZFzoIneBH-SY,85858
4
4
  rccn_gen/utils.py,sha256=q5YSmyc3qADNYcycxQJBvrG6Df8CJelL4lhXF-dN_Ms,17016
5
- rccn_gen/text_modules/cargo_toml/cargo.txt,sha256=AYjSo3WJE7lhOcJaiNgXP9Y-DXHDIFIt6p42rDTVNVE,427
5
+ rccn_gen/text_modules/cargo_toml/cargo.txt,sha256=FMd-4E4YXK7AsIfjhOou6rlC-75ZeUhI26AVaZuuD74,623
6
6
  rccn_gen/text_modules/command/command.txt,sha256=8Y-uJilhFLoinftIbn7uKfia9LLMZno2LkoDJ-4Y-9M,345
7
7
  rccn_gen/text_modules/command/command_module_enum.txt,sha256=35sBlAV_CzQw95Uf2dNynrYOxVD2tT2XWfEvS4Zx_KY,121
8
8
  rccn_gen/text_modules/command/command_module_struct.txt,sha256=FT7Ke0uOVxWYpGC_oj9zafr1ahrH-nf0nSxQje6kToY,22
@@ -14,6 +14,6 @@ rccn_gen/text_modules/mod/mod.txt,sha256=BF8LablBE4ddutdl5m0prvpvLdBRejueVOujkyr
14
14
  rccn_gen/text_modules/service/command_module_match_cmd.txt,sha256=eVGo6ltuerG37rVxpXtL-JYuLyLW4c0i6NXb5g1_U-A,89
15
15
  rccn_gen/text_modules/service/service.txt,sha256=qTxoOD5i7wH4yFiDn13rOJW9hIZyACA8W3m6UABe22U,695
16
16
  rccn_gen/text_modules/telemetry/telemetry.txt,sha256=Re1d3BfpyXT_CEe7jJzLF3MARik0-J-K98K85iPOE40,193
17
- rccn_gen-1.3.2.dist-info/METADATA,sha256=AZYmynW8QvCwT83y5LzL3d9ynFHX8LT9Dc9YVlN6Nns,9911
18
- rccn_gen-1.3.2.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
19
- rccn_gen-1.3.2.dist-info/RECORD,,
17
+ rccn_gen-1.3.3.dist-info/METADATA,sha256=1r3fXDrhVVOtoAeQozWB3m-hly5QIRgY83jd_0nboAQ,9912
18
+ rccn_gen-1.3.3.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
19
+ rccn_gen-1.3.3.dist-info/RECORD,,