Example #1
0
project=eval('localconf.'+projectname)
conffile=project['dir']+'/mat2doc/mat2docconf.py'
filesdir=localconf.filesdir

f=file(project['dir']+projectname+'_version')
versionstring=f.read()[:-1]
f.close()

import printdoc, notes
#from datesuffix import *


todo=sys.argv[1]

if 'verify' in todo:
    printdoc.printdoc(projectname,'verify')

# Release for other developers to download
if 'develmat' in todo:
    #printdoc.git_stageexport(project['dir'],project['mat'])
    os.system('rm -rf '+project['mat']+'*')
    os.system('cp -r '+project['dir']+' '+project['mat'])
    os.system('rm -r -f '+project['mat']+'.git')
    printdoc.printdoc(projectname,'mat')

    fname=filesdir+projectname+'-devel-'+versionstring

    # Create the Unix src package
    os.system('tar zcvf '+fname+'.tgz '+projectname+'/')

    # Create the Windows src package
Example #2
0
todo = sys.argv[1]

# Release for users to download
if 'releasemat' in todo:
    #printdoc.git_repoexport(project['dir'],'master',projectname,filesdir)
    os.system('rm -rf ' + project['mat'] + '*')
    os.system('cp -r ' + project['dir'] + ' ' + project['mat'])
    os.system('rm -r -f ' + project['mat'] + '.git')

    # Remove unwanted files
    os.system('rm -rf ' + project['mat'] + 'mat2doc')
    os.system('rm -rf ' + project['mat'] + 'test_bench')
    #os.system('rm -rf '+project['mat']+'timing')

    printdoc.printdoc(projectname, 'mat')

    fname = filesdir + projectname + '-' + versionstring
    print fname

    # Create the Unix src package
    os.system('tar zcvf ' + fname + '.tgz ' + projectname + '/')

    # Create the Windows src package
    os.system('rm ' + fname + '.zip')
    printdoc.unix2dos(filesdir + projectname)
    os.system('zip -r ' + fname + '.zip ' + projectname + '/')

if 'pdf' in todo:
    printdoc.printdoc(projectname, 'tex')
Example #3
0
todo = sys.argv[1]


# Release for users to download
if "releasemat" in todo:
    # printdoc.git_repoexport(project['dir'],'master',projectname,filesdir)
    os.system("rm -rf " + project["mat"] + "*")
    os.system("cp -r " + project["dir"] + " " + project["mat"])
    os.system("rm -r -f " + project["mat"] + ".git")

    # Remove unwanted files
    os.system("rm -rf " + project["mat"] + "mat2doc")
    os.system("rm -rf " + project["mat"] + "test_bench")
    # os.system('rm -rf '+project['mat']+'timing')

    printdoc.printdoc(projectname, "mat")

    fname = filesdir + projectname + "-" + versionstring
    print fname

    # Create the Unix src package
    os.system("tar zcvf " + fname + ".tgz " + projectname + "/")

    # Create the Windows src package
    os.system("rm " + fname + ".zip")
    printdoc.unix2dos(filesdir + projectname)
    os.system("zip -r " + fname + ".zip " + projectname + "/")


if "pdf" in todo:
    printdoc.printdoc(projectname, "tex")
Example #4
0
def runcommand(todo, redomode='auto'):
    # When editing these commands, some variables are already defined
    #
    #   versionstring - This is the string from mat2docconf
    #   project       - This is the name of the project from calling publish.py

    print 'PUBLISH ' + todo + ' ' + redomode

    # Simple commands to make the others easier to write
    if todo == 'svnmat':
        pass

    if todo == 'gitstagemat':
        os.system('mat2doc ' + projectdir + ' mat')

    if todo == 'gitrepomat':
        os.system('mat2doc ' + projectdir + ' mat')

    # Release for other developers to download
    if 'develmat' in todo:
        runcommand('gitstagemat')

        createcompressedfile(project + '-mat',
                             project + '-devel-' + printdoc.datesuffix(),
                             'unix')
        createcompressedfile(project + '-mat',
                             project + '-devel-' + printdoc.datesuffix(),
                             'win')

    # Release for users to download
    if 'releasemat' in todo:
        runcommand('gitrepomat')

        matdir = outputdir + project + '-mat' + os.sep

        # Remove unwanted files
        os.system('rm -rf ' + matdir + 'testing')
        os.system('rm -rf ' + matdir + 'reference')
        os.system('rm -rf ' + matdir + 'timing')

        createcompressedfile(project + '-mat', project + '-' + versionstring,
                             'unix')
        createcompressedfile(project + '-mat', project + '-' + versionstring,
                             'win')

    if 'tex' == todo:
        printdoc.printdoc(project, 'tex', redomode)

    if 'texmake' == todo:
        s = outputdir + project + '-tex/'
        os.system('cp ' + projectdir + 'mat2doc/tex/* ' + s)

        os.system('cd ' + s + '; make')

        printdoc.printdoc(project, 'tex', redomode)

    if 'texupload' == todo:
        texdir = outputdir + project + '-tex' + os.sep
        s = 'rsync -av ' + texdir + 'ltfat.pdf ' + host + ':' + remotedir
        os.system(s)

    if todo == 'php':
        phpdir = outputdir + project + '-php' + os.sep
        os.system('mat2doc ' + projectdir + ' php')
        s = 'rsync -av ' + phpdir + ' ' + host + ':' + remotedir
        os.system(s)

    if todo == 'phplocal' in todo:
        printdoc.printdoc(project, 'phplocal', redomode)

    if todo == 'fullrelease':
        runcommand('releasemat', redomode)
        runcommand('binary')
        runcommand('php', redomode)
        runcommand('tex', redomode)
        runcommand('texupload')

    if 'stagewww' == todo:
        printdoc.git_stageexport(tbwww, publishwww)
        os.system('rsync -av ' + publishwww + ' ' + host + ':' + www)

    if 'releasewww' == todo:
        printdoc.git_repoexport(tbwww, 'master', 'ltfatwww', outputdir)
        os.system('rsync -av ' + publishwww + ' ' + host + ':' + www)

    if 'binary' == todo:
        # You must run this command right after the "releasemat" or
        # "develmat" commands as this will create a correct "-mat"
        # directory

        createbinaryfile(project + '-' + versionstring, 'win64', 'win')
        createbinaryfile(project + '-' + versionstring, 'win32', 'win')
        createbinaryfile(project + '-' + versionstring, 'mac', 'mac')

    #if 'upload' in todo:
    #    ddir=outputdir+'ltfat_sourceforge/ltfat/'
    #    os.system('rsync -av '+ddir+
    #              ' soender,[email protected]:/home/frs/project/l/lt/ltfat/ltfat/')

    if todo == 'verify':
        printdoc.printdoc(project, 'verify', redomode)
