Valentin Niess пре 5 година
родитељ
комит
f8a4c10644

+ 2 - 2
python_appimage/__main__.py

@@ -4,7 +4,7 @@ import logging
 import os
 import sys
 
-from .deps import fetch_all
+from .utils.deps import fetch_all
 
 
 __all__ = ['main']
@@ -50,7 +50,7 @@ def main():
         sys.exit(0)
 
     # Call the AppImage builder
-    builder = import_module('.' + args.builder, package=__package__)
+    builder = import_module('.builders.' + args.builder, package=__package__)
     builder.build(*builder._unpack_args(args))
 
 

+ 5 - 0
python_appimage/actions/__init__.py

@@ -0,0 +1,5 @@
+from .build import build_appimage
+from .relocate import patch_binary, relocate_python
+
+
+__all__ = ['build_appimage', 'patch_binary', 'relocate_python']

+ 5 - 5
python_appimage/build.py → python_appimage/actions/build.py

@@ -2,11 +2,11 @@ import os
 import subprocess
 import sys
 
-from .deps import APPIMAGETOOL, ensure_appimagetool
-from .docker import docker_run
-from .fs import copy_tree
-from .log import debug, log
-from .tmp import TemporaryDirectory
+from ..utils.deps import APPIMAGETOOL, ensure_appimagetool
+from ..utils.docker import docker_run
+from ..utils.fs import copy_tree
+from ..utils.log import debug, log
+from ..utils.tmp import TemporaryDirectory
 
 
 __all__ = ['build_appimage']

+ 5 - 5
python_appimage/relocate.py → python_appimage/actions/relocate.py

@@ -4,11 +4,11 @@ import re
 import shutil
 import sys
 
-from .deps import EXCLUDELIST, PATCHELF, PREFIX, ensure_excludelist,           \
-                  ensure_patchelf
-from .fs import make_tree, copy_file, copy_tree, remove_file, remove_tree
-from .log import debug, log
-from .system import ldd, system
+from ..utils.deps import EXCLUDELIST, PATCHELF, PREFIX, ensure_excludelist,    \
+                         ensure_patchelf
+from ..utils.fs import make_tree, copy_file, copy_tree, remove_file, remove_tree
+from ..utils.log import debug, log
+from ..utils.system import ldd, system
 
 
 __all__ = ["patch_binary", "relocate_python"]

+ 0 - 0
python_appimage/builders/__init__.py


+ 2 - 3
python_appimage/local.py → python_appimage/builders/local.py

@@ -2,9 +2,8 @@ import glob
 import os
 import shutil
 
-from .build import build_appimage
-from .relocate import relocate_python
-from .tmp import TemporaryDirectory
+from ..actions import build_appimage, relocate_python
+from ..utils.tmp import TemporaryDirectory
 
 
 __all__ = ['build']

+ 5 - 6
python_appimage/manylinux.py → python_appimage/builders/manylinux.py

@@ -4,11 +4,10 @@ import platform
 import shutil
 import sys
 
-from .build import build_appimage
-from .docker import docker_run
-from .fs import copy_tree
-from .relocate import relocate_python
-from .tmp import TemporaryDirectory
+from ..actions import build_appimage, relocate_python
+from ..utils.docker import docker_run
+from ..utils.fs import copy_tree
+from ..utils.tmp import TemporaryDirectory
 
 
 __all__ = ['build']
@@ -42,7 +41,7 @@ def build(tag, abi, contained=False):
         python = '/opt/python/' + abi + '/bin/python'
 
         pwd = os.getcwd()
-        dirname = os.path.abspath(os.path.dirname(__file__))
+        dirname = os.path.abspath(os.path.dirname(__file__) + '/..')
         with TemporaryDirectory() as tmpdir:
             copy_tree(dirname, 'python_appimage')
 

+ 0 - 0
python_appimage/utils/__init__.py


+ 1 - 1
python_appimage/deps.py → python_appimage/utils/deps.py

@@ -17,7 +17,7 @@ __all__ = ['APPIMAGETOOL', 'EXCLUDELIST', 'PATCHELF', 'PREFIX',
 _ARCH = platform.machine()
 
 
-PREFIX = os.path.abspath(os.path.dirname(__file__))
+PREFIX = os.path.abspath(os.path.dirname(__file__) + '/..')
 '''Package installation prefix'''
 
 APPIMAGETOOL = PREFIX + '/bin/appimagetool.' + _ARCH

+ 0 - 0
python_appimage/docker.py → python_appimage/utils/docker.py


+ 0 - 0
python_appimage/fs.py → python_appimage/utils/fs.py


+ 0 - 0
python_appimage/log.py → python_appimage/utils/log.py


+ 0 - 0
python_appimage/system.py → python_appimage/utils/system.py


+ 0 - 0
python_appimage/tmp.py → python_appimage/utils/tmp.py


+ 0 - 0
python_appimage/url.py → python_appimage/utils/url.py