Пример #1
0
def show_help():
    ''' Shows the usage of pypaste '''
    
    print '''pypaste 1.0                      author: Abhishek Mishra <ideamonk at gmail.com>

usage: pypaste OPTION [file-to-paste]

    --config
        select and configure a pastebin provider from supported list.
    
    --use pastebin_id
        uses a particular available pastebin provider from the list:'''
    ppi.show_list()
Пример #2
0
def pypaste_config():
    ''' helps the user select a nice pastebin '''
    
    pypaste_readconfig()            # read the id of pastebin in use
    ppi.show_list()
    
    print "New choice :"
    
    try:
        new_config = int(raw_input())
    except:
        print "invalid choice!\n"
        pypaste_config()
        return
    
    if (new_config > ppi.MAX or new_config <= 0):
        print "invalid choice!\n"
        pypaste_config()
        return
    
    # wooh! everything is fine now, so lets write the new config
    confhandle = open (configfile,"w")
    confhandle.write (str(new_config))
    confhandle.close()