Fixing all the imports \o/
authorFrederic Massart <fred@moodle.com>
Mon, 21 Jul 2014 09:13:17 +0000 (17:13 +0800)
committerFrederic Massart <fred@moodle.com>
Mon, 21 Jul 2014 09:34:10 +0000 (17:34 +0800)
37 files changed:
mdk/backup.py
mdk/command.py
mdk/commands/__init__.py
mdk/commands/alias.py
mdk/commands/backport.py
mdk/commands/backup.py
mdk/commands/behat.py
mdk/commands/config.py
mdk/commands/create.py
mdk/commands/css.py
mdk/commands/doctor.py
mdk/commands/fix.py
mdk/commands/info.py
mdk/commands/init.py
mdk/commands/install.py
mdk/commands/js.py
mdk/commands/phpunit.py
mdk/commands/plugin.py
mdk/commands/pull.py
mdk/commands/purge.py
mdk/commands/push.py
mdk/commands/rebase.py
mdk/commands/remove.py
mdk/commands/run.py
mdk/commands/tracker.py
mdk/commands/uninstall.py
mdk/commands/update.py
mdk/commands/upgrade.py
mdk/css.py
mdk/jira.py
mdk/js.py
mdk/mdk.py
mdk/moodle.py
mdk/plugins.py
mdk/scripts.py
mdk/tools.py
mdk/workplace.py

index ad3b493..856e9f1 100644 (file)
@@ -28,11 +28,11 @@ import time
 import logging
 from distutils.dir_util import copy_tree
 
-from tools import chmodRecursive
-from db import DB
-from config import Conf
-from workplace import Workplace
-from exceptions import *
+from .tools import chmodRecursive
+from .db import DB
+from .config import Conf
+from .workplace import Workplace
+from .exceptions import *
 
 C = Conf()
 jason = 'info.json'
index 1eecfdb..34d29cb 100644 (file)
@@ -73,8 +73,8 @@ class Command(object):
     @property
     def Wp(self):
         if not self.__Wp:
-            import workplace
-            self.__Wp = workplace.Workplace()
+            from .workplace import Workplace
+            self.__Wp = Workplace()
         return self.__Wp
 
 
index 44176de..3461bea 100644 (file)
@@ -26,7 +26,7 @@ http://github.com/FMCorz/mdk
 def getCommand(cmd):
     """Lazy loading of a command class. Millseconds saved, hurray!"""
     cls = cmd.capitalize() + 'Command'
