Exemplo n.º 1
0
    qInstallMsgHandler(messageHandler.process)

    if args.upload_file:
        item_buffer = {}
        for i in range(len(args.upload_file)):
            item = args.upload_file[i].split("=")
            if len(item) < 2 or not len(item[1]):
                if len(item_buffer) == 0:
                    p.print_help()
                    sys.exit(1)
                args.script = args.upload_file[i:]
                break
            item_buffer[QString(item[0])] = QString(item[1])
        for tag in item_buffer:
            if not os.path.exists(item_buffer[tag]):
                qFatal("No such file or directory: '%s'" % item_buffer[tag])
        args.upload_file = item_buffer

    if args.proxy:
        item = args.proxy.split(":")
        if len(item) < 2 or not len(item[1]):
            p.print_help()
            sys.exit(1)
        args.proxy = item

    if len(args.script) == 0:
        p.print_help()
        sys.exit(1)

    try:
        args.script[0] = open(args.script[0])
Exemplo n.º 2
0
                            if args.upload_file[i + 1:]:
                                arg_buffer = args.upload_file[i + 1:]
                                arg_buffer.reverse()
                                for val in arg_buffer:
                                    args.script_args.insert(0, val)
                            args.script = args.upload_file[i]
                            break
                else:
                    args.script = args.upload_file[i]
                    args.script_args = args.upload_file[i + 1:]

                break
            item_buffer[QString(item[0])] = QString(item[1])
        for tag in item_buffer:
            if not os.path.exists(item_buffer[tag]):
                qFatal('No such file or directory: \'%s\'' % item_buffer[tag])
        args.upload_file = item_buffer

    if args.proxy:
        item = args.proxy.split(':')
        if len(item) < 2 or not len(item[1]):
            p.print_help()
            sys.exit(1)
        args.proxy = item

    if not args.script:
        p.print_help()
        sys.exit(1)

    try:
        args.script = open(args.script)
Exemplo n.º 3
0
                            if args.upload_file[i+1:]:
                                arg_buffer = args.upload_file[i+1:]
                                arg_buffer.reverse()
                                for val in arg_buffer:
                                    args.script_args.insert(0, val)
                            args.script = args.upload_file[i]
                            break
                else:
                    args.script = args.upload_file[i]
                    args.script_args = args.upload_file[i+1:]

                break
            item_buffer[QString(item[0])] = QString(item[1])
        for tag in item_buffer:
            if not os.path.exists(item_buffer[tag]):
                qFatal('No such file or directory: \'%s\'' % item_buffer[tag])
        args.upload_file = item_buffer

    if args.proxy:
        item = args.proxy.split(':')
        if len(item) < 2 or not len(item[1]):
            p.print_help()
            sys.exit(1)
        args.proxy = item

    if not args.script:
        p.print_help()
        sys.exit(1)

    try:
        args.script = open(args.script)
Exemplo n.º 4
0
 def emit(self, record):
     if record.levelno >= logging.CRITICAL:
         qFatal("Received critical error: '%s'.\nAborting program.\n" % record.message)
Exemplo n.º 5
0
 def emit(self, record):
     if record.levelno >= logging.CRITICAL:
         qFatal("Received critical error: '%s'.\nAborting program.\n" %
                record.message)