Esempio n. 1
0
File: main.py Progetto: jlisee/xpkg
def _package_info(info, verbose):
    """
    Print package info a yaml like format.
    """

    print '  name:',info['name']
    print '  version:',info['version']

    if info.get('description'):
        description = info['description'].strip()

        # Process extra long descriptions
        if (80 - len('  description: ')) < len(description):
            description = util.wrap_yaml_string(description)
        print '  description:',description

    if info.get('dependencies', None):
        print '  dependencies:',info['dependencies']

    if verbose:
        print '  dirs:'
        for f in sorted(info['dirs']):
            print '    -',f
        print '  files:'
        for f in sorted(info['files']):
            print '    -',f
Esempio n. 2
0
def _package_info(info, verbose):
    """
    Print package info a yaml like format.
    """

    print '  name:', info['name']
    print '  version:', info['version']

    if info.get('description'):
        description = info['description'].strip()

        # Process extra long descriptions
        if (80 - len('  description: ')) < len(description):
            description = util.wrap_yaml_string(description)
        print '  description:', description

    if info.get('dependencies', None):
        print '  dependencies:', info['dependencies']

    if verbose:
        print '  dirs:'
        for f in sorted(info['dirs']):
            print '    -', f
        print '  files:'
        for f in sorted(info['files']):
            print '    -', f
Esempio n. 3
0
    def test_wrap_yaml_string(self):
        long_string = "Tool which controls the generation of executables " \
                      "and other non-source files of a program from the" \
                      " program's source files."

        wrapped = util.wrap_yaml_string(long_string,tab=4)
        expected = ">\n" \
                   "    Tool which controls the generation of executables and"\
                   " other non-source files\n" \
                   "    of a program from the program's source files."

        self.assertEqual(expected, wrapped)