commit: ddb28916e73660871ca8a6f41d69d9dd42ab9f0c
Author: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Tue Feb 17 05:05:31 2015 +0000
Commit: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Tue Feb 17 05:06:08 2015 +0000
URL:
http://sources.gentoo.org/gitweb/?p=proj/layman.git;a=commit;h=ddb28916
Move Layman class initialization into a layman sub-file to prevent un-needed
imports
setup.py was indirectly causing multiple imports just to get the version.
This minimizes the imports for simple layman imports like obtaining version.
---
layman/__init__.py | 45 ---------------------------------------
layman/{__init__.py => layman.py} | 0
2 files changed, 45 deletions(-)
diff --git a/layman/__init__.py b/layman/__init__.py
index 3f70381..932dc55 100644
--- a/layman/__init__.py
+++ b/layman/__init__.py
@@ -5,48 +5,3 @@
on all gentoo repositories and overlays
"""
-from __future__ import unicode_literals
-
-import sys
-
-try:
- from layman.api import LaymanAPI
- from layman.config import BareConfig
- from layman.output import Message
-except ImportError:
- sys.stderr.write("!!! Layman API imports failed.")
- raise
-
-
-
-class Layman(LaymanAPI):
- """A complete high level interface capable of performing all
- overlay repository actions."""
-
- def __init__(self, stdout=sys.stdout, stdin=sys.stdin, stderr=sys.stderr,
- config=None, read_configfile=True, quiet=False, quietness=4,
- verbose=False, nocolor=False, width=0, root=None
- ):
- """Input parameters are optional to override the defaults.
- sets up our LaymanAPI with defaults or passed in values
- and returns an instance of it"""
- self.message = Message(out=stdout, err=stderr)
- self.config = BareConfig(
- output=self.message,
- stdout=stdout,
- stdin=stdin,
- stderr=stderr,
- config=config,
- read_configfile=read_configfile,
- quiet=quiet,
- quietness=quietness,
- verbose=verbose,
- nocolor=nocolor,
- width=width,
- root=root
- )
- LaymanAPI.__init__(self, self.config,
- report_errors=True,
- output=self.config['output']
- )
- return
diff --git a/layman/__init__.py b/layman/layman.py
similarity index 100%
copy from layman/__init__.py
copy to layman/layman.py