def makeUserVersion():
    """
        * Create the .tar.gz file in builded_doc/
        * Return the name of the file.
    """
    print("_"*30, "makeUserVersion")

    destfilename = "{0}_v{1}.tar.gz".format( NAME_OF_THE_PROJECT2,
                                             VERSION )

    # (1) we create the temp_userversion/ directory :
    if os.path.exists("temp_userversion/"):
        syscmd( "rm -rf temp_userversion/" )

    syscmd( "mkdir temp_userversion/" )

    # (2) we copy the files in temp_userversion/ :
    for filename in getAllFilenames(only_py_files = False, only_user_version = True):
        syscmd( "cp --parents {0} temp_userversion/".format(filename) )

    # (3) we delete some files in temp_userversion/ :
    syscmd( 'find {1} -name "*.gz" -exec rm {0} \\;'.format('{}',
                                                             "temp_userversion/") )

    syscmd( 'find {1} -name "*~" -exec rm {0} \\;'.format('{}',
                                                             "temp_userversion/") )

    syscmd( 'find {1} -name "*.pyc" -exec rm {0} \\;'.format('{}',
                                                             "temp_userversion/") )

    syscmd( 'find {1} -name "*.doctree" -exec rm {0} \\;'.format('{}',
                                                             "temp_userversion/") )

    # (4) we create the archive :
    os.chdir("temp_userversion/")
    syscmd( "tar -czf {0} .".format(destfilename) )
    syscmd( "mv {0} ..".format(destfilename) )

    # (5) we move the file to builded_doc/userversion :
    os.chdir("..")
    syscmd( "mkdir builded_doc/userversion/" )
    syscmd( "mv {0} builded_doc/userversion/".format(destfilename))

    # (6) we erase the  temp_userversion/ directory :
    syscmd( "rm -rf temp_userversion/" )

    return destfilename
Example #2
0
from console import CONSOLE

CONSOLE.useTheColor("cyan")
CONSOLE.writeln("="*80)
CONSOLE.writeln("TEST : pylint_test.py")
CONSOLE.writeln("="*80)
CONSOLE.useTheDefaultColor()

COMMANDSTRING = "pylint --rcfile=pylint.rc {0} > z"

NBR_FILES = 0
WORST_MARK = 10

with open("pylint.output","w") as dest:

    for filename in getAllFilenames(only_py_files=True):

        if not os.path.exists(filename):
            raise Exception("Unknown file : "+str(filename))

        dest.write("="*80 + "\n")
        dest.write(filename + "\n")
        dest.write("="*80 + "\n")

        os.system(COMMANDSTRING.format(filename))

        with open("z","r") as src:
            pylintdata = src.read()

        os.system("rm z")