def runme(): """ Main process with cleaning """ samplesdir = os.path.realpath(os.path.join(os.path.dirname(sys.argv[0]), "../samples")) if len(sys.argv)>1: samplesdir = os.path.realpath(sys.argv[1]) os.chdir(samplesdir) for sample in os.listdir(samplesdir): if os.path.isdir(sample): print "Cleaning dir", sample, ">>>>>>>" os.chdir(samplesdir) os.chdir(sample) for p in os.listdir("."): if p != "getlog.py" and p not in [#"stw-config.py", "stw-filter-events.py", "stw-scenario.txt", "stw-config.py"]: removedirorfile(p) os.chdir(samplesdir)
def runme(): """ Main process with cleaning """ samplesdir = os.path.realpath( os.path.join(os.path.dirname(sys.argv[0]), "../samples")) if len(sys.argv) > 1: samplesdir = os.path.realpath(sys.argv[1]) os.chdir(samplesdir) for sample in os.listdir(samplesdir): if os.path.isdir(sample): print "Cleaning dir", sample, ">>>>>>>" os.chdir(samplesdir) os.chdir(sample) for p in os.listdir("."): if p != "getlog.py" and p not in [ #"stw-config.py", "stw-filter-events.py", "stw-scenario.txt", "stw-config.py" ]: removedirorfile(p) os.chdir(samplesdir)
def do(): def run(s): print s os.system(s) version = VCSVisualizer.version__ dt = datetime.date.today().strftime("%Y-%m-%d") tempdir = tempfile.gettempdir() distrdir = os.path.join(tempdir, "".join(["stw-distr-",dt])) if os.path.exists(distrdir): removedirorfile(distrdir) os.chdir(STWDIR) s = "".join(["hg archive ", distrdir]) run(s) os.chdir(distrdir) removedirorfile([".hg_archival.txt", ".hgignore"]) os.mkdir("bin") os.chdir("src") run("python setup.py py2exe ") removedirorfile("build") os.chdir(distrdir) zipname = "".join(["showteamwork-[",version,"].zip"]) run("".join(['7z a -r -tzip "', zipname, '" * '])) os.chdir(HOMEDIR) distr=os.path.join(distrdir,zipname) if not os.path.exists(distrdir): print "cannot find ", distr else: print "OK" print distr