From 807fdfe2e3fe0a56148458d80d0e72cd2b2df7f0 Mon Sep 17 00:00:00 2001 From: holger krekel Date: Fri, 29 Apr 2011 20:58:03 +0200 Subject: remove usage of inipkg for now --- CHANGELOG.txt | 2 ++ tox/__init__.py | 32 +++++++++++++++++++------------- tox/_config.py | 3 --- 3 files changed, 21 insertions(+), 16 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 5f93692..544e2c0 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -13,6 +13,8 @@ - change the positional argument specifier to use {posargs:} syntax - Fix issues #15 and #10 with changes to the argument parsing method (many thanks to Chris Rose) +- remove use inipkg lazy importing logic - + the namespace/imports are anyway very small with tox. 0.9 ----------------- diff --git a/tox/__init__.py b/tox/__init__.py index 2cb1461..ccdae2d 100644 --- a/tox/__init__.py +++ b/tox/__init__.py @@ -1,17 +1,23 @@ # __version__ = '1.0.dev1' -from py.apipkg import initpkg +class exception: + class Error(Exception): + def __str__(self): + return "%s: %s" %(self.__class__.__name__, self.args[0]) + class ConfigError(Error): + """ error in tox configuration. """ + class UnsupportedInterpreter(Error): + "signals an unsupported Interpreter" + class InterpreterNotFound(Error): + "signals that an interpreter could not be found" + class InvocationError(Error): + """ an error while invoking a script. """ + class MissingFile(Error): + """ an error while invoking a script. """ + class MissingDirectory(Error): + """ a directory did not exist. """ + class MissingDependency(Error): + """ a dependency could not be found or determined. """ -initpkg(__name__, dict( - cmdline = '._cmdline:main', - exception = dict( - ConfigError = '._config:ConfigError', - InvocationError = '._exception:InvocationError', - MissingDependency= '._exception:MissingDependency', - UnsupportedInterpreter = '._exception:UnsupportedInterpreter', - InterpreterNotFound = '._exception:InterpreterNotFound', - MissingFile = '._exception:MissingFile', - MissingDirectory = '._exception:MissingDirectory', - ) -)) +from tox._cmdline import main as cmdline diff --git a/tox/_config.py b/tox/_config.py index 5d79ee9..d76fed4 100644 --- a/tox/_config.py +++ b/tox/_config.py @@ -78,9 +78,6 @@ class Config: self.envconfigs = {} self.invocationcwd = py.path.local() -class ConfigError(Exception): - """ error in tox configuration. """ - class VenvConfig: def __init__(self, **kw): self.__dict__.update(kw) -- cgit v1.2.1