Michał Górny avatar Michał Górny committed 3679d17

Use relative imports.

Comments (0)

Files changed (12)

smartliverebuild/cli.py

 
 from gentoopm import get_package_manager
 
-from smartliverebuild import PV
-from smartliverebuild.config import Config, conf_getvcs
-from smartliverebuild.core import SmartLiveRebuild, SLRFailure
-from smartliverebuild.output import out
+from . import PV
+from .config import Config, conf_getvcs
+from .core import SmartLiveRebuild, SLRFailure
+from .output import out
 
 def check_vcslist(opt, optstr, val):
 	val = val.split(',')

smartliverebuild/config.py

 except ImportError: # py2
 	from ConfigParser import ConfigParser, NoOptionError
 
-from smartliverebuild.output import out
-from smartliverebuild.vcsload import VCSLoader
+from .output import out
+from .vcsload import VCSLoader
 
 conf_getvcs = VCSLoader()
 

smartliverebuild/core.py

 
 import os, os.path, pickle, signal, subprocess, sys, time
 
-from smartliverebuild.filtering import PackageFilter
-from smartliverebuild.output import out
-from smartliverebuild.vcs import NonLiveEbuild
-from smartliverebuild.vcsload import VCSLoader
+from .filtering import PackageFilter
+from .output import out
+from .vcs import NonLiveEbuild
+from .vcsload import VCSLoader
 
 class SLRFailure(Exception):
 	pass

smartliverebuild/vcs/__init__.py

 from gentoopm.util import ABCObject
 from abc import abstractproperty
 
-from smartliverebuild.output import out
+from ..output import out
 
 class NonLiveEbuild(Exception):
 	""" A simple exception to be raised whenever the package is tied to

smartliverebuild/vcs/bzr.py

 # (c) 2011 Michał Górny <mgorny@gentoo.org>
 # Released under the terms of the 2-clause BSD license.
 
-from smartliverebuild.vcs import RemoteVCSSupport, NonLiveEbuild
+from . import RemoteVCSSupport, NonLiveEbuild
 
 class BzrSupport(RemoteVCSSupport):
 	reqenv = ['EBZR_REPO_URI', 'EBZR_REVNO', 'EBZR_REVNO_CMD']

smartliverebuild/vcs/cvs.py

 
 import hashlib, locale, tempfile
 
-from smartliverebuild.vcs import CheckoutVCSSupport
+from . import CheckoutVCSSupport
 
 class CVSSupport(CheckoutVCSSupport):
 	reqenv = ['ECVS_AUTH', 'ECVS_CVS_COMMAND', 'ECVS_MODULE', 'ECVS_SERVER', 'ECVS_TOP_DIR', 'ECVS_USER']

smartliverebuild/vcs/darcs.py

 
 import re
 
-from smartliverebuild.vcs import CheckoutVCSSupport
+from . import CheckoutVCSSupport
 
 class DarcsSupport(CheckoutVCSSupport):
 	reqenv = ['EDARCS_REPOSITORY', 'EDARCS_GET_CMD', 'EDARCS_UPDATE_CMD',

smartliverebuild/vcs/git.py

 # (c) 2011 Michał Górny <mgorny@gentoo.org>
 # Released under the terms of the 2-clause BSD license.
 
-from smartliverebuild.vcs.git_2 import Git2Support
+from .git_2 import Git2Support
 
 class GitSupport(Git2Support):
 	def __init__(self, *args, **kwargs):

smartliverebuild/vcs/git_2.py

 # (c) 2011 Michał Górny <mgorny@gentoo.org>
 # Released under the terms of the 2-clause BSD license.
 
-from smartliverebuild.vcs import RemoteVCSSupport, NonLiveEbuild
+from . import RemoteVCSSupport, NonLiveEbuild
 
 class Git2Support(RemoteVCSSupport):
 	reqenv = ['EGIT_BRANCH', 'EGIT_REPO_URI', 'EGIT_VERSION']

smartliverebuild/vcs/mercurial.py

 # (c) 2011 Michał Górny <mgorny@gentoo.org>
 # Released under the terms of the 2-clause BSD license.
 
-from smartliverebuild.vcs import RemoteVCSSupport
+from . import RemoteVCSSupport
 
 class MercurialSupport(RemoteVCSSupport):
 	reqenv = ['EHG_REPO_URI', 'EHG_REVISION', 'HG_REV_ID']

smartliverebuild/vcs/subversion.py

 
 import re
 
-from smartliverebuild.vcs import RemoteVCSSupport, NonLiveEbuild
+from . import RemoteVCSSupport, NonLiveEbuild
 
 class SubversionSupport(RemoteVCSSupport):
 	reqenv = ['ESVN_REPO_URI', 'ESVN_STORE_DIR', 'ESVN_WC_REVISION']

smartliverebuild/vcsload.py

 # (c) 2011 Michał Górny <mgorny@gentoo.org>
 # Released under the terms of the 2-clause BSD license.
 
-from smartliverebuild.vcs import RemoteVCSSupport
+from .vcs import RemoteVCSSupport
 
 class VCSLoader(object):
 	vcs_cache = {}
 		if eclassname not in self.vcs_cache:
 			self.vcs_cache[eclassname] = None
 			if not allowed or eclassname in allowed:
-				modname = 'smartliverebuild.vcs.%s' % eclassname.replace('-', '_')
+				modname = 'vcs.%s' % eclassname.replace('-', '_')
 				try:
-					mod = __import__(modname, {}, {}, ['.'], 0)
+					mod = __import__(modname, fromlist=['.'], globals=globals(), level=1)
 				except ImportError:
 					pass
 				else:
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.