예제 #1
0
파일: lsdb.py 프로젝트: donbro/lsdb
def main():

    #   some favorite testing files


    s = '/Volumes/Ulysses/bittorrent'
    s =     u'/Users/donb/Downloads/incomplete'
    s = '/Volumes/Ulysses/TV Shows/Nikita/'

    # package
    s = u"/Users/donb/Documents/Installing Evernote v. 4.6.2—Windows Seven.rtfd"


    s = '/Volumes/Ulysses/bittorrent'


    s = u'/Users/donb/Downloads/incomplete'


    s = u'/Users/donb/Ashley+Roberts/'
    
    

    
    
    s = "/Volumes/Taos/videogame/"
    
    
    s = "/Volumes/Daytona/TV Series/Americas Next Top Model"

    s = '.'
    
    s = "/Volumes/Taos/videogame/Perfect Dark/Joanna Dark/"

    s = u'/Users/donb/Ashley+Roberts/'
    s = u"~/Catherine Video Review.mp4"
    s = "/Volumes/Brandywine/TV Show—single/"
    
    s = '/Volumes/Ulysses/TV Shows/Nikita/'
    s = '/Volumes/Ulysses/bittorrent/'
    s = "/Volumes/Corinna"
    s = "/Volumes/Corinna/Actress/Alison Armitage"
    s = "/Volumes/Corinna/Actress/Keira Knightley/Keira Knightley - Kenneth Willardt's GQ Photoshoot"
    
    s = "/Volumes/Dunharrow"

    # hack to have Textmate run with hardwired arguments while command line can be free…
    if os.getenv('TM_LINE_NUMBER' ):
        argv = []

        argv += ["-v"] # verbose_level = 2
        argv += ["-v"]
#         argv += ["-v"]  # verbose_level = 4
        # argv = ["-d 3"]        
        argv += ["-f"]          # force folder scan
        # argv += ["-p"]      # scanning packages
        argv += [s]
    else:
        argv = sys.argv[1:]
    

    (options, args) = do_parse_args(argv)
    
    # no args means do the current directory
    
    if args == []: 
        args = ["."]
    
    args2 = []
    for a in args:
        try:
            unicode(a)
        except UnicodeDecodeError:
            a2 = a.decode('utf8')
            # print "arg [  %s  ] is a unicode string" % (a2, )
            GPR.print_it2("arg is a unicode string", a2, verbose_level_threshold=1)
            args2.append(a2)
        else:
            args2.append(a)
    args = args2
        
    args = [os.path.abspath(os.path.expanduser(a)) for a in args]
    
    GPR.verbose_level = options.verbose_level

    GPR.print_list("sys.argv", sys.argv, verbose_level_threshold=3)

    # display list of timezones
    if options.verbose_level >= 4:
        print_timezones("time_zones")

    GPR.print_dict("options (after optparsing)", options.__dict__, left_col_width=24, verbose_level_threshold=2)

    GPR.print_list("args (after optparsing)", args, verbose_level_threshold=3)
        
    do_args(args, options)
예제 #2
0
파일: lsdb_prev.py 프로젝트: donbro/lsdb
def main():

    #   some favorite testing files

    u'/Users/donb'
    u'/Users/donb/Documents/Delete Imported Items on matahari?.rtfd'
    u'/Users/donb/Downloads/incomplete'
    '/Users/donb/projects'
    '/Volumes/Brandywine/erin esurance'
    '/Volumes/Chronos/TV Show'
    u"/Volumes/Dunharrow/iTunes Dunharrow/TV Shows/The No. 1 Ladies' Detective Agency"
    '/Volumes/Dunharrow/pdf/Xcode 4 Unleashed 2nd ed. - F. Anderson (Sams, 2012) WW.pdf'
    u'/Volumes/Sacramento/Movies/The Dark Knight (2008) (720p).mkv'
    '/Volumes/Taos'
    u'/Volumes/Ulysses/TV Shows'
    '/Users/donb/dev-mac/sickbeard'

    
    
    s = '/Volumes/Ulysses/TV Shows/Nikita/Nikita.S03E01.1080p.WEB-DL.DD5.1.H.264-KiNGS.mkv'

    # basepath is a directory and a package but we're not scanning packages.
    s = u"/Users/donb/Documents/Installing Evernote v. 4.6.2—Windows Seven.rtfd"
    
    s =     u'/Volumes/Sapporo/TV Show/Winx Club/S01/Winx Club - 1x07 - Grounded (aka Friends in Need).avi'

    
    
    s = u'/Users/donb/Documents/ do JavaScript "var listOfFunctions = [];.rtf'
    s = '/Volumes/Ulysses/bittorrent'
    s =     u'/Volumes/Ulysses/TV Shows/Lost Girl'
    s = '/Volumes/Ulysses/TV Shows/Nikita/'

    s = '/Volumes/Ulysses/TV Shows/Nikita/'

    s = u"/Users/donb/Documents/Installing Evernote v. 4.6.2—Windows Seven.rtfd"

    s = "."
    
    s = u'/Volumes/Brandywine/TV Series/White Collar/S04'
    
    s = u'/Users/donb/Ashley+Roberts/'

    
    # hack to have Textmate run with hardwired arguments while command line can be free…
    if os.getenv('TM_LINE_NUMBER' ):
        argv = []
        # argv = ["--help"]+[s]
        # argv = ["-rd 4"]
        argv += ["-v"]
        argv += ["-v"]
        # argv += ["-v"]
        # argv += ["-a"]
        argv += ["-p"]
        # argv += ["-f"] 
        argv += [s]
    else:
        argv = sys.argv[1:]
    

    (options, args) = do_parse_args(argv)


    
    # no args means do the current directory
    
    if args == []: 
        args = ["."]
    
    args = [os.path.abspath(os.path.expanduser(a)) for a in args]
    # args = [os.path.abspath(os.path.expanduser(a.decode('utf8'))) for a in args]
    
    # LOGLEVELS = (logging.FATAL, logging.WARNING, logging.INFO, logging.DEBUG)
    # 
    # # Create logger
    # logger = logging.getLogger('')
    # logger.setLevel(logging.WARNING)
    # # logger.addHandler(gui_log)
    # 
    # logger.setLevel(LOGLEVELS[options.verbose_level-1])
    # 
    # logging.info('--------------------------------') # INFO:root:-------------------------------- (in red!)
    

    GPR.print_list("sys.argv", sys.argv)

    # display list of timezones
    if options.verbose_level >= 4:
        print_timezones("time_zones")

    GPR.print_dict("options (after optparsing)", options.__dict__, left_col_width=24, verbose_level_threshold=2)

    GPR.print_list("args (after optparsing)", args)
        
    do_lsdb(args, options)