Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
65 lines (50 sloc) 2 KB
## -- helper for
# Sun Aug 2 02:12:12 IST 2009 Abhishek Misha <ideamonk at>
# This module provides extensibility over more pastebin services
# To add more services to, all one would need is to append
# a module in this file and write code for that particular service.
import sys
import os
import pwd
import string
#sys.path.append ("modules") # to allow further imports
import modules.paste_ubuntu_com as paste_ubuntu_com
import modules.paste_pocoo_org as paste_pocoo_org
import modules.dpaste_com as dpaste_com
import modules.nopaste_com as nopaste_com
chunk = ""
filename = ""
user = pwd.getpwuid(os.getuid()).pw_name
# configured pastebin service id -
config = '1' # by default first pastebin is used
MAX = 4 # max num of services configured
# uncomment the following if you've a nickname of your choice
#user = 'Your nickname'
def show_list():
''' prints out a list of availabe pastebins with current version '''
global config
print '''
currently using %s
''' % (config)
def prepare_post():
''' prepares POST data to be sent to pastebin service '''
global config
config = config.rstrip()
if config=='1':
return paste_ubuntu_com.prepare(filename.split(".")[-1].lower(),user,chunk)
elif config=='2':
return paste_pocoo_org.prepare(filename.split(".")[-1].lower(),user,chunk)
elif config=='3':
return dpaste_com.prepare (filename,filename.split(".")[-1].lower(),user,chunk)
elif config=='4':
return nopaste_com.prepare (filename,filename.split(".")[-1].lower(),user,chunk)
return "",{'foo':'null'}
Jump to Line
Something went wrong with that request. Please try again.