struct-frame 0.0.14__py3-none-any.whl → 0.0.16__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.
Potentially problematic release.
This version of struct-frame might be problematic. Click here for more details.
- struct_frame/generate.py +20 -15
- {struct_frame-0.0.14.dist-info → struct_frame-0.0.16.dist-info}/METADATA +1 -1
- {struct_frame-0.0.14.dist-info → struct_frame-0.0.16.dist-info}/RECORD +5 -5
- {struct_frame-0.0.14.dist-info → struct_frame-0.0.16.dist-info}/WHEEL +0 -0
- {struct_frame-0.0.14.dist-info → struct_frame-0.0.16.dist-info}/licenses/LICENSE +0 -0
struct_frame/generate.py
CHANGED
|
@@ -246,11 +246,13 @@ processed_file = []
|
|
|
246
246
|
required_file = []
|
|
247
247
|
|
|
248
248
|
parser = argparse.ArgumentParser(
|
|
249
|
-
prog='
|
|
250
|
-
description='
|
|
251
|
-
epilog='Text at the bottom of help')
|
|
249
|
+
prog='struct_frame',
|
|
250
|
+
description='Message serialization and header generation program')
|
|
252
251
|
|
|
253
|
-
parser.add_argument('filename')
|
|
252
|
+
parser.add_argument('filename')
|
|
253
|
+
parser.add_argument('--debug', action='store_true')
|
|
254
|
+
parser.add_argument('--c_path', nargs=1, type=str, default=['c/'])
|
|
255
|
+
parser.add_argument('--ts_path', nargs=1, type=str, default=['ts/'])
|
|
254
256
|
|
|
255
257
|
|
|
256
258
|
def parseFile(filename):
|
|
@@ -305,11 +307,13 @@ def printPackages():
|
|
|
305
307
|
for key, value in packages.items():
|
|
306
308
|
print(value)
|
|
307
309
|
|
|
310
|
+
import os
|
|
311
|
+
import shutil
|
|
308
312
|
|
|
309
313
|
def generateCFileStrings(path):
|
|
310
314
|
out = {}
|
|
311
315
|
for key, value in packages.items():
|
|
312
|
-
name = path
|
|
316
|
+
name = os.path.join(path, value.name + ".sf.h")
|
|
313
317
|
data = ''.join(FileCGen.generate(value))
|
|
314
318
|
out[name] = data
|
|
315
319
|
|
|
@@ -318,15 +322,12 @@ def generateCFileStrings(path):
|
|
|
318
322
|
def generateTsFileStrings(path):
|
|
319
323
|
out = {}
|
|
320
324
|
for key, value in packages.items():
|
|
321
|
-
name = path
|
|
325
|
+
name = os.path.join(path, value.name + ".sf.ts")
|
|
322
326
|
data = ''.join(FileTsGen.generate(value))
|
|
323
327
|
out[name] = data
|
|
324
|
-
|
|
325
328
|
return out
|
|
326
329
|
|
|
327
330
|
|
|
328
|
-
import os
|
|
329
|
-
|
|
330
331
|
def main():
|
|
331
332
|
args = parser.parse_args()
|
|
332
333
|
parseFile(args.filename)
|
|
@@ -337,11 +338,10 @@ def main():
|
|
|
337
338
|
print(
|
|
338
339
|
f'Recursion Error. Messages most likely have a cyclical dependancy. Check Message: {recErrCurrentMessage} and Field: {recErrCurrentField}')
|
|
339
340
|
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
files.update(generateTsFileStrings(tspath))
|
|
341
|
+
print(args.c_path)
|
|
342
|
+
print(args.ts_path)
|
|
343
|
+
files = generateCFileStrings(args.c_path[0])
|
|
344
|
+
files.update(generateTsFileStrings(args.ts_path[0]))
|
|
345
345
|
|
|
346
346
|
for filename, filedata in files.items():
|
|
347
347
|
dirname = os.path.dirname(filename)
|
|
@@ -351,7 +351,12 @@ def main():
|
|
|
351
351
|
with open(filename , 'w', encoding='utf-8') as f:
|
|
352
352
|
f.write(filedata)
|
|
353
353
|
|
|
354
|
-
|
|
354
|
+
dir_path = os.path.dirname(os.path.realpath(__file__))
|
|
355
|
+
shutil.copytree(os.path.join(dir_path,"boilerplate/c"), args.c_path[0], dirs_exist_ok=True)
|
|
356
|
+
shutil.copytree(os.path.join(dir_path,"boilerplate/ts"), args.ts_path[0], dirs_exist_ok=True)
|
|
357
|
+
|
|
358
|
+
if args.debug:
|
|
359
|
+
printPackages()
|
|
355
360
|
|
|
356
361
|
|
|
357
362
|
if __name__ == '__main__':
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: struct-frame
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.16
|
|
4
4
|
Summary: A framework for serializing data with headers
|
|
5
5
|
Project-URL: Homepage, https://github.com/mylonics/struct-frame
|
|
6
6
|
Project-URL: Issues, https://github.com/mylonics/struct-frame/issues
|
|
@@ -2,7 +2,7 @@ struct_frame/__init__.py,sha256=t_GBVV-CeYA4Yupfu-pH5922nisafAOZLsyyfrJtD0c,269
|
|
|
2
2
|
struct_frame/__main__.py,sha256=tIybnBeFHvwiwVhodVOSnxhne5AX_80mtXBx4rneSB4,143
|
|
3
3
|
struct_frame/base.py,sha256=Sx1hwOjpmbhArPldw4jYibvd7UMRtfkSO_P0lu9NqZA,2021
|
|
4
4
|
struct_frame/c_gen.py,sha256=MQ2wBL9O6zse4XA0WmFVsHes8UUjgXSj1vgjjWOcSI4,5825
|
|
5
|
-
struct_frame/generate.py,sha256=
|
|
5
|
+
struct_frame/generate.py,sha256=VxlPJbAGGptDU76LDmLEAH2u3MHdYR0-p62xPVkAUQc,11452
|
|
6
6
|
struct_frame/ts_gen.py,sha256=b_mx5IwemcWB70082iHSGOAPzqcnnglXB-fEk4Q2uLM,6123
|
|
7
7
|
struct_frame/boilerplate/c/struct_frame.h,sha256=Y0V39aqXfR-eTSNe6f1hdc55GXHXBADBK2kbNrxCo-k,4909
|
|
8
8
|
struct_frame/boilerplate/c/struct_frame_gen.h,sha256=MdXFYOO6E7IN4DM5EaEMXXowZb4auv8UeyQBprkqx68,43
|
|
@@ -12,7 +12,7 @@ struct_frame/boilerplate/ts/struct_frame.ts,sha256=botKdIKVP7Bi6BJdXfIZaGAmoATnu
|
|
|
12
12
|
struct_frame/boilerplate/ts/struct_frame_gen.ts,sha256=pz6QTIWDTIY0rMCFiGNgp3DcfO7cKsmXrx3rj3zgN_U,164
|
|
13
13
|
struct_frame/boilerplate/ts/struct_frame_parser.ts,sha256=6eTbafomqTsX3Fvfn82rxNQMxu4PwTaPug38xw4wrhE,3523
|
|
14
14
|
struct_frame/boilerplate/ts/struct_frame_types.ts,sha256=aBtxVI2lUJKGPTtJAOpbStpS2sXSKvd4XWCIsOnaMk8,2130
|
|
15
|
-
struct_frame-0.0.
|
|
16
|
-
struct_frame-0.0.
|
|
17
|
-
struct_frame-0.0.
|
|
18
|
-
struct_frame-0.0.
|
|
15
|
+
struct_frame-0.0.16.dist-info/METADATA,sha256=M6aTlb5ozoD4OSdm6tOiaoehFaMHruTh9Ybm2TqaBD0,828
|
|
16
|
+
struct_frame-0.0.16.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
17
|
+
struct_frame-0.0.16.dist-info/licenses/LICENSE,sha256=UjbLtGfcHCIqJg9UzEVGoNW8fyX4Ah9ZbsuAmJ_vhmk,1094
|
|
18
|
+
struct_frame-0.0.16.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|