From 7258e21adbebe498da67b26099900c2bb3a61dc4 Mon Sep 17 00:00:00 2001 From: Jerome Lebleu Date: Wed, 26 Mar 2014 01:50:14 +0100 Subject: [PATCH] Move src/moulinette to the root --- bin/yunohost | 9 ++++++--- bin/yunohost-api | 13 +++++++------ {src/moulinette => moulinette}/__init__.py | 0 {src/moulinette => moulinette}/actionsmap.py | 0 .../authenticators/__init__.py | 0 .../authenticators/ldap.py | 0 {src/moulinette => moulinette}/core.py | 0 {src/moulinette => moulinette}/helpers.py | 0 .../interfaces/__init__.py | 0 {src/moulinette => moulinette}/interfaces/api.py | 0 {src/moulinette => moulinette}/interfaces/cli.py | 0 {src/moulinette => moulinette}/package.py | 0 {src/moulinette => moulinette}/package.py.in | 0 13 files changed, 13 insertions(+), 9 deletions(-) rename {src/moulinette => moulinette}/__init__.py (100%) rename {src/moulinette => moulinette}/actionsmap.py (100%) rename {src/moulinette => moulinette}/authenticators/__init__.py (100%) rename {src/moulinette => moulinette}/authenticators/ldap.py (100%) rename {src/moulinette => moulinette}/core.py (100%) rename {src/moulinette => moulinette}/helpers.py (100%) rename {src/moulinette => moulinette}/interfaces/__init__.py (100%) rename {src/moulinette => moulinette}/interfaces/api.py (100%) rename {src/moulinette => moulinette}/interfaces/cli.py (100%) rename {src/moulinette => moulinette}/package.py (100%) rename {src/moulinette => moulinette}/package.py.in (100%) diff --git a/bin/yunohost b/bin/yunohost index 4c0919f7..6b253334 100755 --- a/bin/yunohost +++ b/bin/yunohost @@ -4,10 +4,13 @@ import sys import os.path +from_source = False + # Run from source basedir = os.path.abspath('%s/../' % os.path.dirname(__file__)) -if os.path.isdir('%s/src' % basedir): - sys.path.insert(0, '%s/src' % basedir) +if os.path.isdir('%s/moulinette' % basedir): + sys.path.insert(0, basedir) + from_source = True from moulinette import init, cli, MoulinetteError from moulinette.helpers import YunoHostError, colorize @@ -17,7 +20,7 @@ from moulinette.helpers import YunoHostError, colorize if __name__ == '__main__': # Run from source - init(_from_source=True) + init(_from_source=from_source) # Additional arguments use_cache = True diff --git a/bin/yunohost-api b/bin/yunohost-api index 1c1538a8..744e16b7 100755 --- a/bin/yunohost-api +++ b/bin/yunohost-api @@ -4,10 +4,13 @@ import sys import os.path +from_source = False + # Run from source -basedir = os.path.abspath(os.path.dirname(__file__) +'/../') -if os.path.isdir(basedir +'/src'): - sys.path.append(basedir +'/src') +basedir = os.path.abspath('%s/../' % os.path.dirname(__file__)) +if os.path.isdir('%s/moulinette' % basedir): + sys.path.insert(0, basedir) + from_source = True from moulinette import init, api, MoulinetteError @@ -29,15 +32,13 @@ def is_installed(): if __name__ == '__main__': # Run from source - init(_from_source=True) + init(_from_source=from_source) # Additional arguments use_cache = True if '--no-cache' in sys.argv: use_cache = False sys.argv.remove('--no-cache') - if '--debug' in sys.argv: - sys.argv.remove('--debug') # TODO: Add log argument try: diff --git a/src/moulinette/__init__.py b/moulinette/__init__.py similarity index 100% rename from src/moulinette/__init__.py rename to moulinette/__init__.py diff --git a/src/moulinette/actionsmap.py b/moulinette/actionsmap.py similarity index 100% rename from src/moulinette/actionsmap.py rename to moulinette/actionsmap.py diff --git a/src/moulinette/authenticators/__init__.py b/moulinette/authenticators/__init__.py similarity index 100% rename from src/moulinette/authenticators/__init__.py rename to moulinette/authenticators/__init__.py diff --git a/src/moulinette/authenticators/ldap.py b/moulinette/authenticators/ldap.py similarity index 100% rename from src/moulinette/authenticators/ldap.py rename to moulinette/authenticators/ldap.py diff --git a/src/moulinette/core.py b/moulinette/core.py similarity index 100% rename from src/moulinette/core.py rename to moulinette/core.py diff --git a/src/moulinette/helpers.py b/moulinette/helpers.py similarity index 100% rename from src/moulinette/helpers.py rename to moulinette/helpers.py diff --git a/src/moulinette/interfaces/__init__.py b/moulinette/interfaces/__init__.py similarity index 100% rename from src/moulinette/interfaces/__init__.py rename to moulinette/interfaces/__init__.py diff --git a/src/moulinette/interfaces/api.py b/moulinette/interfaces/api.py similarity index 100% rename from src/moulinette/interfaces/api.py rename to moulinette/interfaces/api.py diff --git a/src/moulinette/interfaces/cli.py b/moulinette/interfaces/cli.py similarity index 100% rename from src/moulinette/interfaces/cli.py rename to moulinette/interfaces/cli.py diff --git a/src/moulinette/package.py b/moulinette/package.py similarity index 100% rename from src/moulinette/package.py rename to moulinette/package.py diff --git a/src/moulinette/package.py.in b/moulinette/package.py.in similarity index 100% rename from src/moulinette/package.py.in rename to moulinette/package.py.in