sbdl 1.18.18__tar.gz → 1.18.20__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: sbdl
3
- Version: 1.18.18
3
+ Version: 1.18.20
4
4
  Summary: System Behaviour Description Language (Compiler)
5
5
  Home-page: https://sbdl.dev
6
6
  Author: Michael A. Hicks
@@ -0,0 +1,4 @@
1
+ [build-system]
2
+ requires = ["setuptools>=42", "wheel"]
3
+ build-backend = "setuptools.build_meta"
4
+
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: sbdl
3
- Version: 1.18.18
3
+ Version: 1.18.20
4
4
  Summary: System Behaviour Description Language (Compiler)
5
5
  Home-page: https://sbdl.dev
6
6
  Author: Michael A. Hicks
@@ -1,10 +1,11 @@
1
1
  csv-to-sbdl.py
2
- sbdl
2
+ pyproject.toml
3
3
  sbdl.py
4
4
  sbdl_server.py
5
5
  setup.py
6
6
  sbdl.egg-info/PKG-INFO
7
7
  sbdl.egg-info/SOURCES.txt
8
8
  sbdl.egg-info/dependency_links.txt
9
+ sbdl.egg-info/entry_points.txt
9
10
  sbdl.egg-info/requires.txt
10
11
  sbdl.egg-info/top_level.txt
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ sbdl = sbdl:run_main
@@ -4,4 +4,3 @@ jinja2
4
4
  matplotlib
5
5
  networkx
6
6
  openpyxl
7
- pandas
@@ -221,8 +221,8 @@ _A=True
221
221
  import argparse,base64,datetime,csv,functools,getpass,hashlib,importlib,io,json,os,pathlib,pickle,platform,re,shlex,string,subprocess,sys,tarfile,tempfile,textwrap,time,traceback,types,unittest,urllib.request,urllib.parse,warnings,zlib,zipfile
222
222
  warnings.filterwarnings(_A1,category=DeprecationWarning)
223
223
  __NAME=_j
224
- __VERSION='1.18.18'
225
- __VERSION_DEV='2a6b4c8'
224
+ __VERSION='1.18.20'
225
+ __VERSION_DEV='4102984'
226
226
  __VERSION_DSL='25.6'
227
227
  __VERSION_REST_API='1.1.0'
228
228
  __AUTHOR='contact@sbdl.dev'
@@ -585,7 +585,7 @@ class SBDL_Parser:
585
585
  def git_commit_hash(macros,*inp):
586
586
  param_path=''.join(inp);config_path=os.path.join(macros[SBDL_Parser.Macros.path].replace(macros[SBDL_Parser.Macros.file_name],''),param_path)
587
587
  try:repo_root=pathlib.Path(config_path).resolve();hash_value=subprocess.check_output(['git','-C',str(repo_root),'rev-parse','--short','HEAD'],text=_A).strip()
588
- except Exception as e:raise self.MacroReplaceException(f"ERROR retrieving Git commit hash: {e}",first_pass_can_ignore=_C)
588
+ except Exception as e:hash_value='GIT_HASH_UNAVAILABLE';f_print(f"{macros[SBDL_Parser.Macros.file_name]}:{macros[SBDL_Parser.Macros.line]}:: WARNING cannot retrieve Git commit hash: {e}",warning=_A)
589
589
  return hash_value
590
590
  def identifier_from_property(macros,*inp):
591
591
  A='SBDL_PROPERTY_VALUE_CACHE_MEMO'
@@ -1879,14 +1879,14 @@ def msword_input_handler(file_reference):
1879
1879
  return result,handler
1880
1880
  def msexcel_input_handler(file_reference):
1881
1881
  result=_C;handler=_B;_,extension=os.path.splitext(file_reference)
1882
- if extension=='.xls'or extension=='.xlsx'or extension=='.ods':
1882
+ if extension=='.xls'or extension=='.xlsx':
1883
1883
  try:
1884
- import pandas;pdframe=pandas.read_excel(file_reference);content=[]
1885
- for col in pdframe:
1886
- content.append(str(col))
1887
- for cell in pdframe[col]:content.append(ms_character_fix(str(cell)))
1884
+ import openpyxl;wb=openpyxl.load_workbook(file_reference,data_only=_A);ws=wb.active;content=[]
1885
+ for col_cells in ws.iter_cols():
1886
+ header=col_cells[0].value;content.append(str(header))
1887
+ for cell in col_cells[1:]:content.append(ms_character_fix(str(cell.value)))
1888
1888
  handler=list_file_object(content);result=_A
1889
- except Exception as e:f_print('Trying to parse what looks like an MS Excel file but pandas package cannot be imported correctly:\n {}'.format(str(e)),do_warning=_A,warning=_A)
1889
+ except Exception as e:f_print('Trying to parse what looks like an MS Excel file but openpyxl package cannot be imported correctly:\n {}'.format(str(e)),do_warning=_A,warning=_A)
1890
1890
  return result,handler
