Skip to content

Commit

Permalink
Update imports
Browse files Browse the repository at this point in the history
Changed imports to be a try/except for running directly and via installed.
  • Loading branch information
MiM-MiM committed Mar 28, 2022
1 parent 11d792c commit c26be1b
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# User added
.gitignore

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
Expand Down
5 changes: 4 additions & 1 deletion src/HDR10PlusEditor/HDR10Plus/HDR10Plus.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@ def export_as_json(self, saveName):
raise RuntimeError(
f"{__name__ }.export_as_json() expected a string filepath."
)
import HDR10Plus.json as HDR10PlusJSON
try:
import HDR10PlusEditor.HDR10Plus.json as HDR10PlusJSON
except:
import HDR10Plus.json as HDR10PlusJSON

HDR10PlusJSON.export(dct=self.HDR10Plus_DCT, saveName=saveName)

Expand Down
8 changes: 6 additions & 2 deletions src/HDR10PlusEditor/__main__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# /bin/python3
import HDR10PlusEditor.HDR10Plus.json as HDR10PlusJSON
import HDR10PlusEditor.HDR10Plus.HDR10Plus as HDR10Plus
try:
import HDR10PlusEditor.HDR10Plus.json as HDR10PlusJSON
import HDR10PlusEditor.HDR10Plus.HDR10Plus as HDR10Plus
except:
import HDR10Plus.json as HDR10PlusJSON
import HDR10Plus.HDR10Plus as HDR10Plus

def main():
import argparse
Expand Down

0 comments on commit c26be1b

Please sign in to comment.