Esempio n. 1
0
 def test_get_version(self):
     ver = version.get_version()
     self.ok(ver.startswith('2.1'))
 
     ver = version.get_version((2, 1, 1, 'alpha', 1))
     self.eq(ver, '2.1.1a1')
 
     ver = version.get_version((2, 1, 2, 'beta', 2))
     self.eq(ver, '2.1.2b2')
 
     ver = version.get_version((2, 1, 2, 'rc', 3))
     self.eq(ver, '2.1.2c3')
Esempio n. 2
0
 def test_get_version(self):
     ver = version.get_version()
     self.ok(ver.startswith('2.1'))
 
     ver = version.get_version((2, 1, 1, 'alpha', 1))
     self.eq(ver, '2.1.1a1')
 
     ver = version.get_version((2, 1, 2, 'beta', 2))
     self.eq(ver, '2.1.2b2')
 
     ver = version.get_version((2, 1, 2, 'rc', 3))
     self.eq(ver, '2.1.2c3')
Esempio n. 3
0
def test_get_version():
    ver = version.get_version()
    assert ver.startswith('3.0')

    ver = version.get_version((2, 1, 1, 'alpha', 1))
    assert ver == '2.1.1a1'

    ver = version.get_version((2, 1, 2, 'beta', 2))
    assert ver == '2.1.2b2'

    ver = version.get_version((2, 1, 2, 'rc', 3))
    assert ver == '2.1.2c3'

    ver = version.get_version((2, 1, 3, 'final', 0))
    assert ver == '2.1.3'
Esempio n. 4
0
#!/usr/bin/env python

import os
import sys
import re
import tempfile

from cement.core.foundation import CementApp
from cement.core.controller import CementBaseController, expose
from cement.utils.version import get_version
from cement.utils import shell

VERSION = get_version()

class CementDevtoolsController(CementBaseController):
    class Meta:
        label = 'base'
        arguments = [
            (['-y, --noprompt'], 
             dict(help='answer yes to prompts.', action='store_true', 
                  dest='noprompt')),
            (['--ignore-errors'],
             dict(help="don't stop operations because of errors", 
                  action='store_true', dest='ignore_errors')),
            (['--loud'], dict(help='add more verbose output', 
             action='store_true', dest='loud')),
            (['modifier1'], 
             dict(help='command modifier positional argument', nargs='?')),
        ]
        
    def _do_error(self, msg):
Esempio n. 5
0
import os
import sys
sys.path.insert(0, os.path.abspath('../cement/'))

on_rtd = os.environ.get('READTHEDOCS', None) == 'True'

if not on_rtd:  # only import and set the theme if we're building docs locally
    import sphinx_rtd_theme
    html_theme = 'sphinx_rtd_theme'
    html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]

# If we dont' prep an app, then we'll get runtime errors
from cement.utils import test, version
app = test.TestApp()

RELEASE = version.get_version()
VERSION = '.'.join(RELEASE.split('.')[:2])

### Hack for Read The Docs:

class Mock(object):
    def __init__(self, *args, **kwargs):
        pass

    def __call__(self, *args, **kwargs):
        return Mock()

    @classmethod
    def __getattr__(cls, name):
        if name in ('__file__', '__path__'):
            return '/dev/null'
Esempio n. 6
0
import os
import sys
sys.path.insert(0, os.path.abspath('../cement/'))

on_rtd = os.environ.get('READTHEDOCS', None) == 'True'

if not on_rtd:  # only import and set the theme if we're building docs locally
    import sphinx_rtd_theme
    html_theme = 'sphinx_rtd_theme'
    html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]

# If we dont' prep an app, then we'll get runtime errors
from cement.utils import test, version
app = test.TestApp()

RELEASE = version.get_version()
VERSION = '.'.join(RELEASE.split('.')[:2])

### Hack for Read The Docs:


class Mock(object):
    def __init__(self, *args, **kwargs):
        pass

    def __call__(self, *args, **kwargs):
        return Mock()

    @classmethod
    def __getattr__(cls, name):
        if name in ('__file__', '__path__'):
Esempio n. 7
0
import sys
from setuptools import setup, find_packages
from cement.utils import version

VERSION = version.get_version()

f = open('README.md', 'r')
LONG = f.read()
f.close()

setup(
    name='cement',
    version=VERSION,
    description='CLI Framework for Python',
    long_description=LONG,
    long_description_content_type='text/markdown',
    classifiers=[],
    install_requires=[],
    keywords='cli framework',
    author='Data Folk Labs, LLC',
    author_email='*****@*****.**',
    url='http://builtoncement.org',
    license='BSD',
    packages=find_packages(exclude=['ez_setup', 'tests*']),
    package_data={'cement': ['cement/cli/templates/generate/*']},
    include_package_data=True,
    zip_safe=False,
    test_suite='nose.collector',
    entry_points="""
        [console_scripts]
        cement = cement.cli.main:main
Esempio n. 8
0
from setuptools import setup, find_packages
import sys, os

from cement.utils import version

VERSION = version.get_version()

LONG = """
Cement is an advanced CLI Application Framework for Python.  Its goal is to 
introduce a standard, and feature-full platform for both simple and complex 
command line applications as well as support rapid development needs without 
sacrificing quality.

More Information please visit the official site at:
    
    * http://builtoncement.com/

"""


setup(name='cement',
    version=VERSION,
    description="CLI Application Framework for Python",
    long_description=LONG,
    classifiers=[], 
    keywords='cli framework',
    author='BJ Dierkes',
    author_email='*****@*****.**',
    url='http://builtoncement.org',
    license='BSD',
Esempio n. 9
0
#!/usr/bin/env python

import os
import sys
import re
import tempfile

from cement import App, Controller, ex
# from cement.core.foundation import CementApp
# from cement.ext.ext_argparse import ArgparseController, expose
from cement.utils.version import get_version
from cement.utils import shell

VERSION = get_version()

class CementDevtoolsController(Controller):
    class Meta:
        label = 'base'
        arguments = [
            (['-y, --noprompt'],
             dict(help='answer yes to prompts.', action='store_true',
                  dest='noprompt')),
            (['--ignore-errors'],
             dict(help="don't stop operations because of errors",
                  action='store_true', dest='ignore_errors')),
            (['--loud'], dict(help='add more verbose output',
             action='store_true', dest='loud')),
        ]

    def _do_error(self, msg):
        if self.app.pargs.ignore_errors: