mirror of https://github.com/tLDP/python-tldp
moving sameFilesystem to utils.py
This commit is contained in:
parent
ea2139373c
commit
7aa99ec502
|
@ -16,7 +16,8 @@ from tldp.sources import SourceDocument, arg_issourcedoc
|
||||||
from tldp.outputs import OutputDirectory
|
from tldp.outputs import OutputDirectory
|
||||||
from tldp.inventory import Inventory, status_classes, status_types, stypes
|
from tldp.inventory import Inventory, status_classes, status_types, stypes
|
||||||
from tldp.config import collectconfiguration
|
from tldp.config import collectconfiguration
|
||||||
from tldp.utils import arg_isloglevel, arg_isdirectory, swapdirs
|
from tldp.utils import arg_isloglevel, arg_isdirectory
|
||||||
|
from tldp.utils import swapdirs, sameFilesystem
|
||||||
from tldp.doctypes.common import preamble, postamble
|
from tldp.doctypes.common import preamble, postamble
|
||||||
|
|
||||||
logformat = '%(levelname)-9s %(name)s %(filename)s#%(lineno)s ' \
|
logformat = '%(levelname)-9s %(name)s %(filename)s#%(lineno)s ' \
|
||||||
|
@ -39,7 +40,6 @@ ERR_UNKNOWNARGS = "Unknown arguments received: "
|
||||||
ERR_EXTRAARGS = "Extra arguments received: "
|
ERR_EXTRAARGS = "Extra arguments received: "
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def show_doctypes(config, *args, **kwargs):
|
def show_doctypes(config, *args, **kwargs):
|
||||||
if args:
|
if args:
|
||||||
return ERR_EXTRAARGS + ' '.join(args)
|
return ERR_EXTRAARGS + ' '.join(args)
|
||||||
|
@ -368,10 +368,6 @@ def extractExplicitDocumentArgs(config, args):
|
||||||
return docs, remainder
|
return docs, remainder
|
||||||
|
|
||||||
|
|
||||||
def sameFilesystem(d0, d1):
|
|
||||||
return os.stat(d0).st_dev == os.stat(d1).st_dev
|
|
||||||
|
|
||||||
|
|
||||||
def collectWorkset(config, args):
|
def collectWorkset(config, args):
|
||||||
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
# -- argument handling logic; try to avoid creating an inventory unless it
|
# -- argument handling logic; try to avoid creating an inventory unless it
|
||||||
|
|
|
@ -75,6 +75,10 @@ def arg_isexecutable(f):
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
|
||||||
|
def sameFilesystem(d0, d1):
|
||||||
|
return os.stat(d0).st_dev == os.stat(d1).st_dev
|
||||||
|
|
||||||
|
|
||||||
def stem_and_ext(name):
|
def stem_and_ext(name):
|
||||||
'''return (stem, ext) for any relative or absolute filename'''
|
'''return (stem, ext) for any relative or absolute filename'''
|
||||||
return os.path.splitext(os.path.basename(os.path.normpath(name)))
|
return os.path.splitext(os.path.basename(os.path.normpath(name)))
|
||||||
|
|
Loading…
Reference in New Issue