summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy Grover <agrover@redhat.com>2014-12-02 16:42:51 -0800
committerAndy Grover <agrover@redhat.com>2014-12-02 16:42:51 -0800
commitd9c5c18d9fe16db5355172555093dba23e08f351 (patch)
tree730862aa4e6767250d19603c13e9664bd8196a74
parent38452d9af048e95344a82bc3275ffd095eff8699 (diff)
downloadconfigshell-fb-d9c5c18d9fe16db5355172555093dba23e08f351.tar.gz
Package as both 'configshell' and 'configshell_fb'
We have changed the API from Datera configshell, so we should be using a different package name to eliminate confusion. Still package under configshell pkg name, but issue a warning to switch. Change code in shell.py to use relative imports instead of package name. Signed-off-by: Andy Grover <agrover@redhat.com>
-rw-r--r--configshell/__init__.py5
-rw-r--r--configshell/shell.py9
-rwxr-xr-xsetup.py3
3 files changed, 11 insertions, 6 deletions
diff --git a/configshell/__init__.py b/configshell/__init__.py
index e6649b7..2719406 100644
--- a/configshell/__init__.py
+++ b/configshell/__init__.py
@@ -15,6 +15,11 @@ License for the specific language governing permissions and limitations
under the License.
'''
+if __name__ == "configshell":
+ from warnings import warn
+ warn("'configshell' package name for configshell-fb is deprecated, please"
+ + " instead import 'configshell_fb'", UserWarning, stacklevel=2)
+
from log import Log
from console import Console
from shell import ConfigShell
diff --git a/configshell/shell.py b/configshell/shell.py
index e4bd9ea..80bba78 100644
--- a/configshell/shell.py
+++ b/configshell/shell.py
@@ -20,11 +20,10 @@ import sys
from pyparsing import Empty, Group, OneOrMore, Optional, ParseResults, Regex, Suppress, Word
from pyparsing import alphanums
-import configshell.log as log
-import configshell.prefs as prefs
-import configshell.console as console
-
-from configshell.node import ConfigNode, ExecutionError
+from . import log
+from . import prefs
+from . import console
+from .node import ConfigNode, ExecutionError
# A fix for frozen packages
import signal
diff --git a/setup.py b/setup.py
index 4ba9866..b9ac364 100755
--- a/setup.py
+++ b/setup.py
@@ -26,6 +26,7 @@ setup(
maintainer = 'Andy Grover',
maintainer_email = 'agrover@redhat.com',
url = 'http://github.com/agrover/configshell-fb',
- packages = ['configshell'],
+ packages = ['configshell', 'configshell_fb'],
+ package_dir = {'configshell_fb': 'configshell'},
use_2to3 = True,
)