1891
1891
  def make_remote_file_local(file_reference):
1892
1892
  local_file_reference=file_reference;parsed_file_reference=urllib.parse.urlparse(local_file_reference);error_string=_B
@@ -2311,7 +2311,7 @@ def write_process_graph_output(sbdl_ast,output_file,file_opener,_,print_l):
2311
2311
  if SBDL_Parser.Attributes.condition in event_elem.properties():condition=event_elem.get_property(SBDL_Parser.Attributes.condition)
2312
2312
  def emit_note():
2313
2313
  nonlocal event_cont,note_stagger
2314
- if show_descriptions and event_elem.description():event_cont+=f"{indent_str}note {_AA if note_stagger else _AB}\n{indent_str}{event_elem.description()}\n{indent_str}end note\n";note_stagger=not note_stagger
2314
+ if show_descriptions and event_elem.description():event_cont+=f"{indent_str}note "+(_AA if note_stagger else _AB)+'\n{indent_str}{event_elem.description()}\n{indent_str}end note\n';note_stagger=not note_stagger
2315
2315
  if ev_aspect!=current_aspect and get_config_value(_q,number=_A):
2316
2316
  event_cont+=f"{indent_str}"
2317
2317
  if ev_aspect in elements:
@@ -2321,12 +2321,12 @@ def write_process_graph_output(sbdl_ast,output_file,file_opener,_,print_l):
2321
2321
  if first_event:
2322
2322
  event_cont+=f"{indent_str}start\n";first_event=_C
2323
2323
  if get_config_value(_q,number=_A):event_cont+=f"{indent_str}{elem_colour_prefix(g_process_elem)}:{g_process_elem.identifier()}; <<procedure>>\n";emit_note()
2324
- if is_loop:event_cont+=f"{indent_str}repeat{_D if control_only else""}"
2325
- if not control_only:event_cont+=f"{indent_str}{elem_colour_prefix(event_elem)if not is_loop else""}:{event_elem.identifier()}; <<task>>\n";emit_note()
2324
+ if is_loop:suffix=_D if control_only else'';event_cont+=f"{indent_str}repeat{suffix}"
2325
+ if not control_only:prefix=elem_colour_prefix(event_elem)if not is_loop else'';event_cont+=f"{indent_str}{prefix}:{event_elem.identifier()}; <<task>>\n";emit_note()
2326
2326
  if ev_links and condition and not is_loop:event_cont+=f"{indent_str}if ({condition}) then (condition met)\n"
2327
2327
  child_count=0
2328
2328
  for event_id in ev_links:
2329
- if is_parallel:event_cont+=f"{indent_str}fork{" again"if child_count else""}\n"
2329
+ if is_parallel:suffix=' again'if child_count else'';event_cont+=f"{indent_str}fork{suffix}\n"
2330
2330
  event_cont+=recurse_event_contents(elements[event_id],ev_aspect,indent=indent+2);child_count+=1
2331
2331
  if is_parallel:event_cont+=f"{indent_str}endfork\n"
2332
2332
  if ev_links and SBDL_Parser.Attributes.condition_alternative in event_elem.properties():
@@ -2338,7 +2338,7 @@ def write_process_graph_output(sbdl_ast,output_file,file_opener,_,print_l):
2338
2338
  def handle_process_element(process_elem):
2339
2339
  nonlocal g_process_elem,first_event;first_event=_A;g_process_elem=process_elem;process_cont=''
2340
2340
  if not get_config_value(_q,number=_A):
2341
- process_cont+=f'group {elem_colour_prefix(process_elem)}"**{f"{process_elem.type()}::{process_elem.stereotype()}"if process_elem.stereotype()else process_elem.type()}** {process_elem.identifier()}" {{\n';description=process_elem.description()
2341
+ process_cont+=f'group {elem_colour_prefix(process_elem)}"**'+(f"{process_elem.type()}::{process_elem.stereotype()}"if process_elem.stereotype()else process_elem.type())+'** {process_elem.identifier()}" {{\n';description=process_elem.description()
2342
2342
  if show_descriptions and description:process_cont+=f"note\n{description}\nend note\n"
2343
2343
  process_links=SBDL_AST.get_all_links_for_element(process_elem,elements)
2344
2344
  for event_id in[x.identifier()for x in process_links if x.is_a(SBDL_Event)and x.identifier()in elements]:process_cont+=recurse_event_contents(elements[event_id])
@@ -2611,6 +2611,11 @@ class OpenFMEA:
2611
2611
  if not raw:content=result[1:-1];result=SBDL_Parser.Tokens.replacement_string_default.join(content.split());result=SBDL_Parser.sanitize_identifier(result)
