<commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
# file: pavement.py
# authors: <NAME> 2016

from paver.easy import *
import paver.doctools
from paver.setuputils import setup
import shutil
import os

__doc__ = """ Setuptools with paver """
install_requires = [
    'pyyaml==3.10',
    'tornado==3.0.1',
    'toro==0.5',
    'passlib==1.6'
]
setup(
    name="opsapi",
    version="0.3",
    author="<NAME>",
    author_email="<EMAIL>",
    description="Extensible operations API and SDK blueprint examples",
    url="https://github.com/jonkelleyatrackspace/ops_api",
    packages=['opsapi'],
    install_requires=install_requires,
    entry_points={
        'console_scripts': [
            'opsapi = opsapi.server:main'
        ]
    },
    zip_safe=False
)


def chmod_dash_r(path, mode):
    """
    Just a little non registered function to chmod a path with file mode.
    """
    for root, dirs, files in os.walk(path, topdown=False):
        for dir in [os.path.join(root, d) for d in dirs]:
            os.chmod(dir, mode)
    for file in [os.path.join(root, f) for f in files]:
        os.chmod(file, mode)

def sudo_warning():
    """
    A little non registered function to remind a user they might need to
    employ the use of sudo/su to properly run this paver command.
    """
    if os.getuid() > 0:
        print("-"*60)
        print("   WARNING: This unprivleged UID may need to use sudo/su.")
        print("-"*60)

@task
@needs('install')
def load_extensions(options):
    """
    LOAD the extensions
    """
    warn_if_high_uid()
    if os.path.isdir("/srv/pyjojo"):
        shutil.rmtree("/srv/pyjojo")
    shutil.copytree("./srv/pyjojo", ("/srv/pyjojo"))
    chmod_dash_r("/srv/pyjojo", 0755)

@task
def install_deps():
    """
    INSTALL_DEPS for the package to run
    """
    warn_if_high_uid()
    for dependecy in install_requires:
        sh('pip install {package}'.format(package=dependecy))

@task
@needs('load_extensions')
def start():
    """
    START a dev instance for test
    """
    warn_if_high_uid()
    sh('opsapi --dir=/srv/pyjojo')


@task
def clean(options):
    """
    CLEAN after paver operations
    """
    for i in ['./dist', './build', './opsapi.egg-info']:
        print("Removing {file}".format(file=i))
        try:
            shutil.rmtree(i)<commit_msg>Update paver tasks<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-
# file: pavement.py
# authors: <NAME> 2016

from paver.easy import *
import paver.doctools
from paver.setuputils import setup
import shutil
import os

__doc__ = """ Setuptools with paver """
install_requires = [
    'pyyaml==3.10',
    'tornado==3.0.1',
    'toro==0.5',
    'passlib==1.6'
]
setup(
    name="opsapi",
    version="0.3",
    author="<NAME>",
    author_email="<EMAIL>",
    description="Extensible operations API and SDK blueprint examples",
    url="https://github.com/jonkelleyatrackspace/ops_api",
    packages=['opsapi'],
    install_requires=install_requires,
    entry_points={
        'console_scripts': [
            'opsapi = opsapi.server:main'
        ]
    },
    zip_safe=False
)


def chmod_dash_r(path, mode):
    """
    Just a little non registered function to chmod a path with file mode.
    """
    for root, dirs, files in os.walk(path, topdown=False):
        for dir in [os.path.join(root, d) for d in dirs]:
            os.chmod(dir, mode)
    for file in [os.path.join(root, f) for f in files]:
        os.chmod(file, mode)

def sudo_warning():
    """
    A little non registered function to remind a user they might need to
    employ the use of sudo/su to properly run this paver command.
    """
    if os.getuid() > 0:
        print("-"*60)
        print("   WARNING: This unprivleged UID may need to use sudo/su.")
        print("-"*60)

@task
@needs('install')
def load_extensions(options):
    """
    LOAD the extensions
    """
    sudo_warning()
    if os.path.isdir("/srv/pyjojo"):
        shutil.rmtree("/srv/pyjojo")
    shutil.copytree("./srv/pyjojo", ("/srv/pyjojo"))
    chmod_dash_r("/srv/pyjojo", 0755)

@task
def install_deps():
    """
    INSTALL_DEPS for the package to run
    """
    sudo_warning()
    for dependecy in install_requires:
        sh('pip install {package}'.format(package=dependecy))

@task
@needs('load_extensions')
def start():
    """
    START a dev instance for test
    """
    sudo_warning()
    sh('opsapi --dir=/srv/pyjojo')


@task
def clean(options):
    """
    CLEAN after paver operations
    """
    for i in ['./dist', './build', './opsapi.egg-info']:
        print("Removing {file}".format(file=i))
        try:
            shutil.rmtree(i)
{'fraction_non_alphanumeric': 0.14953673777203189, 'fraction_numerical': 0.011204481792717087, 'mean_word_length': 2.7526273241713826, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 11, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3565965', 'n_tokens_mistral': 1663, 'n_tokens_neox': 1588, 'n_words': 399}