Exemple #1
0
def SplitBase64BlockAsync(FileName):
    Log('Try to make pictures out...')
    FileName = FileName + '_Base64'
    FileHandle_Base64 = open(FileName)
    Buffer = ''
    Count = 0
    while True:
        Lines = FileHandle_Base64.readlines(MaxBuffer)
        if not Lines:
            break
        for Line in Lines:
            if Line[0] == '-' and Line[1] == '-' and Line[
                    2] == '-' and Count != 0:
                AsyncIO.PutOne([Buffer, ImageFolder])
                Buffer = ''
            else:
                Buffer = Buffer + Line
            Count += 1
Exemple #2
0
def init():
    App=AsyncIO()
    App.setDaemon(True)
    App.start()
Exemple #3
0
    os.system(Command)

def NowAsync(FileName,MaxBlock):
    Log('Start running...')
    mthSplitInit(FileName)
    SplitMessage(FileName,MaxBlock)
    SplitBase64BlockAsync(FileName)
    Log('Cleaning...')
    os.removedirs('Splited/Images')
    Log('Success!')
    Path=os.path.abspath('.')+'\Splited'
    Command='explorer /select, "'+Path+'"'
    os.system(Command)

if __name__ == '__main__':
    AsyncIO.init()
    Log('This is mhtSpliter.')
    Log('Author: prprQueenSama@MoeMod')
    if len(sys.argv)==1:
        Log('Error: No parameter input.')
        raw_input()
    else:
        if len(sys.argv)==2:
            AimFile=sys.argv[1]
            ImageFolder=MakeImageFolder(AimFile)
            OutFolder=MakeOutFolder(AimFile)
            try:
                FileHandle=open('MaxBlock.txt')
                String=FileHandle.read()
                try:
                    MaxBlock=int(String)
Exemple #4
0
def init():
    App = AsyncIO()
    App.setDaemon(True)
    App.start()
Exemple #5
0
def NowAsync(FileName, MaxBlock):
    Log('Start running...')
    mthSplitInit(FileName)
    SplitMessage(FileName, MaxBlock)
    SplitBase64BlockAsync(FileName)
    Log('Cleaning...')
    os.removedirs('Splited/Images')
    Log('Success!')
    Path = os.path.abspath('.') + '\Splited'
    Command = 'explorer /select, "' + Path + '"'
    os.system(Command)


if __name__ == '__main__':
    AsyncIO.init()
    Log('This is mhtSpliter.')
    Log('Author: prprQueenSama@MoeMod')
    if len(sys.argv) == 1:
        Log('Error: No parameter input.')
        raw_input()
    else:
        if len(sys.argv) == 2:
            AimFile = sys.argv[1]
            ImageFolder = MakeImageFolder(AimFile)
            OutFolder = MakeOutFolder(AimFile)
            try:
                FileHandle = open('MaxBlock.txt')
                String = FileHandle.read()
                try:
                    MaxBlock = int(String)