Skip to content

Commit

Permalink
Merge pull request #37 from Ultimaker/fix/typing-in-comment-backward-…
Browse files Browse the repository at this point in the history
…compatibility

Python 3.4, print-cluster, backward compatibility
  • Loading branch information
Xiaozhou Li authored Sep 7, 2021
2 parents f132ccf + 136a2f1 commit 110d700
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Charon/filetypes/OpenPackagingConvention.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class OpenPackagingConvention(FileInterface):
_global_metadata_file = "/Metadata/OPC_Global.json" # Where the global metadata file is.
_opc_metadata_relationship_type = "http://schemas.ultimaker.org/package/2018/relationships/opc_metadata" # Unique identifier of the relationship type that relates OPC metadata to files.
_metadata_prefix = "/metadata"
_aliases:Dict[str, str] = OrderedDict([]) # A standard OPC file doest not have default aliases. These must be implemented in inherited classes.
_aliases = OrderedDict([]) # type: Dict[str, str] # A standard OPC file doest not have default aliases. These must be implemented in inherited classes.

mime_type = "application/x-opc"

Expand Down Expand Up @@ -299,7 +299,7 @@ def _processAliases(self, virtual_path: str) -> str:
# Replace all aliases.
for regex, replacement in self._aliases.items():
if regex.startswith("/"):
expression = rf"^{regex}"
expression = r"^" + regex
else:
expression = regex
virtual_path = re.sub(expression, replacement, virtual_path)
Expand Down
1 change: 1 addition & 0 deletions mypy.ini
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
[mypy]
python_version = 3.4
disallow_untyped_calls = False
disallow_untyped_defs = False
disallow_incomplete_defs = False
Expand Down

0 comments on commit 110d700

Please sign in to comment.