Sat, 24 May 2014 18:01:53 +0200
Refined the install and cleanup scripts.
cleanupSource.py | file | annotate | diff | comparison | revisions | |
install.py | file | annotate | diff | comparison | revisions |
--- a/cleanupSource.py Sat May 24 17:11:12 2014 +0200 +++ b/cleanupSource.py Sat May 24 18:01:53 2014 +0200 @@ -35,9 +35,11 @@ if os.path.exists(os.path.join(dirName, sourceName + "c")): os.remove(os.path.join(dirName, sourceName + "c")) - # step 2: delete the __pycache__ directory + # step 2: delete the __pycache__ directory and all *.pyc files if os.path.exists(os.path.join(dirName, "__pycache__")): shutil.rmtree(os.path.join(dirName, "__pycache__")) + for name in [f for f in dirListing if fnmatch.fnmatch(f, "*.pyc")]: + os.remove(os.path.join(dirName, name)) # step 3: descent into subdirectories and delete them if empty for name in os.listdir(dirName):
--- a/install.py Sat May 24 17:11:12 2014 +0200 +++ b/install.py Sat May 24 18:01:53 2014 +0200 @@ -232,18 +232,24 @@ return wname -def createPyWrapper(pydir, wfile, marker, isGuiScript=True): +def createPyWrapper(pydir, wfile, isGuiScript=True): """ Create an executable wrapper for a Python script. @param pydir the name of the directory where the Python script will eventually be installed (string) @param wfile the basename of the wrapper (string) - @param marker marker for the Python variant (string) @param isGuiScript flag indicating a wrapper script for a GUI application (boolean) @return the platform specific name of the wrapper (string) """ + global includePythonVariant + + if includePythonVariant: + marker = PythonMarkers[sys.version_info.major] + else: + marker = "" + # all kinds of Windows systems if sys.platform.startswith("win"): wname = wfile + marker + ".bat" @@ -526,58 +532,19 @@ @return result code (integer) """ global distDir, doCleanup, cfg, progLanguages, sourceDir, configName - global includePythonVariant # Create the platform specific wrappers. wnames = [] - if includePythonVariant: - marker = PythonMarkers[sys.version_info.major] - else: - marker = "" - wnames.append(createPyWrapper(cfg['ericDir'], - "eric5_api", marker, - False)) - wnames.append(createPyWrapper(cfg['ericDir'], - "eric5_compare", marker)) - wnames.append(createPyWrapper(cfg['ericDir'], - "eric5_configure", marker)) - wnames.append(createPyWrapper(cfg['ericDir'], - "eric5_diff", marker)) - wnames.append(createPyWrapper(cfg['ericDir'], - "eric5_doc", marker, - False)) - wnames.append(createPyWrapper(cfg['ericDir'], - "eric5_editor", marker)) - wnames.append(createPyWrapper(cfg['ericDir'], - "eric5_iconeditor", marker)) - wnames.append(createPyWrapper(cfg['ericDir'], - "eric5_plugininstall", marker)) - wnames.append(createPyWrapper(cfg['ericDir'], - "eric5_pluginrepository", marker)) - wnames.append(createPyWrapper(cfg['ericDir'], - "eric5_pluginuninstall", marker)) - wnames.append(createPyWrapper(cfg['ericDir'], - "eric5_qregexp", marker)) - wnames.append(createPyWrapper(cfg['ericDir'], - "eric5_qregularexpression", marker)) - wnames.append(createPyWrapper(cfg['ericDir'], - "eric5_re", marker)) - wnames.append(createPyWrapper(cfg['ericDir'], - "eric5_snap", marker)) - wnames.append(createPyWrapper(cfg['ericDir'], - "eric5_sqlbrowser", marker)) - wnames.append(createPyWrapper(cfg['ericDir'], - "eric5_tray", marker)) - wnames.append(createPyWrapper(cfg['ericDir'], - "eric5_trpreviewer", marker)) - wnames.append(createPyWrapper(cfg['ericDir'], - "eric5_uipreviewer", marker)) - wnames.append(createPyWrapper(cfg['ericDir'], - "eric5_unittest", marker)) - wnames.append(createPyWrapper(cfg['ericDir'], - "eric5_webbrowser", marker)) - wnames.append(createPyWrapper(cfg['ericDir'], - "eric5", marker)) + for name in ["eric5_api", "eric5_doc"]: + wnames.append(createPyWrapper(cfg['ericDir'], name, False)) + for name in ["eric5_compare", "eric5_configure", "eric5_diff", + "eric5_editor", "eric5_iconeditor", "eric5_plugininstall", + "eric5_pluginrepository", "eric5_pluginuninstall", + "eric5_qregexp", "eric5_qregularexpression", "eric5_re", + "eric5_snap", "eric5_sqlbrowser", "eric5_tray", + "eric5_trpreviewer", "eric5_uipreviewer", "eric5_unittest", + "eric5_webbrowser", "eric5"]: + wnames.append(createPyWrapper(cfg['ericDir'], name)) # set install prefix, if not None if distDir: