Example #1
0
   OPTIONS:
     -e <string>  extension of file that will be modified,like ".py", ".c", ".cpp"
   PATTERN:
     strings that will to be replaced
   REPLACEMENT:
     strings we will use to replace PATTERN
   PATH/FILE:
     in which files that we will do the replacement
  '''
    print msg
    return
if __name__ == '__main__':
    if len(sys.argv) == 1:
        usage()
        sys.exit()
    help=utils.HELP(usage,m_log=logger)
    #do_execute=0
    options='e:'
    opts,args=utils.my_getopt(sys.argv[1:],options+help.get_opt())

    extension=''
    for opt, arg in opts:
        if opt == '-e':
            extension = arg
        else:
            help.parse_opt(opt)

    if len(args) == 0:
        logger.error('No PATTERN is specified, please check')
        sys.exit()
    elif len(args) == 1:
Example #2
0
   PATTERN:
     patterns of files that we want to find
   PATH:
     path in which we want to find files
  '''
    print msg
    return


if __name__ == '__main__':
    #print sys.argv
    if len(sys.argv) == 1:
        usage()
        sys.exit()

    help = utils.HELP(usage, BIN, '--help', logger)
    #do_execute=0
    options = 'ifde:m:'
    opts, args = utils.my_getopt(sys.argv[1:], options + help.get_opt())

    opt_list = ''
    name_opts = '-name'
    type_opts = ''
    exclude_path_list = []
    maxdep_opts = ''
    for opt, arg in opts:
        if opt == '-i':
            name_opts = '-iname'
        elif opt == '-f':
            type_opts = '-type f'
        elif opt == '-d':
Example #3
0
    return


if __name__ == '__main__':
    #f=open(sys.argv[1],'r')
    #fenc=chardet.detect(f.read())
    #print fenc

    if len(sys.argv) == 1:
        usage()
        sys.exit()
    elif len(sys.argv) < 3:
        usage()
        sys.exit()

    help = utils.HELP(usage, FFMPEG_BIN, '--help', logger)
    options = 'o:m:e:'
    opts, args = utils.my_getopt(sys.argv[1:], options + help.get_opt())

    logger.info("opts=%s args=%s" % (opts, args))

    output_arg = ''
    mode = 1
    encoding_type = 'gbk'

    for opt, arg in opts:
        if opt == '-o':
            output_arg = arg
        elif opt == '-m':
            mode = int(arg)
        elif opt == '-e':