2612
2612
  return result
2613
2613
  @classmethod
2614
+ def remove_id_from_description(self,description):
2615
+ result=description;id_string=self.get_id_from_string(description,_A)
2616
+ if id_string!=_B:result=result.replace(id_string,'')
2617
+ return result
2618
+ @classmethod
2614
2619
  def add_id_to_string(self,identifier,string_content):return'[{}] {}'.format(identifier,string_content)
2615
2620
  @classmethod
2616
2621
  def sbdl_elements_from_table(self,sbdl_table,_):return self.elements_from_table(sbdl_table,_)
@@ -2626,10 +2631,6 @@ class OpenFMEA:
2626
2631
  if not attr_type in id_lookup:id_lookup[attr_type]={};id_lookup[attr_type][A]=1
2627
2632
  result=id_lookup[attr_type][attr]=replace_str.join((elems_to_consider[attr_type]+replace_str+str(id_lookup[attr_type][A]).zfill(3)).split());id_lookup[attr_type][A]+=1
2628
2633
  return result
2629
- def remove_id_from_description(description):
2630
- result=description;id_string=self.get_id_from_string(description,_A)
2631
- if id_string!=_B:result=result.replace(id_string,'')
2632
- return result
2633
2634
  def split_multi_field(multi_data):return[x.strip()for x in str(multi_data).split(multi_field_separator)]
2634
2635
  def present_on_relevant_rows(source_content,source_column,target_content,target_column):
2635
2636
  result=_A
@@ -2656,7 +2657,7 @@ class OpenFMEA:
2656
2657
  def handle_elem(row_data,attr):
2657
2658
  attr_data_full=split_multi_field(row_data[attr])
2658
2659
  for attr_data in attr_data_full:
2659
- attr_data_no_id=remove_id_from_description(attr_data).strip()
2660
+ attr_data_no_id=self.remove_id_from_description(attr_data).strip()
2660
2661
  if len(attr_data)>0:
2661
2662
  if attr in elems_to_consider:
2662
2663
  id_ref=get_id_from_attr(attr,attr_data);elem=_B
@@ -2685,7 +2686,7 @@ class OpenFMEA:
2685
2686
  if'id'in gen_elem_obj and _P in gen_elem_obj and _K in gen_elem_obj:
2686
2687
  if gen_elem_obj[_K]in supported_general_types:
2687
2688
  if supported_general_types[gen_elem_obj[_K]][B]==0:supported_general_types[gen_elem_obj[_K]][B]+=1;new_customtype_statement=SBDL_Parser.parse_customtype(SBDL_Parser.Parser_Element(supported_general_types[gen_elem_obj[_K]][C],_AC,0));new_customtype_def=SBDL_CustomType(new_customtype_statement);general_elements.append(new_customtype_def)
2688
- new_gen_elem=SBDL_Element_Synthetic(entry_identifier(gen_elem_obj),gen_elem_obj[_P],supported_general_types[gen_elem_obj[_K]][A],_B)
2689
+ new_gen_elem=SBDL_Element_Synthetic(entry_identifier(gen_elem_obj),self.remove_id_from_description(gen_elem_obj[_P]),supported_general_types[gen_elem_obj[_K]][A],_B)
2689
2690
  if D in gen_elem_obj:
2690
2691
  for edge in gen_elem_obj[D]:
2691
2692
  explicit_identifier=self.get_id_from_string(edge);matching_identifier=_B;matching_type=_B
@@ -2,14 +2,18 @@ from setuptools import setup
2
2
 
3
3
  setup(
4
4
  name='sbdl',
5
- version='1.18.18',
5
+ version='1.18.20',
6
6
  description = "System Behaviour Description Language (Compiler)",
7
7
  author = "Michael A. Hicks",
8
8
  author_email = "michael@mahicks.org",
9
9
  url = "https://sbdl.dev",
10
- scripts=['sbdl'],
11
10
  py_modules=['sbdl','csv-to-sbdl','sbdl_server'],
12
11
  license = "Proprietary",
13
12
  python_requires='>=3.6',
14
- install_requires=['networkx','matplotlib','docx2txt','pandas','openpyxl','docxtpl','jinja2']
13
+ install_requires=['networkx','matplotlib','docx2txt','openpyxl','docxtpl','jinja2'],
14
+ entry_points={
15
+ 'console_scripts': [
16
+ 'sbdl = sbdl:run_main',
17
+ ],
18
+ }
15
19
  )
sbdl-1.18.18/sbdl DELETED
@@ -1,5 +0,0 @@
1
- #!/usr/bin/python3
2
- import sys
3
- import subprocess
4
-
5
- subprocess.call([sys.executable, '-m', 'sbdl'] + sys.argv[1:])
File without changes
File without changes
File without changes