Example #5
0
import sys
from PyQt4 import QtCore, QtGui, uic
from client_sock import client_sock
from code_flag import sem_flags, func_code
import socket
from log import mylog
import threading
from printdoc import printdoc
client_log = mylog(file="clientlog.log")
pt = printdoc()
"""
#2秒内收不到信号就停止
class timeout2(object):
    def __init__(self, sock, t):
        
        self.t = threading.Timer(t,self.process2)
        self.t.start()
        self.s = sock
        self.fault_window = faultui(self.s)
        
    def timecancel(self):
        self.t.cancel()
        
    def process2(self):
        #self.s.client_close()
        self.fault_window.exec()
        """
mainwinFile = "main_window.ui"
depositFile = "deposit.ui"
transferFile = "transfer.ui"
withdrawFile = "withdraw.ui"
Example #6
0
def runcommand(todo, redomode="auto"):
    # When editing these commands, some variables are already defined
    #
    #   versionstring - This is the string from mat2docconf
    #   project       - This is the name of the project from calling publish.py

    print "PUBLISH " + todo + " " + redomode

    # Simple commands to make the others easier to write
    if todo == "svnmat":
        pass

    if todo == "gitstagemat":
        os.system("mat2doc " + projectdir + " mat")

    if todo == "gitrepomat":
        os.system("mat2doc " + projectdir + " mat")

    # Release for other developers to download
    if "develmat" in todo:
        runcommand("gitstagemat")

        createcompressedfile(project + "-mat", project + "-devel-" + printdoc.datesuffix(), "unix")
        createcompressedfile(project + "-mat", project + "-devel-" + printdoc.datesuffix(), "win")

    # Release for users to download
    if "releasemat" in todo:
        runcommand("gitrepomat")

        matdir = outputdir + project + "-mat" + os.sep

        # Remove unwanted files
        os.system("rm -rf " + matdir + "testing")
        os.system("rm -rf " + matdir + "reference")
        os.system("rm -rf " + matdir + "timing")

        createcompressedfile(project + "-mat", project + "-" + versionstring, "unix")
        createcompressedfile(project + "-mat", project + "-" + versionstring, "win")

    if "tex" == todo:
        printdoc.printdoc(project, "tex", redomode)

    if "texmake" == todo:
        s = outputdir + project + "-tex/"
        os.system("cp " + projectdir + "mat2doc/tex/* " + s)

        os.system("cd " + s + "; make")

        printdoc.printdoc(project, "tex", redomode)

    if "texupload" == todo:
        texdir = outputdir + project + "-tex" + os.sep
        s = "rsync -av " + texdir + "ltfat.pdf " + host + ":" + remotedir
        os.system(s)

    if todo == "php":
        phpdir = outputdir + project + "-php" + os.sep
        os.system("mat2doc " + projectdir + " php")
        s = "rsync -av " + phpdir + " " + host + ":" + remotedir
        os.system(s)

    if todo == "phplocal" in todo:
        printdoc.printdoc(project, "phplocal", redomode)

    if todo == "fullrelease":
        runcommand("releasemat", redomode)
        runcommand("binary")
        runcommand("php", redomode)
        runcommand("tex", redomode)
        runcommand("texupload")

    if "stagewww" == todo:
        printdoc.git_stageexport(tbwww, publishwww)
        os.system("rsync -av " + publishwww + " " + host + ":" + www)

    if "releasewww" == todo:
        printdoc.git_repoexport(tbwww, "master", "ltfatwww", outputdir)
        os.system("rsync -av " + publishwww + " " + host + ":" + www)

    if "binary" == todo:
        # You must run this command right after the "releasemat" or
        # "develmat" commands as this will create a correct "-mat"
        # directory

        createbinaryfile(project + "-" + versionstring, "win64", "win")
        createbinaryfile(project + "-" + versionstring, "win32", "win")
        createbinaryfile(project + "-" + versionstring, "mac", "mac")

    # if 'upload' in todo:
    #    ddir=outputdir+'ltfat_sourceforge/ltfat/'
    #    os.system('rsync -av '+ddir+
    #              ' soender,[email protected]:/home/frs/project/l/lt/ltfat/ltfat/')

    if todo == "verify":
        printdoc.printdoc(project, "verify", redomode)