many improvements from Vladyslav
This commit is contained in:
+11
-13
@@ -16,7 +16,6 @@ import time
|
||||
import datetime
|
||||
from http import HTTP
|
||||
from gzip import open as gzopen
|
||||
from settings import global_settings
|
||||
|
||||
|
||||
__all__ = [
|
||||
@@ -71,16 +70,6 @@ def readlines_file(filename, mode='r'):
|
||||
"applies .split('\n') to the output of read_file()"
|
||||
return read_file(filename, mode).split('\n')
|
||||
|
||||
def abspath(*relpath, **base):
|
||||
"convert relative path to absolute path based (by default) on applications_parent"
|
||||
path = os.path.join(*relpath)
|
||||
gluon = base.get('gluon', False)
|
||||
if os.path.isabs(path):
|
||||
return path
|
||||
if gluon:
|
||||
return os.path.join(global_settings.gluon_parent, path)
|
||||
return os.path.join(global_settings.applications_parent, path)
|
||||
|
||||
|
||||
def mktree(path):
|
||||
head,tail =os.path.split(path)
|
||||
@@ -396,6 +385,15 @@ def make_fake_file_like_object():
|
||||
return LogFile()
|
||||
|
||||
|
||||
|
||||
|
||||
from settings import global_settings # we need to import settings here because
|
||||
# settings imports fileutils too
|
||||
def abspath(*relpath, **base):
|
||||
"convert relative path to absolute path based (by default) on applications_parent"
|
||||
path = os.path.join(*relpath)
|
||||
gluon = base.get('gluon', False)
|
||||
if os.path.isabs(path):
|
||||
return path
|
||||
if gluon:
|
||||
return os.path.join(global_settings.gluon_parent, path)
|
||||
return os.path.join(global_settings.applications_parent, path)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user