cleanup: rename suffix argument

This commit is contained in:
2014-12-05 10:10:54 +01:00
parent 8613e98327
commit 3d162bf9bc

View File

@@ -64,7 +64,7 @@ class bam_config:
SESSION_FILE = ".bam_paths_remap.json" SESSION_FILE = ".bam_paths_remap.json"
@staticmethod @staticmethod
def find_basedir(cwd=None, suffix=None, abort=False, test_subpath=CONFIG_DIR, descr="<unknown>"): def find_basedir(cwd=None, path_suffix=None, abort=False, test_subpath=CONFIG_DIR, descr="<unknown>"):
""" """
Return the config path (or None when not found) Return the config path (or None when not found)
Actually should raise an error? Actually should raise an error?
@@ -82,8 +82,8 @@ class bam_config:
while parent != parent_prev: while parent != parent_prev:
test_dir = os.path.join(parent, test_subpath) test_dir = os.path.join(parent, test_subpath)
if os.path.exists(test_dir): if os.path.exists(test_dir):
if suffix is not None: if path_suffix is not None:
test_dir = os.path.join(test_dir, suffix) test_dir = os.path.join(test_dir, path_suffix)
return test_dir return test_dir
parent_prev = parent parent_prev = parent
@@ -95,13 +95,13 @@ class bam_config:
return None return None
@staticmethod @staticmethod
def find_rootdir(cwd=None, suffix=None, abort=False, test_subpath=CONFIG_DIR, descr="<unknown>"): def find_rootdir(cwd=None, path_suffix=None, abort=False, test_subpath=CONFIG_DIR, descr="<unknown>"):
""" """
find_basedir(), without '.bam' suffix find_basedir(), without '.bam' suffix
""" """
path = bam_config.find_basedir( path = bam_config.find_basedir(
cwd=cwd, cwd=cwd,
suffix=suffix, path_suffix=path_suffix,
abort=abort, abort=abort,
test_subpath=test_subpath, test_subpath=test_subpath,
) )
@@ -133,7 +133,7 @@ class bam_config:
def load(id_="config", cwd=None, abort=False): def load(id_="config", cwd=None, abort=False):
filepath = bam_config.find_basedir( filepath = bam_config.find_basedir(
cwd=cwd, cwd=cwd,
suffix=id_, path_suffix=id_,
descr="bam repository", descr="bam repository",
) )
if abort is True: if abort is True:
@@ -147,7 +147,7 @@ class bam_config:
def write(id_="config", data=None, cwd=None): def write(id_="config", data=None, cwd=None):
filepath = bam_config.find_basedir( filepath = bam_config.find_basedir(
cwd=cwd, cwd=cwd,
suffix=id_, path_suffix=id_,
descr="bam repository", descr="bam repository",
) )