diff --git a/packages.ini b/packages.ini index 64bed77..38786f8 100644 --- a/packages.ini +++ b/packages.ini @@ -1,5 +1,9 @@ -; SuperPython already has many of the required dependencies, including jinja2 and pygments. -[superpython] +[jinja2] +comment = Used to pre-process configuration files. + +[pygments] +comment = Used for colorizing command output. + +[python-commonkit] comment = Used throughout for its various components and utilities. -scm = https://github.com/develmaycare/superpython -source = https://github.com/develmaycare/superpython +scm = https://github.com/develmaycare/python-commonkit diff --git a/requirements.pip b/requirements.pip index c853276..5caf04a 100644 --- a/requirements.pip +++ b/requirements.pip @@ -1 +1,3 @@ -superpython \ No newline at end of file +jinja2 +pygments +python-commonkit \ No newline at end of file diff --git a/scripttease/cli/initialize.py b/scripttease/cli/initialize.py index 1ec6e7b..70962ba 100644 --- a/scripttease/cli/initialize.py +++ b/scripttease/cli/initialize.py @@ -1,9 +1,9 @@ # Imports +from commonkit import smart_cast from configparser import ConfigParser import logging import os -from superpython.utils import smart_cast from ..constants import LOGGER_NAME log = logging.getLogger(LOGGER_NAME) @@ -14,7 +14,7 @@ __all__ = ( "context_from_cli", "filters_from_cli", "options_from_cli", - "variable_from_file", + "variables_from_file", ) # Functions @@ -78,7 +78,7 @@ def options_from_cli(options): return _options -def variable_from_file(path): +def variables_from_file(path): """Loads variables from a given INI file. :param path: The path to the INI file. diff --git a/scripttease/cli/subcommands.py b/scripttease/cli/subcommands.py index 774f24c..b570041 100644 --- a/scripttease/cli/subcommands.py +++ b/scripttease/cli/subcommands.py @@ -1,7 +1,7 @@ # Imports -from superpython.shell import EXIT -from superpython.utils import highlight_code +from commonkit import highlight_code +from commonkit.shell import EXIT from ..parsers import load_commands, load_config # Exports diff --git a/scripttease/library/commands/templates.py b/scripttease/library/commands/templates.py index 22ddc95..01931ad 100644 --- a/scripttease/library/commands/templates.py +++ b/scripttease/library/commands/templates.py @@ -1,9 +1,9 @@ # Imports +from commonkit import parse_jinja_template, read_file from jinja2.exceptions import TemplateError, TemplateNotFound import logging import os -from superpython.utils import parse_jinja_template, read_file from ...constants import LOGGER_NAME from .base import Command diff --git a/scripttease/library/overlays/centos.py b/scripttease/library/overlays/centos.py index 1b96e24..9c87002 100644 --- a/scripttease/library/overlays/centos.py +++ b/scripttease/library/overlays/centos.py @@ -1,6 +1,6 @@ # Imports -from superpython.utils import split_csv +from commonkit import split_csv from ..commands import Command, Template from .common import COMMON_MAPPINGS from .django import DJANGO_MAPPINGS diff --git a/scripttease/library/overlays/posix.py b/scripttease/library/overlays/posix.py index 3190c0c..6e9e070 100644 --- a/scripttease/library/overlays/posix.py +++ b/scripttease/library/overlays/posix.py @@ -1,7 +1,7 @@ # Imports +from commonkit import indent import os -from superpython.utils import indent from ..commands import Command # Exports @@ -350,7 +350,7 @@ def rsync(source, target, delete=False, exclude=None, host=None, key_file=None, # $(OUTPUTH_PATH) $(SSH_USER)@$(SSH_HOST):$(UPLOAD_PATH) --cvs-exclude; tokens = list() - tokens.append('rsync') + tokens.append("rsync") tokens.append("--cvs-exclude") tokens.append("--checksum") tokens.append("--compress") @@ -492,11 +492,28 @@ class Function(object): """A function that may be used to organize related commands to be called together.""" def __init__(self, name, commands=None, comment=None): + """Initialize a function. + + :param name: The name of the function. + :type name: str + + :param commands: The command instances to be included in the function's output. + :type commands: list + + :param comment: A comment regarding the function. + :type comment: str + + """ self.commands = commands or list() self.comment = comment self.name = name def to_string(self): + """Export the function as a string. + + :rtype: str + + """ a = list() if self.comment is not None: diff --git a/scripttease/library/overlays/ubuntu.py b/scripttease/library/overlays/ubuntu.py index c00005b..7083c0a 100644 --- a/scripttease/library/overlays/ubuntu.py +++ b/scripttease/library/overlays/ubuntu.py @@ -1,6 +1,6 @@ # Imports -from superpython.utils import split_csv +from commonkit import split_csv from ..commands import Command, Template from .common import COMMON_MAPPINGS from .django import DJANGO_MAPPINGS diff --git a/scripttease/parsers/base.py b/scripttease/parsers/base.py index 7e9753d..83f481e 100644 --- a/scripttease/parsers/base.py +++ b/scripttease/parsers/base.py @@ -1,6 +1,6 @@ # Imports -from superpython.utils import File +from commonkit import File from ..factory import Factory from ..library.scripts import Script diff --git a/scripttease/parsers/ini.py b/scripttease/parsers/ini.py index a636025..45f3b1a 100644 --- a/scripttease/parsers/ini.py +++ b/scripttease/parsers/ini.py @@ -1,8 +1,8 @@ # Imports +from commonkit import parse_jinja_template, read_file, smart_cast, split_csv from configparser import ConfigParser, ParsingError import logging -from superpython.utils import parse_jinja_template, read_file, smart_cast, split_csv import os from ..constants import LOGGER_NAME from ..library.commands import ItemizedCommand diff --git a/scripttease/parsers/utils.py b/scripttease/parsers/utils.py index eb8af52..a656ee6 100644 --- a/scripttease/parsers/utils.py +++ b/scripttease/parsers/utils.py @@ -1,7 +1,7 @@ # Imports +from commonkit import any_list_item import logging -from superpython.utils import any_list_item from ..constants import LOGGER_NAME from .ini import Config diff --git a/setup.py b/setup.py index 98f19ce..54c8039 100644 --- a/setup.py +++ b/setup.py @@ -20,15 +20,16 @@ setup( author='Shawn Davis', author_email='shawn@develmaycare.com', url='https://github.com/develmaycare/python-scripttease', - packages=find_packages(exclude=["tests"]), + packages=find_packages(exclude=["tests", "tests.*"]), include_package_data=True, - # superpython provides jinja2 and pygments install_requires=[ - "superpython", - ], - dependency_links=[ - "https://github.com/develmaycare/superpython", + "jinja2", + "pygments", + "python-commonkit", ], + # dependency_links=[ + # "https://github.com/develmaycare/superpython", + # ], classifiers=[ 'Development Status :: 2 - Pre-Alpha', 'Environment :: Console',