aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCamil Staps2016-02-09 09:16:57 +0100
committerCamil Staps2016-02-09 09:16:57 +0100
commit7459a05eba65957cafa2c2afba346bfa4e012334 (patch)
tree13ffc83f7a818a07fc6c8866b4ecabee4a8dd8fb
parentReadme, more functions & output, python standards (diff)
os.path.joinHEADmaster
-rwxr-xr-xcleantools/clmgr.py8
-rw-r--r--cleantools/settings.py2
2 files changed, 5 insertions, 5 deletions
diff --git a/cleantools/clmgr.py b/cleantools/clmgr.py
index 563f60c..cad6b95 100755
--- a/cleantools/clmgr.py
+++ b/cleantools/clmgr.py
@@ -30,8 +30,8 @@ class Library():
"""Get the path of a library in the installation dir"""
install_dir = settings.read()['General']['install_dir']
for path in settings.get_search_paths():
- if os.path.isdir(path + '/' + lib):
- return path + '/' + lib
+ if os.path.isdir(os.path.join(path, lib):
+ return os.path.join(path, lib)
raise ValueError('\'%s\': no such library' % lib)
@staticmethod
@@ -39,7 +39,7 @@ class Library():
"""New library by cloning a repo to the installation dir"""
install_dir = settings.read()['General']['install_dir']
settings.make_install_dir(install_dir)
- Repo.clone_from(repo, install_dir + '/' + local_dir)
+ Repo.clone_from(repo, os.path.join(install_dir, local_dir)
return Library(local_dir)
@click.group()
@@ -74,7 +74,7 @@ def cli_install(abs, repo, local_dir):
clmgr install username/MyLibrary (local_dir will be MyLibrary)
clmgr install --abs /var/git/my-library LocalName"""
if local_dir == None:
- local_dir = list(filter(lambda x: len(x)>0, repo.split('/')))[-1]
+ local_dir = list(filter(lambda x: len(x)>0, repo.split(os.sep)))[-1]
click.secho('No local_dir given, using \'%s\'' % local_dir,
err=True, fg='yellow')
diff --git a/cleantools/settings.py b/cleantools/settings.py
index 67ecd3b..8b39d21 100644
--- a/cleantools/settings.py
+++ b/cleantools/settings.py
@@ -42,7 +42,7 @@ def get_search_paths():
try:
home = config['General']['clean_home']
- try_append(home + '/lib')
+ try_append(os.path.join(home, 'lib'))
except:
pass