Skip to content

Commit

Permalink
Minor changes
Browse files Browse the repository at this point in the history
* New dimensionless unit, "dimensionless" (to specify in case of need)
* Ignore new configuration file for deployment at new ITC server
* "Issues" changed to Issue attrib class
* Clearer message when mandatory header columns are missing.
  • Loading branch information
rnebot committed Apr 10, 2021
1 parent 96eaae8 commit 77c6431
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 5 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,4 @@ nexinfosys/command_generators/parser_spreadsheet_utils_accel.c
nexinfosys/command_generators/parser_spreadsheet_utils_accel.cpython-37m-x86_64-linux-gnu.so

nexinfosys/restful_service/helper_accel.c
/nexinfosys/restful_service/nis_docker_beauvoir.conf
1 change: 1 addition & 0 deletions nexinfosys/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
ureg.define("euro = [] = EUR = Eur = eur = Euro = Euros = €")
ureg.define("dollar = [] = USD = Usd = usd = Dollar = Dollars = $")
ureg.define("capita = []")
ureg.define("dimensionless = []")

# Named tuples
Issue = namedtuple("Issue",
Expand Down
4 changes: 2 additions & 2 deletions nexinfosys/command_generators/parser_spreadsheet.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ def commands_generator_from_ooxml_file(input, state, sublist, stack) -> nexinfos
if isinstance(i, nexinfosys.command_generators.Issue):
if i.itype == IType.ERROR:
errors += 1
issue = Issue(sheet_number, sheet_name, c_type, i.itype, i.description)
issue = i # Issue(sheet_number, sheet_name, c_type, i.itype, i.description)
else:
if i[0] == 3:
errors += 1
Expand All @@ -220,7 +220,7 @@ def commands_generator_from_ooxml_file(input, state, sublist, stack) -> nexinfos
if issues:
for i in issues:
if isinstance(i, nexinfosys.command_generators.Issue):
issue = Issue(sheet_number, sheet_name, c_type, i.itype, i.description)
issue = i # Issue(sheet_number, sheet_name, c_type, i.itype, i.description)
else:
issue = Issue(sheet_number, sheet_name, c_type, IType(i[0]), i[1])

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,13 @@ def check_columns(sh, name: str, area: Tuple, cols: List[CommandField], command_
break
else: # No match for the column "col_name"
issues.append(Issue(itype=IType.WARNING if ignore_not_found else IType.ERROR,
description=f"The column name '{col_name}' does not match any of the "
description=f"In Header row, the column name '{col_name}' does not match any of the "
f"allowed column names (internal command '{command_name}')",
location=IssueLocation(sheet_name=name, row=1, column=c)))

if len(mandatory_not_found) > 0:
issues.append(Issue(itype=IType.ERROR,
description="Mandatory columns: " + ", ".join(
description="In Header row, mandatory columns: " + ", ".join(
mandatory_not_found) + " have not been specified",
location=IssueLocation(sheet_name=name, row=1, column=None)))

Expand Down
3 changes: 2 additions & 1 deletion nexinfosys/model_services/workspace.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,9 @@ def execute_command_container_file(state, generator_type, file_type: str, file):
cmd_number = 0
for cmd, issues in commands_generator:
if len(issues) > 0:
new_issues, errors_exist = transform_issues(issues, cmd, cmd_number)
c = "\n"
print(f"Issues:\n{c.join([i.message for i in issues])}")
print(f"Issues:\n{c.join([i.description for i in new_issues])}")
else:
print(f"{type(cmd)} {cmd._source_block_name if hasattr(cmd, '_source_block_name') else ''}; # syntax issues: {len(issues)}")
cmd_number += 1 # Command counter
Expand Down

0 comments on commit 77c6431

Please sign in to comment.