-    return getattr(getattr(getattr(__import__('lib.%s.%s' % ('commands', cmd)), 'commands'), cmd), cls)
+    return getattr(getattr(getattr(__import__('mdk.%s.%s' % ('commands', cmd)), 'commands'), cmd), cls)
 
 commandsList = [
     'alias',
index 07e5c47..8b4091d 100644 (file)
@@ -23,7 +23,7 @@ http://github.com/FMCorz/mdk
 """
 
 import argparse
-from lib.command import Command
+from ..command import Command
 
 
 class AliasCommand(Command):
index dac4cd4..e3b36b0 100644 (file)
@@ -23,9 +23,9 @@ http://github.com/FMCorz/mdk
 """
 
 import logging
-from lib import tools, css, jira
-from lib.command import Command
-from lib.tools import yesOrNo
+from .. import tools, css, jira
+from ..command import Command
+from ..tools import yesOrNo
 
 
 class BackportCommand(Command):
index 60dd10f..1323022 100644 (file)
@@ -25,9 +25,9 @@ http://github.com/FMCorz/mdk
 import time
 import logging
 from distutils.errors import DistutilsFileError
-from lib.command import Command
-from lib import backup
-from lib.exceptions import *
+from .. import backup
+from ..command import Command
+from ..exceptions import *
 
 
 class BackupCommand(Command):
index 99c8be8..8bf8c9f 100644 (file)
@@ -28,8 +28,8 @@ import re
 import logging
 import gzip
 from time import sleep
-from lib.command import Command
-from lib.tools import process, ProcessInThread, downloadProcessHook
+from ..command import Command
+from ..tools import process, ProcessInThread, downloadProcessHook
 
 
 class BehatCommand(Command):
index c37cb43..b0949a9 100644 (file)
@@ -23,9 +23,9 @@ http://github.com/FMCorz/mdk
 """
 
 import logging
-from lib.command import Command
-from lib.tools import launchEditor, yesOrNo
-from lib.config import ConfigObject, ConfigFileCouldNotBeLoaded
+from ..command import Command
+from ..tools import launchEditor, yesOrNo
+from ..config import ConfigObject, ConfigFileCouldNotBeLoaded
 
 
 class ConfigCommand(Command):
index 59074d8..ba85f9c 100644 (file)
@@ -25,10 +25,10 @@ http://github.com/FMCorz/mdk
 import re
 import logging
 
-from lib.db import DB
-from lib.command import Command
-from lib.tools import yesOrNo
-from lib.exceptions import CreateException, InstallException
+from ..db import DB
+from ..command import Command
+from ..tools import yesOrNo
+from ..exceptions import CreateException, InstallException
 
 
 class CreateCommand(Command):
index ffb6c00..d46e82e 100644 (file)
@@ -27,8 +27,8 @@ import os
 import time
 import watchdog.events
 import watchdog.observers
-from lib.command import Command
-from lib import css
+from .. import css
+from ..command import Command
 
 
 class CssCommand(Command):
index 5112f11..b5d8139 100644 (file)
@@ -26,9 +26,9 @@ import os
 import shutil
 import imp
 import subprocess
-from lib import git
-from lib.command import Command
-from lib.tools import mkdir, resolveEditor
+from .. import git
+from ..command import Command
+from ..tools import mkdir, resolveEditor
 
 
 class DoctorCommand(Command):
index d8a67be..b6e9232 100644 (file)
@@ -24,7 +24,7 @@ http://github.com/FMCorz/mdk
 
 
 import logging
-from lib.command import Command
+from ..command import Command
 
 
 class FixCommand(Command):
index dcc514a..ac2051b 100644 (file)
@@ -23,7 +23,7 @@ http://github.com/FMCorz/mdk
 """
 
 import logging
-from lib.command import Command
+from ..command import Command
 
 
 class InfoCommand(Command):
index 48e3b4a..472b657 100644 (file)
@@ -29,8 +29,8 @@ import pwd
 import subprocess
 import logging
 
-from lib.command import Command
-from lib.tools import question, get_current_user, mkdir
+from ..command import Command
+from ..tools import question, get_current_user, mkdir
 
 
 class InitCommand(Command):
@@ -112,7 +112,7 @@ class InitCommand(Command):
             pass
 
         # Loading the configuration.
-        from lib.config import Conf as Config
+        from ..config import Conf as Config
         C = Config(userfile=userconfigfile)
 
         # Asks the user what needs to be asked.
index 99f539e..5e595e0 100644 (file)
@@ -24,9 +24,9 @@ http://github.com/FMCorz/mdk
 
 import os
 import logging
-from lib import db
-from lib.command import Command
-from lib.tools import mkdir
+from .. import db
+from ..command import Command
+from ..tools import mkdir
 
 DB = db.DB
 
index e60fdb6..6401218 100644 (file)
@@ -27,8 +27,8 @@ import os
 import time
 import watchdog.events
 import watchdog.observers
-from lib.command import Command
-from lib import js, plugins
+from ..command import Command
+from .. import js, plugins
 
 
 class JsCommand(Command):
index ffd4aca..5e7fdb3 100644 (file)
@@ -26,8 +26,8 @@ import logging
 import os
 import gzip
 import urllib
-from lib.command import Command
-from lib.tools import process
+from ..command import Command
+from ..tools import process
 
 
 class PhpunitCommand(Command):
index 5a78abc..f600ab2 100644 (file)
@@ -22,8 +22,8 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 http://github.com/FMCorz/mdk
 """
 
-from lib.plugins import *
-from lib.command import Command
+from ..plugins import *
+from ..command import Command
 
 
 class PluginCommand(Command):
index aca31d5..2656ce1 100644 (file)
@@ -26,9 +26,9 @@ import re
 import os
 import logging
 from datetime import datetime
-from lib import tools, jira, fetch
-from lib.command import Command
-from lib.tools import question
+from .. import tools, jira, fetch
+from ..command import Command
+from ..tools import question
 
 
 class PullCommand(Command):
index 6cf1a38..35a9d73 100644 (file)
@@ -23,7 +23,7 @@ http://github.com/FMCorz/mdk
 """
 
 import logging
-from lib.command import Command
+from ..command import Command
 
 
 class PurgeCommand(Command):
index b7f7ad0..161bce8 100644 (file)
@@ -23,10 +23,9 @@ http://github.com/FMCorz/mdk
 """
 
 import logging
-import re
-from lib import tools, jira
-from lib.command import Command
-from lib.tools import getMDLFromCommitMessage
+from .. import tools, jira
+from ..command import Command
+from ..tools import getMDLFromCommitMessage
 
 
 class PushCommand(Command):
index 2e236a8..9f024c1 100644 (file)
@@ -23,7 +23,7 @@ http://github.com/FMCorz/mdk
 """
 
 import logging
-from lib.command import Command
+from ..command import Command
 
 
 class RebaseCommand(Command):
index 4b5687f..9175df6 100644 (file)
@@ -23,7 +23,7 @@ http://github.com/FMCorz/mdk
 """
 
 import logging
-from lib.command import Command
+from ..command import Command
 
 
 class RemoveCommand(Command):
index 4cba201..6750752 100644 (file)
@@ -23,8 +23,8 @@ http://github.com/FMCorz/mdk
 """
 
 import logging
-from lib.command import Command
-from lib.scripts import Scripts
+from ..command import Command
+from ..scripts import Scripts
 
 
 class RunCommand(Command):
index 287bb7e..4817bb7 100644 (file)
@@ -25,9 +25,9 @@ http://github.com/FMCorz/mdk
 from datetime import datetime
 import textwrap
 import re
-from lib.command import Command
-from lib.jira import Jira
-from lib.tools import parseBranch
+from ..command import Command
+from ..jira import Jira
+from ..tools import parseBranch
 
 
 class TrackerCommand(Command):
index ec17c5b..c8d0692 100644 (file)
@@ -23,7 +23,7 @@ http://github.com/FMCorz/mdk
 """
 
 import logging
-from lib.command import Command
+from ..command import Command
 
 
 class UninstallCommand(Command):
index 7462633..648c393 100644 (file)
@@ -24,8 +24,8 @@ http://github.com/FMCorz/mdk
 
 import sys
 import logging
-from lib.command import Command
-from lib.exceptions import UpgradeNotAllowed
+from ..command import Command
+from ..exceptions import UpgradeNotAllowed
 
 
 class UpdateCommand(Command):
index 4684dae..07aaac1 100644 (file)
@@ -24,8 +24,8 @@ http://github.com/FMCorz/mdk
 
 import sys
 import logging
-from lib.command import Command
-from lib.exceptions import UpgradeNotAllowed
+from ..command import Command
+from ..exceptions import UpgradeNotAllowed
 
 class UpgradeCommand(Command):
 
index 07b3726..b1f86da 100644 (file)
@@ -24,8 +24,8 @@ http://github.com/FMCorz/mdk
 
 import logging
 import os
-from tools import process
-from config import Conf
+from .tools import process
+from .config import Conf
 
 C = Conf()
 
index 177a637..32d0429 100644 (file)
@@ -23,8 +23,8 @@ http://github.com/FMCorz/mdk
 """
 
 import json
-from tools import question
-from config import Conf
+from .tools import question
+from .config import Conf
 from urlparse import urlparse
 from datetime import datetime
 import re
index ba1b381..d741892 100644 (file)
--- a/mdk/js.py
+++ b/mdk/js.py
@@ -24,9 +24,9 @@ http://github.com/FMCorz/mdk
 
 import logging
 import os
-from tools import process
-from config import Conf
-from plugins import PluginManager
+from .tools import process
+from .config import Conf
+from .plugins import PluginManager
 
 C = Conf()
 
index aee7c22..bcd5471 100755 (executable)
@@ -27,11 +27,11 @@ import argparse
 import os
 import re
 import logging
-from lib.command import CommandRunner
-from lib.commands import getCommand, commandsList
-from lib.config import Conf
-from lib.tools import process
-from version import __version__
+from .command import CommandRunner
+from .commands import getCommand, commandsList
+from .config import Conf
+from .tools import process
+from .version import __version__
 
 C = Conf()
 
index 365ffef..85a2a34 100644 (file)
@@ -28,13 +28,13 @@ import logging
 import shutil
 from tempfile import gettempdir
 
-from tools import getMDLFromCommitMessage, mkdir, process, parseBranch
-from db import DB
-from config import Conf
-from git import Git, GitException
-from exceptions import InstallException, UpgradeNotAllowed
-from jira import Jira, JiraException
-from scripts import Scripts
+from .tools import getMDLFromCommitMessage, mkdir, process, parseBranch
+from .db import DB
+from .config import Conf
+from .git import Git, GitException
+from .exceptions import InstallException, UpgradeNotAllowed
+from .jira import Jira, JiraException
+from .scripts import Scripts
 
 C = Conf()
 
index 6dbd874..e3a7461 100644 (file)
@@ -31,8 +31,8 @@ import zipfile
 import re
 import shutil
 from tempfile import gettempdir
-from config import Conf
-import tools
+from .config import Conf
+from . import tools
 
 C = Conf()
 
index ee73667..94066a6 100644 (file)
@@ -26,9 +26,9 @@ import os
 import shutil
 import stat
 import logging
-from tools import process
-from config import Conf
-from exceptions import ScriptNotFound, ConflictInScriptName, UnsupportedScript
+from .tools import process
+from .config import Conf
+from .exceptions import ScriptNotFound, ConflictInScriptName, UnsupportedScript
 
 C = Conf()
 
index 4ae461c..e277113 100644 (file)
@@ -33,7 +33,7 @@ import getpass
 import logging
 import hashlib
 import tempfile
-from lib.config import Conf
+from .config import Conf
 
 C = Conf()
 
index b598f12..7a5f226 100644 (file)
@@ -25,11 +25,11 @@ http://github.com/FMCorz/mdk
 import os
 import shutil
 import logging
-from tools import mkdir, process, stableBranch
-from exceptions import CreateException
-from config import Conf
-import git
-import moodle
+from .tools import mkdir, process, stableBranch
+from .exceptions import CreateException
+from .config import Conf
+from . import git
+from . import moodle
 
 C = Conf()