Migrated to python-commonkit.

development
Shawn Davis 4 years ago
parent 891b07b388
commit 1db71beeef
  1. 12
      packages.ini
  2. 4
      requirements.pip
  3. 6
      scripttease/cli/initialize.py
  4. 4
      scripttease/cli/subcommands.py
  5. 2
      scripttease/library/commands/templates.py
  6. 2
      scripttease/library/overlays/centos.py
  7. 21
      scripttease/library/overlays/posix.py
  8. 2
      scripttease/library/overlays/ubuntu.py
  9. 2
      scripttease/parsers/base.py
  10. 2
      scripttease/parsers/ini.py
  11. 2
      scripttease/parsers/utils.py
  12. 13
      setup.py

@ -1,5 +1,9 @@
; SuperPython already has many of the required dependencies, including jinja2 and pygments. [jinja2]
[superpython] 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. comment = Used throughout for its various components and utilities.
scm = https://github.com/develmaycare/superpython scm = https://github.com/develmaycare/python-commonkit
source = https://github.com/develmaycare/superpython

@ -1 +1,3 @@
superpython jinja2
pygments
python-commonkit

@ -1,9 +1,9 @@
# Imports # Imports
from commonkit import smart_cast
from configparser import ConfigParser from configparser import ConfigParser
import logging import logging
import os import os
from superpython.utils import smart_cast
from ..constants import LOGGER_NAME from ..constants import LOGGER_NAME
log = logging.getLogger(LOGGER_NAME) log = logging.getLogger(LOGGER_NAME)
@ -14,7 +14,7 @@ __all__ = (
"context_from_cli", "context_from_cli",
"filters_from_cli", "filters_from_cli",
"options_from_cli", "options_from_cli",
"variable_from_file", "variables_from_file",
) )
# Functions # Functions
@ -78,7 +78,7 @@ def options_from_cli(options):
return _options return _options
def variable_from_file(path): def variables_from_file(path):
"""Loads variables from a given INI file. """Loads variables from a given INI file.
:param path: The path to the INI file. :param path: The path to the INI file.

@ -1,7 +1,7 @@
# Imports # Imports
from superpython.shell import EXIT from commonkit import highlight_code
from superpython.utils import highlight_code from commonkit.shell import EXIT
from ..parsers import load_commands, load_config from ..parsers import load_commands, load_config
# Exports # Exports

@ -1,9 +1,9 @@
# Imports # Imports
from commonkit import parse_jinja_template, read_file
from jinja2.exceptions import TemplateError, TemplateNotFound from jinja2.exceptions import TemplateError, TemplateNotFound
import logging import logging
import os import os
from superpython.utils import parse_jinja_template, read_file
from ...constants import LOGGER_NAME from ...constants import LOGGER_NAME
from .base import Command from .base import Command

@ -1,6 +1,6 @@
# Imports # Imports
from superpython.utils import split_csv from commonkit import split_csv
from ..commands import Command, Template from ..commands import Command, Template
from .common import COMMON_MAPPINGS from .common import COMMON_MAPPINGS
from .django import DJANGO_MAPPINGS from .django import DJANGO_MAPPINGS

@ -1,7 +1,7 @@
# Imports # Imports
from commonkit import indent
import os import os
from superpython.utils import indent
from ..commands import Command from ..commands import Command
# Exports # 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; # $(OUTPUTH_PATH) $(SSH_USER)@$(SSH_HOST):$(UPLOAD_PATH) --cvs-exclude;
tokens = list() tokens = list()
tokens.append('rsync') tokens.append("rsync")
tokens.append("--cvs-exclude") tokens.append("--cvs-exclude")
tokens.append("--checksum") tokens.append("--checksum")
tokens.append("--compress") tokens.append("--compress")
@ -492,11 +492,28 @@ class Function(object):
"""A function that may be used to organize related commands to be called together.""" """A function that may be used to organize related commands to be called together."""
def __init__(self, name, commands=None, comment=None): 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.commands = commands or list()
self.comment = comment self.comment = comment
self.name = name self.name = name
def to_string(self): def to_string(self):
"""Export the function as a string.
:rtype: str
"""
a = list() a = list()
if self.comment is not None: if self.comment is not None:

@ -1,6 +1,6 @@
# Imports # Imports
from superpython.utils import split_csv from commonkit import split_csv
from ..commands import Command, Template from ..commands import Command, Template
from .common import COMMON_MAPPINGS from .common import COMMON_MAPPINGS
from .django import DJANGO_MAPPINGS from .django import DJANGO_MAPPINGS

@ -1,6 +1,6 @@
# Imports # Imports
from superpython.utils import File from commonkit import File
from ..factory import Factory from ..factory import Factory
from ..library.scripts import Script from ..library.scripts import Script

@ -1,8 +1,8 @@
# Imports # Imports
from commonkit import parse_jinja_template, read_file, smart_cast, split_csv
from configparser import ConfigParser, ParsingError from configparser import ConfigParser, ParsingError
import logging import logging
from superpython.utils import parse_jinja_template, read_file, smart_cast, split_csv
import os import os
from ..constants import LOGGER_NAME from ..constants import LOGGER_NAME
from ..library.commands import ItemizedCommand from ..library.commands import ItemizedCommand

@ -1,7 +1,7 @@
# Imports # Imports
from commonkit import any_list_item
import logging import logging
from superpython.utils import any_list_item
from ..constants import LOGGER_NAME from ..constants import LOGGER_NAME
from .ini import Config from .ini import Config

@ -20,15 +20,16 @@ setup(
author='Shawn Davis', author='Shawn Davis',
author_email='shawn@develmaycare.com', author_email='shawn@develmaycare.com',
url='https://github.com/develmaycare/python-scripttease', url='https://github.com/develmaycare/python-scripttease',
packages=find_packages(exclude=["tests"]), packages=find_packages(exclude=["tests", "tests.*"]),
include_package_data=True, include_package_data=True,
# superpython provides jinja2 and pygments
install_requires=[ install_requires=[
"superpython", "jinja2",
], "pygments",
dependency_links=[ "python-commonkit",
"https://github.com/develmaycare/superpython",
], ],
# dependency_links=[
# "https://github.com/develmaycare/superpython",
# ],
classifiers=[ classifiers=[
'Development Status :: 2 - Pre-Alpha', 'Development Status :: 2 - Pre-Alpha',
'Environment :: Console', 'Environment :: Console',

Loading…
Cancel
Save