mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-11-04 22:40:29 +03:00
import.py: use pathlib and support Windows
This commit is contained in:
parent
7ddcbb3e80
commit
d6eece6395
6 changed files with 175 additions and 153 deletions
|
|
@ -1,20 +1,21 @@
|
|||
# workaround the syntax error from: import fdroidserver.import
|
||||
|
||||
import inspect
|
||||
import os
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
localmodule = os.path.realpath(
|
||||
os.path.join(os.path.dirname(inspect.getfile(inspect.currentframe())), '..'))
|
||||
print('localmodule: ' + localmodule)
|
||||
localmodule = Path(__file__).resolve().parent.parent
|
||||
print('localmodule: ' + str(localmodule))
|
||||
if localmodule not in sys.path:
|
||||
sys.path.insert(0, localmodule)
|
||||
sys.path.insert(0, str(localmodule))
|
||||
|
||||
|
||||
class Options:
|
||||
def __init__(self):
|
||||
self.rev = None
|
||||
self.subdir = None
|
||||
|
||||
|
||||
module = __import__('fdroidserver.import')
|
||||
for name, obj in inspect.getmembers(module):
|
||||
if name == 'import':
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue