diff -Nru pastebinit-1.1/debian/changelog pastebinit-1.2/debian/changelog
--- pastebinit-1.1/debian/changelog 2010-05-15 10:58:34.000000000 +0000
+++ pastebinit-1.2/debian/changelog 2011-02-03 03:19:44.000000000 +0000
@@ -1,3 +1,32 @@
+pastebinit (1.2-2~maverick1~ppa1) maverick; urgency=low
+
+ * No-change backport to maverick
+
+ -- Micah Gersten Wed, 02 Feb 2011 21:19:44 -0600
+
+pastebinit (1.2-2) experimental; urgency=low
+
+ * new upstream release
+ - drop all current patches as they have been pushed upstream
+ - lots of fixed bugs:
+ + document -f FORMAT option. LP: #614873, Closes: #562827
+ + document the config file and its format. LP: #435303, Closes #574661
+ + add support for paste.kde.org. LP: #700644, Closes: #608264
+ + honor pastebin definitions from ~/.pastebin.d/. LP: #701039
+ * install pastebin definitions to /usr/share/ instead of /etc. LP: #621923
+ * ship upstream README file in package
+ * debian/copyright: update my copyright
+
+ -- Rolf Leggewie Mon, 31 Jan 2011 07:51:54 +0800
+
+pastebinit (1.1-3) experimental; urgency=low
+
+ * 30-lsb.patch: set default pastebin according to OS (LP: #648298)
+ patch courtesy of Mario Limonciello
+ * update to Debian standard 3.9.1
+
+ -- Rolf Leggewie Tue, 26 Oct 2010 03:12:07 +0900
+
pastebinit (1.1-2) unstable; urgency=low
* debian/copyright: update to latest status
diff -Nru pastebinit-1.1/debian/control pastebinit-1.2/debian/control
--- pastebinit-1.1/debian/control 2010-05-15 08:58:08.000000000 +0000
+++ pastebinit-1.2/debian/control 2010-10-25 18:45:01.000000000 +0000
@@ -6,7 +6,7 @@
Build-Depends: debhelper (>= 5.0.38)
Build-Depends-Indep: xsltproc, docbook-xml, docbook-xsl, python-central (>= 0.5.6)
XS-Python-Version: all
-Standards-Version: 3.8.4
+Standards-Version: 3.9.1
Homepage: http://launchpad.net/pastebinit/
Vcs-Browser: http://git.debian.org/?p=collab-maint/pastebinit.git
Vcs-Git: git://git.debian.org/collab-maint/pastebinit.git
diff -Nru pastebinit-1.1/debian/copyright pastebinit-1.2/debian/copyright
--- pastebinit-1.1/debian/copyright 2010-05-15 09:06:03.000000000 +0000
+++ pastebinit-1.2/debian/copyright 2011-02-02 05:28:04.000000000 +0000
@@ -8,6 +8,7 @@
Stéphane Graber
Daniel Bartlett
David Paleino
+ Rolf Leggewie
Copyright:
@@ -35,5 +36,5 @@
On Debian systems, the complete text of the GNU General
Public License can be found in `/usr/share/common-licenses/GPL-2'.
-The Debian packaging is © 2006-2008, Stéphane Graber and © 2008-2010
+The Debian packaging is © 2006-2008, Stéphane Graber and © 2008-2011
Rolf Leggewie and is licensed under the GPL, see above.
diff -Nru pastebinit-1.1/debian/install pastebinit-1.2/debian/install
--- pastebinit-1.1/debian/install 2010-05-15 08:58:08.000000000 +0000
+++ pastebinit-1.2/debian/install 2011-02-02 05:28:02.000000000 +0000
@@ -1,3 +1,3 @@
-pastebin.d/ etc/
+pastebin.d/ usr/share/
pastebinit usr/bin/
po/mo/* usr/share/locale/
diff -Nru pastebinit-1.1/debian/pastebinit.docs pastebinit-1.2/debian/pastebinit.docs
--- pastebinit-1.1/debian/pastebinit.docs 1970-01-01 00:00:00.000000000 +0000
+++ pastebinit-1.2/debian/pastebinit.docs 2011-02-02 05:28:05.000000000 +0000
@@ -0,0 +1 @@
+README
diff -Nru pastebinit-1.1/debian/pastebinit.preinst pastebinit-1.2/debian/pastebinit.preinst
--- pastebinit-1.1/debian/pastebinit.preinst 1970-01-01 00:00:00.000000000 +0000
+++ pastebinit-1.2/debian/pastebinit.preinst 2011-02-02 05:28:04.000000000 +0000
@@ -0,0 +1,39 @@
+#!/bin/sh -e
+
+# Drop unchanged conffiles in deprecated location without triggering a dpkg question
+# c.f. LP: #621923 and http://wiki.debian.org/DpkgConffileHandling
+# BEGIN FIXME: use dpkg-maintscript-helper when my main OS supports it
+
+prep_mv_conffile() {
+ local PKGNAME="$1"
+ local CONFFILE="$2"
+
+ [ -e "$CONFFILE" ] || return 0
+
+ local md5sum="$(md5sum $CONFFILE | sed -e 's/ .*//')"
+ local old_md5sum="$(dpkg-query -W -f='${Conffiles}' $PKGNAME | \
+ sed -n -e "\' $CONFFILE ' { s/ obsolete$//; s/.* //; p }")"
+ if [ "$md5sum" = "$old_md5sum" ]; then
+ rm -f "$CONFFILE"
+ fi
+}
+
+case "$1" in
+install|upgrade)
+ if dpkg --compare-versions "$2" lt "1.2-1"; then
+ prep_mv_conffile pastebinit "/etc/pastebin.d/fpaste.org.conf"
+ prep_mv_conffile pastebinit "/etc/pastebin.d/paste2.org.conf"
+ prep_mv_conffile pastebinit "/etc/pastebin.d/pastebin.ca.conf"
+ prep_mv_conffile pastebinit "/etc/pastebin.d/pastebin.com.conf"
+ prep_mv_conffile pastebinit "/etc/pastebin.d/paste.debian.net.conf"
+ prep_mv_conffile pastebinit "/etc/pastebin.d/paste.ubuntu.com.conf"
+ prep_mv_conffile pastebinit "/etc/pastebin.d/pastie.org.conf"
+ prep_mv_conffile pastebinit "/etc/pastebin.d/slexy.org.conf"
+ prep_mv_conffile pastebinit "/etc/pastebin.d/stikked.com.conf"
+ prep_mv_conffile pastebinit "/etc/pastebin.d/yourpaste.net.conf"
+ fi
+esac
+
+# END FIXME
+
+exit 0
diff -Nru pastebinit-1.1/debian/patches/10-drop_rafb.net.patch pastebinit-1.2/debian/patches/10-drop_rafb.net.patch
--- pastebinit-1.1/debian/patches/10-drop_rafb.net.patch 2010-05-15 09:08:58.000000000 +0000
+++ pastebinit-1.2/debian/patches/10-drop_rafb.net.patch 1970-01-01 00:00:00.000000000 +0000
@@ -1,14 +0,0 @@
-Index: pastebinit/pastebinit.xml
-===================================================================
---- pastebinit.orig/pastebinit.xml 2010-05-15 11:00:12.000000000 +0200
-+++ pastebinit/pastebinit.xml 2010-05-15 11:00:44.000000000 +0200
-@@ -110,9 +110,6 @@
- http://1t2.us (including subdomains)
- -->
-
-- http://rafb.net
--
--
- http://slexy.org
-
-
diff -Nru pastebinit-1.1/debian/patches/20-set_sensible_expiry.patch pastebinit-1.2/debian/patches/20-set_sensible_expiry.patch
--- pastebinit-1.1/debian/patches/20-set_sensible_expiry.patch 2010-05-15 10:57:19.000000000 +0000
+++ pastebinit-1.2/debian/patches/20-set_sensible_expiry.patch 1970-01-01 00:00:00.000000000 +0000
@@ -1,56 +0,0 @@
-Index: pastebinit/pastebin.d/fpaste.org.conf
-===================================================================
---- pastebinit.orig/pastebin.d/fpaste.org.conf 2010-05-15 11:16:22.000000000 +0200
-+++ pastebinit/pastebin.d/fpaste.org.conf 2010-05-15 11:18:29.000000000 +0200
-@@ -11,4 +11,4 @@
-
- [defaults]
- submit = "paste it!"
--expire_options = 3600
-+expire_options = 86400
-Index: pastebinit/pastebin.d/paste.debian.net.conf
-===================================================================
---- pastebinit.orig/pastebin.d/paste.debian.net.conf 2010-05-15 11:16:23.000000000 +0200
-+++ pastebinit/pastebin.d/paste.debian.net.conf 2010-05-15 11:20:45.000000000 +0200
-@@ -13,4 +13,4 @@
- [defaults]
- lang = -1
- remember = 0
--expire = 259200
-+expire = 604800
-Index: pastebinit/pastebin.d/pastebin.com.conf
-===================================================================
---- pastebinit.orig/pastebin.d/pastebin.com.conf 2010-05-15 11:12:06.000000000 +0200
-+++ pastebinit/pastebin.d/pastebin.com.conf 2010-05-15 11:15:56.000000000 +0200
-@@ -18,7 +18,7 @@
- submit = submit
- paste_format = text
- private = 0
--expiry = N
-+expiry = 1M
- subdomain = ""
- email = ""
- page = "/api_public.php"
-Index: pastebinit/pastebin.d/slexy.org.conf
-===================================================================
---- pastebinit.orig/pastebin.d/slexy.org.conf 2010-05-15 11:16:24.000000000 +0200
-+++ pastebinit/pastebin.d/slexy.org.conf 2010-05-15 11:22:15.000000000 +0200
-@@ -21,4 +21,4 @@
- permissions = 0
- comment = ""
- linenumbers = 0
--expire = 0
-+expire = 604800
-Index: pastebinit/pastebin.d/yourpaste.net.conf
-===================================================================
---- pastebinit.orig/pastebin.d/yourpaste.net.conf 2010-05-15 11:16:25.000000000 +0200
-+++ pastebinit/pastebin.d/yourpaste.net.conf 2010-05-15 11:23:06.000000000 +0200
-@@ -14,7 +14,7 @@
- regexp = regexp
-
- [defaults]
--expire = 0
-+expire = 604800
- private = 0
- remember = 0
- page = '/paste'
diff -Nru pastebinit-1.1/debian/patches/series pastebinit-1.2/debian/patches/series
--- pastebinit-1.1/debian/patches/series 2010-05-15 10:57:19.000000000 +0000
+++ pastebinit-1.2/debian/patches/series 1970-01-01 00:00:00.000000000 +0000
@@ -1,2 +0,0 @@
-10-drop_rafb.net.patch
-20-set_sensible_expiry.patch
diff -Nru pastebinit-1.1/pastebin.d/cxg.de.conf pastebinit-1.2/pastebin.d/cxg.de.conf
--- pastebinit-1.1/pastebin.d/cxg.de.conf 1970-01-01 00:00:00.000000000 +0000
+++ pastebinit-1.2/pastebin.d/cxg.de.conf 2011-01-30 15:20:34.000000000 +0000
@@ -0,0 +1,14 @@
+[pastebin]
+basename = cxg.de
+regexp = "http://cxg.de"
+
+[format]
+user = desc
+content = pastetext
+format = lang
+page = page
+regexp = regexp
+
+[defaults]
+page = "/paste.php"
+regexp = 'href="http://cxg.de/(.*)"'
diff -Nru pastebinit-1.1/pastebin.d/fpaste.org.conf pastebinit-1.2/pastebin.d/fpaste.org.conf
--- pastebinit-1.1/pastebin.d/fpaste.org.conf 2010-02-18 01:12:04.000000000 +0000
+++ pastebinit-1.2/pastebin.d/fpaste.org.conf 2011-01-30 15:20:34.000000000 +0000
@@ -11,4 +11,4 @@
[defaults]
submit = "paste it!"
-expire_options = 3600
+expire_options = 86400
diff -Nru pastebinit-1.1/pastebin.d/pastebin.ca.conf pastebinit-1.2/pastebin.d/pastebin.ca.conf
--- pastebinit-1.1/pastebin.d/pastebin.ca.conf 2009-12-26 17:49:53.000000000 +0000
+++ pastebinit-1.2/pastebin.d/pastebin.ca.conf 1970-01-01 00:00:00.000000000 +0000
@@ -1,17 +0,0 @@
-[pastebin]
-basename = pastebin.ca
-regexp = "http://((([a-zA-Z0-9\-_\.]*)(pastebin\.ca)))"
-
-[format]
-user = name
-content = content
-type = type
-save = save
-submit = submit
-regexp = regexp
-
-[defaults]
-type = 1
-save = 0
-submit = s
-regexp = '">http://.*pastebin.ca/(.*)
'
diff -Nru pastebinit-1.1/pastebin.d/pastebin.com.conf pastebinit-1.2/pastebin.d/pastebin.com.conf
--- pastebinit-1.1/pastebin.d/pastebin.com.conf 2010-04-11 16:03:09.000000000 +0000
+++ pastebinit-1.2/pastebin.d/pastebin.com.conf 2011-01-30 15:20:34.000000000 +0000
@@ -8,7 +8,7 @@
subdomain = paste_subdomain
private = paste_private
expiry = paste_expire_date
-paste_format = paste_format
+format = paste_format
email = paste_email
page = page
submit = submit
@@ -16,9 +16,9 @@
[defaults]
submit = submit
-paste_format = text
+format = text
private = 0
-expiry = N
+expiry = 1M
subdomain = ""
email = ""
page = "/api_public.php"
diff -Nru pastebinit-1.1/pastebin.d/paste.debian.net.conf pastebinit-1.2/pastebin.d/paste.debian.net.conf
--- pastebinit-1.1/pastebin.d/paste.debian.net.conf 2009-12-26 17:49:53.000000000 +0000
+++ pastebinit-1.2/pastebin.d/paste.debian.net.conf 2011-01-30 15:20:34.000000000 +0000
@@ -13,4 +13,4 @@
[defaults]
lang = -1
remember = 0
-expire = 259200
+expire = 604800
diff -Nru pastebinit-1.1/pastebin.d/paste.kde.org.conf pastebinit-1.2/pastebin.d/paste.kde.org.conf
--- pastebinit-1.1/pastebin.d/paste.kde.org.conf 1970-01-01 00:00:00.000000000 +0000
+++ pastebinit-1.2/pastebin.d/paste.kde.org.conf 2011-01-30 15:20:34.000000000 +0000
@@ -0,0 +1,22 @@
+[pastebin]
+basename = paste.kde.org
+regexp = "http://paste.kde.org"
+
+[format]
+user = paste_user
+format = paste_lang
+content = paste_data
+password = paste_password
+expire = paste_expire
+private = paste_private
+api = api_submit
+mode = mode
+regexp = regexp
+
+[defaults]
+private = 0
+format = "text"
+expire = 86400
+api = 1
+mode = xml
+regexp = "(.*)"
diff -Nru pastebinit-1.1/pastebin.d/paste.ubuntu.org.cn.conf pastebinit-1.2/pastebin.d/paste.ubuntu.org.cn.conf
--- pastebinit-1.1/pastebin.d/paste.ubuntu.org.cn.conf 1970-01-01 00:00:00.000000000 +0000
+++ pastebinit-1.2/pastebin.d/paste.ubuntu.org.cn.conf 2011-01-30 15:20:34.000000000 +0000
@@ -0,0 +1,12 @@
+[pastebin]
+basename = paste.ubuntu.org.cn
+regexp = "http://paste.ubuntu.org.cn"
+
+[format]
+user = poster
+content = code2
+format = class
+paste = paste
+
+[defaults]
+paste = "发送"
diff -Nru pastebinit-1.1/pastebin.d/pastie.org.conf pastebinit-1.2/pastebin.d/pastie.org.conf
--- pastebinit-1.1/pastebin.d/pastie.org.conf 2010-01-21 02:32:57.000000000 +0000
+++ pastebinit-1.2/pastebin.d/pastie.org.conf 2011-01-30 15:20:34.000000000 +0000
@@ -1,6 +1,7 @@
[pastebin]
basename = pastie.org
regexp = "http://pastie\.org"
+sizelimit = 100000
[format]
page = page
diff -Nru pastebinit-1.1/pastebin.d/pb.daviey.com pastebinit-1.2/pastebin.d/pb.daviey.com
--- pastebinit-1.1/pastebin.d/pb.daviey.com 1970-01-01 00:00:00.000000000 +0000
+++ pastebinit-1.2/pastebin.d/pb.daviey.com 2011-01-30 15:20:34.000000000 +0000
@@ -0,0 +1,16 @@
+[pastebin]
+basename = pb.daviey.com
+regexp = "http://pb.daviey.com"
+
+[format]
+user = author
+content = content
+page = page
+expire_options = expires
+title = title
+regexp = regexp
+
+[defaults]
+page = "api/?_call=new"
+regexp = ""/(.*/)".*"
+expire_options = 7889232
diff -Nru pastebinit-1.1/pastebin.d/p.defau.lt.conf pastebinit-1.2/pastebin.d/p.defau.lt.conf
--- pastebinit-1.1/pastebin.d/p.defau.lt.conf 1970-01-01 00:00:00.000000000 +0000
+++ pastebinit-1.2/pastebin.d/p.defau.lt.conf 2011-01-30 15:20:34.000000000 +0000
@@ -0,0 +1,10 @@
+[pastebin]
+basename = p.defau.lt
+regexp = "http://p.defau.lt"
+
+[format]
+content = code
+page = page
+
+[defaults]
+page = '/submit.php'
diff -Nru pastebinit-1.1/pastebin.d/slexy.org.conf pastebinit-1.2/pastebin.d/slexy.org.conf
--- pastebinit-1.1/pastebin.d/slexy.org.conf 2009-12-26 17:49:53.000000000 +0000
+++ pastebinit-1.2/pastebin.d/slexy.org.conf 2011-01-30 15:20:34.000000000 +0000
@@ -21,4 +21,4 @@
permissions = 0
comment = ""
linenumbers = 0
-expire = 0
+expire = 604800
diff -Nru pastebinit-1.1/pastebin.d/sprunge.us.conf pastebinit-1.2/pastebin.d/sprunge.us.conf
--- pastebinit-1.1/pastebin.d/sprunge.us.conf 1970-01-01 00:00:00.000000000 +0000
+++ pastebinit-1.2/pastebin.d/sprunge.us.conf 2011-01-30 15:20:34.000000000 +0000
@@ -0,0 +1,11 @@
+[pastebin]
+basename = sprunge.us
+regexp = "http://sprunge.us"
+
+[format]
+content = sprunge
+format = lang
+regexp = regexp
+
+[defaults]
+regexp="http://sprunge.us/(.*)$"
diff -Nru pastebinit-1.1/pastebin.d/stikked.com.conf pastebinit-1.2/pastebin.d/stikked.com.conf
--- pastebinit-1.1/pastebin.d/stikked.com.conf 2009-12-26 17:49:53.000000000 +0000
+++ pastebinit-1.2/pastebin.d/stikked.com.conf 2011-01-30 15:20:34.000000000 +0000
@@ -16,3 +16,4 @@
lang = "text"
website = ""
submit = "submit"
+expire = "403200"
diff -Nru pastebinit-1.1/pastebin.d/yourpaste.net.conf pastebinit-1.2/pastebin.d/yourpaste.net.conf
--- pastebinit-1.1/pastebin.d/yourpaste.net.conf 2010-04-11 16:08:12.000000000 +0000
+++ pastebinit-1.2/pastebin.d/yourpaste.net.conf 2011-01-30 15:20:34.000000000 +0000
@@ -14,7 +14,7 @@
regexp = regexp
[defaults]
-expire = 0
+expire = 604800
private = 0
remember = 0
page = '/paste'
diff -Nru pastebinit-1.1/pastebinit pastebinit-1.2/pastebinit
--- pastebinit-1.1/pastebinit 2010-04-11 16:13:18.000000000 +0000
+++ pastebinit-1.2/pastebinit 2011-01-30 15:20:34.000000000 +0000
@@ -17,15 +17,34 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+defaultPB = "http://pastebin.com" #Default pastebin
+try:
+ import lsb_release
+ release = lsb_release.get_distro_information()['ID'].lower()
+ if release == 'debian':
+ defaultPB = "http://paste.debian.net"
+ elif release == 'fedora':
+ defaultPB = "http://fpaste.org"
+ elif release == 'ubuntu':
+ defaultPB = "http://paste.ubuntu.com"
+except ImportError:
+ pass
+
try:
import urllib, os, sys, re, getopt, xml.dom.minidom, gettext
+ try:
+ import json # For python 2.6 and newer
+ except ImportError:
+ try:
+ import simplejson as json
+ except ImportError:
+ json = None
from gettext import gettext as _
import configobj
gettext.textdomain("pastebinit")
- defaultPB = "http://pastebin.com" #Default pastebin
- version = "1.1" #Version number to show in the usage
+ version = "1.2" #Version number to show in the usage
configfile = os.path.expanduser("~/.pastebinit.xml")
# Custom urlopener to handle 401's
@@ -39,7 +58,7 @@
# - for source checkout, config in the checkout
# - user's overrides in ~/.pastebin.d
# Files found later override files found earlier.
- for confdir in ['/etc/pastebin.d',
+ for confdir in ['/usr/share/pastebin.d','/etc/pastebin.d',
os.path.join(os.path.dirname(__file__), 'pastebin.d'),
os.path.expanduser('~/.pastebin.d')]:
try:
@@ -67,7 +86,7 @@
print >> sys.stderr, _("%s: no 'basename' in [pastebin]") % filename
continue
pastebind[basename] = bininstance
- return pastebind
+ return pastebind
# pastey.net obfuscates parent ids for replies. Rather than taking the
# post ID given as the parent ID, we must handle this by going to that
@@ -92,6 +111,9 @@
params = {}
for pastebin in pastebind:
if re.search(pastebind[pastebin]['pastebin']['regexp'], website):
+ if "sizelimit" in pastebind[pastebin]['pastebin']:
+ params['sizelimit'] = pastebind[pastebin]['pastebin']['sizelimit']
+
for param in pastebind[pastebin]['format'].keys():
paramname = pastebind[pastebin]['format'][param]
if param == 'user':
@@ -119,7 +141,7 @@
if params:
return params
else:
- sys.exit(_("Unknown website, please post a bugreport to request this pastebin to be added (%s)") % website)
+ sys.exit(_("Unknown website, please post a bugreport to request this pastebin to be added (%s)" % website))
#XML Handling methods
def getText(nodelist):
@@ -142,17 +164,18 @@
def Usage():
print "pastebinit v" + version
print "Reads on stdin for input or takes a filename as first parameter"
- print _("Optional arguments:")
- print _("\t-h This help screen")
- print _("\t-b ") % website
+ print _("Optional arguments (not supported by all pastebins):")
print _("\t-a ") % user
+ print _("\t-b ") % website
print _("\t-f ") % format
+ print _("\t-h This help screen")
+ print _("\t-i ")
+ print _("\t-l List all supported pastebins")
+ print _("\t-j ") % jabberid
+ print _("\t-m ")
print _("\t-r ")
-# print _("Optional arguments supported only by 1t2.us:")
-# print _("\t-j ") % jabberid
-# print _("\t-m ")
-# print _("\t-t ")
-# print _("\t-u -p ")
+ print _("\t-t ")
+ print _("\t-u -p ")
# Set defaults
website = defaultPB
@@ -192,10 +215,12 @@
if gotconfigxml:
try:
configxml = xml.dom.minidom.parseString(configtext)
- website = getFirstNodeText(configxml, "pastebin")
- user = getFirstNodeText(configxml, "author")
- format = getFirstNodeText(configxml, "format")
- jabberid = getFirstNodeText(configxml, "jabberid")
+ for variable,key in (('pastebin','website'),('author','user'),('format','format'),('jabberid','jabberid')):
+ try:
+ value = getFirstNodeText(configxml, variable)
+ vars()[key]=value
+ except:
+ pass
except KeyboardInterrupt:
sys.exit(_("KeyboardInterrupt caught."))
except:
@@ -207,7 +232,7 @@
# Get options
try:
- optlist, list = getopt.getopt(sys.argv[1:], 'hi:f:b:a:r:j:t:m:u:p:')
+ optlist, list = getopt.getopt(sys.argv[1:], 'hli:f:b:a:r:j:t:m:u:p:')
except KeyboardInterrupt:
sys.exit(_("KeyboardInterrupt caught."))
except getopt.GetoptError:
@@ -215,6 +240,7 @@
Usage()
sys.exit(1)
+ pastebind = preloadPastebins() #get the config from /etc/pastebin.d/
# Iterate through options
for opt in optlist:
if opt[0] == "-h":
@@ -232,6 +258,11 @@
parentpid = opt[1]
elif opt[0] == "-j":
jabberid = opt[1]
+ elif opt[0] == "-l":
+ print _("Supported pastebins:")
+ for pastebin in pastebind:
+ print "- %s" % pastebin
+ sys.exit(0)
elif opt[0] == "-t":
title = opt[1]
elif opt[0] == "-m":
@@ -257,13 +288,19 @@
except:
sys.exit(_("Unable to read from: %s") % filename)
if not content:
- sys.exit(_("You are trying to send an empty document, exiting."))
- pastebind = preloadPastebins() #get the config from /etc/pastebin.d/
+ sys.exit(_("You are trying to send an empty document, exiting."))
+
params = getParameters(website, pastebind, content, user, jabberid, version, format, parentpid, permatag, title, username, password) #Get the parameters array
if not website.endswith("/"):
website += "/"
+ if "sizelimit" in params:
+ if len(content) > int(params['sizelimit']):
+ sys.exit(_("The content you are trying to send exceeds the pastebin's size limit."))
+ else:
+ del params['sizelimit']
+
reLink = None
tmp_page = ""
if "page" in params:
@@ -273,9 +310,24 @@
if "regexp" in params:
reLink = params['regexp']
del params["regexp"]
- params = urllib.urlencode(params) #Convert to a format usable with the HTML POST
+
+ if 'post_format' in params:
+ post_format = params['post_format']
+ del params['post_format']
+ else:
+ post_format = 'standard'
url_opener = pasteURLopener()
+
+ if post_format == 'json':
+ if json:
+ params = json.dumps(params)
+ url_opener.addheader('Content-type: text/json')
+ else:
+ sys.exit(_("Could not find any json library."))
+ else:
+ params = urllib.urlencode(params) #Convert to a format usable with the HTML POST
+
page = url_opener.open(website, params) #Send the informations and be redirected to the final page
try:
diff -Nru pastebinit-1.1/pastebinit.xml pastebinit-1.2/pastebinit.xml
--- pastebinit-1.1/pastebinit.xml 2009-03-10 05:22:26.000000000 +0000
+++ pastebinit-1.2/pastebinit.xml 2011-01-30 15:20:34.000000000 +0000
@@ -4,10 +4,10 @@
Stephane">
Graber">
- December 19, 2008">
+ January 09, 2011">
1">
- d.paleino@gmail.com">
-
+ stgraber@ubuntu.com">
+
PASTEBINIT">
@@ -22,7 +22,7 @@
&dhemail;
- 2007-2008
+ 2007-2011
&dhusername;
&dhdate;
@@ -40,7 +40,7 @@
&dhpackage;
-
+
@@ -57,97 +57,68 @@
OPTIONS
- Required arguments
+ Optional arguments (not supported by all pastebins)
- (- for reading from stdin)
+ (default: $USER)
-
-
-
- Optional arguments
-
(default: http://pastebin.com)
- (default: $USER)
+ (default: text)
+ (check pastebin's website for complete list, example: python)
- (used for syntax-highlighting, default: text)
-
+ Help screen
+
- (default: none)
+ Use filename for input
-
+ (default: none)
+
+
+ (default: none)
+
- SUPPORTED PASTEBINS
-
-
- http://pastebin.com (including subdomains)
-
-
- http://pastebin.ca (including subdomains)
-
-
-
- http://rafb.net
-
-
- http://slexy.org
-
-
- http://fpaste.org
-
-
- http://paste2.org
-
-
- http://pastey.net (including subdomains)
-
-
- http://stikked.com
-
-
- http://yourpaste.net
-
-
- http://gist.github.com
-
-
- http://paste.ubuntu.com
-
-
- http://paste.debian.net
-
-
+ CONFIGURATION FILE
+ If a .pastebinit.xml file is found in the user's home directory,
+ pastebinit will use it for its configuration.
+ Here's an example file:
+
+ <pastebinit>
+ <pastebin>http://paste.ubuntu.com</pastebin>
+ <author>Stephane Graber</author>
+ <jabberid>stgraber@stgraber.org</jabberid>
+ <format>text</format>
+ </pastebinit>
+
AUTHORS
Pastebinit is currently written by &dhfirstname; &dhsurname;.
- 1t2.us, username, password, format, title, arguments and redirect
+ username, password, format, title, arguments and redirect
support added by Daniel Bartlett.
- Website: http://www.stgraber.org/category/pastebinit
+ Website: http://launchpad.net/pastebinit
E-mail: stgraber@ubuntu.com
-
diff -Nru pastebinit-1.1/po/af.po pastebinit-1.2/po/af.po
--- pastebinit-1.1/po/af.po 2010-02-18 01:36:18.000000000 +0000
+++ pastebinit-1.2/po/af.po 2011-01-30 15:20:34.000000000 +0000
@@ -7,22 +7,30 @@
msgstr ""
"Project-Id-Version: pastebinit\n"
"Report-Msgid-Bugs-To: FULL NAME \n"
-"POT-Creation-Date: 2009-12-26 19:36+0000\n"
+"POT-Creation-Date: 2011-01-09 20:24+0000\n"
"PO-Revision-Date: 2009-12-27 02:37+0000\n"
"Last-Translator: Marius Bock \n"
"Language-Team: Afrikaans \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-02-18 01:36+0000\n"
+"X-Launchpad-Export-Date: 2011-01-10 04:51+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
-#: ../pastebinit:65
+#: ../pastebinit:62
+msgid "%s: no section [pastebin]"
+msgstr ""
+
+#: ../pastebinit:67
+msgid "%s: no 'basename' in [pastebin]"
+msgstr ""
+
+#: ../pastebinit:91
#, docstring
msgid "Return the parameters array for the selected pastebin"
msgstr "Keer terug die parameters struktuur vir die gekose pastebin"
-#: ../pastebinit:96
+#: ../pastebinit:125
msgid ""
"Unknown website, please post a bugreport to request this pastebin to be "
"added (%s)"
@@ -30,58 +38,90 @@
"Onbekend webwerf, pos asseblief 'n fout verslag om te versoek dat hierdie "
"pastebin bygevoeg word (%s)"
-#: ../pastebinit:119
-msgid "Optional arguments:"
-msgstr "Opsioneële argumente:"
+#: ../pastebinit:148
+msgid "Optional arguments (not supported by all pastebins):"
+msgstr ""
-#: ../pastebinit:120
-msgid "\t-h This help screen"
-msgstr "\t-h Hierdie hulp skerm"
+#: ../pastebinit:149
+msgid "\t-a "
+msgstr "\t-a "
-#: ../pastebinit:121
+#: ../pastebinit:150
msgid "\t-b "
msgstr "\t-b "
-#: ../pastebinit:122
-msgid "\t-a "
-msgstr "\t-a "
-
-#: ../pastebinit:123
+#: ../pastebinit:151
msgid "\t-f "
msgstr "\t-f "
-#: ../pastebinit:124
+#: ../pastebinit:152
+msgid "\t-h This help screen"
+msgstr "\t-h Hierdie hulp skerm"
+
+#: ../pastebinit:153
+msgid "\t-i "
+msgstr ""
+
+#: ../pastebinit:154
+msgid "\t-l List all supported pastebins"
+msgstr ""
+
+#: ../pastebinit:155
+msgid "\t-j "
+msgstr "\t-j "
+
+#: ../pastebinit:156
+msgid "\t-m "
+msgstr "\t-m "
+
+#: ../pastebinit:157
msgid "\t-r "
msgstr "\t-r "
-#: ../pastebinit:161 ../pastebinit:174 ../pastebinit:186 ../pastebinit:230
-#: ../pastebinit:262 ../pastebinit:268
+#: ../pastebinit:158
+msgid "\t-t "
+msgstr "\t-t "
+
+#: ../pastebinit:159
+msgid "\t-u -p "
+msgstr "\t-u -p "
+
+#: ../pastebinit:191 ../pastebinit:204 ../pastebinit:216 ../pastebinit:266
+#: ../pastebinit:307 ../pastebinit:313
msgid "KeyboardInterrupt caught."
msgstr "Sleutelbordonderbreking is gevang"
-#: ../pastebinit:177
+#: ../pastebinit:207
msgid "Error parsing configuration file!"
msgstr "Fout met lees van konfigurasie leër"
-#: ../pastebinit:178
+#: ../pastebinit:208
msgid ""
"Please ensure that your configuration file looks similar to the following:"
msgstr ""
"Verseker asseblief dat jou konfigurasie leër soortgelyk soos volgende lyk:"
-#: ../pastebinit:188
+#: ../pastebinit:218
msgid "Invalid arguments!\n"
msgstr "Ongeldige argumente!\n"
-#: ../pastebinit:232
+#: ../pastebinit:241
+msgid "Supported pastebins:"
+msgstr ""
+
+#: ../pastebinit:268
msgid "Unable to read from: %s"
msgstr "Kan nie van %s lees nie"
-#: ../pastebinit:234
+#: ../pastebinit:270
msgid "You are trying to send an empty document, exiting."
msgstr ""
-#: ../pastebinit:265
+#: ../pastebinit:279
+msgid "The content you are trying to send exceeds the pastebin's size limit."
+msgstr ""
+
+#: ../pastebinit:310
msgid ""
"Unable to read or parse the result page, it could be a server timeout or a "
"change server side, try with another pastebin."
@@ -89,6 +129,9 @@
"Kan nie die resultaat bladsy lees nie, dit kan wees omdat daar geen antwoord "
"terug ontvang is van die rekenaar bediener nie, probeer met 'n ander pastebin"
+#~ msgid "Optional arguments:"
+#~ msgstr "Opsioneële argumente:"
+
#~ msgid "Required arguments:"
#~ msgstr "Vereiste argumente:"
@@ -99,17 +142,5 @@
#~ msgstr ""
#~ "Opsioneële argumente ondersteun alleen deur 1t2.us en paste.stgraber.org:"
-#~ msgid "\t-j "
-#~ msgstr "\t-j "
-
-#~ msgid "\t-m "
-#~ msgstr "\t-m "
-
-#~ msgid "\t-t "
-#~ msgstr "\t-t "
-
-#~ msgid "\t-u -p "
-#~ msgstr "\t-u -p "
-
#~ msgid "Error no arguments specified!\n"
#~ msgstr "Fout, geen argumente gespesifiseer!\n"
diff -Nru pastebinit-1.1/po/ca.po pastebinit-1.2/po/ca.po
--- pastebinit-1.1/po/ca.po 2010-02-18 01:36:18.000000000 +0000
+++ pastebinit-1.2/po/ca.po 2011-01-30 15:20:34.000000000 +0000
@@ -7,79 +7,121 @@
msgstr ""
"Project-Id-Version: pastebinit\n"
"Report-Msgid-Bugs-To: FULL NAME \n"
-"POT-Creation-Date: 2009-12-26 19:36+0000\n"
-"PO-Revision-Date: 2009-12-26 19:36+0000\n"
-"Last-Translator: Siegfried Gevatter \n"
+"POT-Creation-Date: 2011-01-09 20:24+0000\n"
+"PO-Revision-Date: 2011-01-25 16:21+0000\n"
+"Last-Translator: David Planella \n"
"Language-Team: Catalan \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-02-18 01:36+0000\n"
-"X-Generator: Launchpad (build Unknown)\n"
+"X-Launchpad-Export-Date: 2011-01-26 04:31+0000\n"
+"X-Generator: Launchpad (build 12177)\n"
-#: ../pastebinit:65
+#: ../pastebinit:62
+msgid "%s: no section [pastebin]"
+msgstr ""
+
+#: ../pastebinit:67
+msgid "%s: no 'basename' in [pastebin]"
+msgstr ""
+
+#: ../pastebinit:91
#, docstring
msgid "Return the parameters array for the selected pastebin"
-msgstr ""
+msgstr "Retorna la matriu de paràmetres per al pastebin seleccionat"
-#: ../pastebinit:96
+#: ../pastebinit:125
msgid ""
"Unknown website, please post a bugreport to request this pastebin to be "
"added (%s)"
msgstr ""
+"Es desconeix el lloc web. Envieu un informe d'error i sol·liciteu-hi que "
+"s'inclogui aquest pastebin (%s)"
-#: ../pastebinit:119
-msgid "Optional arguments:"
-msgstr "Arguments opcionals:"
-
-#: ../pastebinit:120
-msgid "\t-h This help screen"
+#: ../pastebinit:148
+msgid "Optional arguments (not supported by all pastebins):"
msgstr ""
-#: ../pastebinit:121
+#: ../pastebinit:149
+msgid "\t-a "
+msgstr "\t-a "
+
+#: ../pastebinit:150
msgid "\t-b "
+msgstr "\t-b "
+
+#: ../pastebinit:151
+msgid "\t-f "
+msgstr "\t-f "
+
+#: ../pastebinit:152
+msgid "\t-h This help screen"
+msgstr "\t-h Aquesta pantalla d'ajuda"
+
+#: ../pastebinit:153
+msgid "\t-i "
+msgstr "\t-i "
+
+#: ../pastebinit:154
+msgid "\t-l List all supported pastebins"
msgstr ""
-#: ../pastebinit:122
-msgid "\t-a "
+#: ../pastebinit:155
+msgid "\t-j "
msgstr ""
-#: ../pastebinit:123
-msgid "\t-f "
+#: ../pastebinit:156
+msgid "\t-m "
msgstr ""
-#: ../pastebinit:124
+#: ../pastebinit:157
msgid "\t-r "
+msgstr "\t-r "
+
+#: ../pastebinit:158
+msgid "\t-t "
msgstr ""
-#: ../pastebinit:161 ../pastebinit:174 ../pastebinit:186 ../pastebinit:230
-#: ../pastebinit:262 ../pastebinit:268
+#: ../pastebinit:159
+msgid "\t-u -p "
+msgstr "\t-u -p "
+
+#: ../pastebinit:191 ../pastebinit:204 ../pastebinit:216 ../pastebinit:266
+#: ../pastebinit:307 ../pastebinit:313
msgid "KeyboardInterrupt caught."
-msgstr ""
+msgstr "S'ha capturat una interrupció del tipus KeyboardInterrupt."
-#: ../pastebinit:177
+#: ../pastebinit:207
msgid "Error parsing configuration file!"
-msgstr "Hi ha hagut un error al analitzar el fitxer de configuració!"
+msgstr "S'ha produït un error en analitzar el fitxer de configuració"
-#: ../pastebinit:178
+#: ../pastebinit:208
msgid ""
"Please ensure that your configuration file looks similar to the following:"
msgstr ""
"Assegureu-vos que el vostre fitxer de configuració s'assembli al següent:"
-#: ../pastebinit:188
+#: ../pastebinit:218
msgid "Invalid arguments!\n"
msgstr "Arguments no vàlids!\n"
-#: ../pastebinit:232
+#: ../pastebinit:241
+msgid "Supported pastebins:"
+msgstr ""
+
+#: ../pastebinit:268
msgid "Unable to read from: %s"
msgstr "No s'ha pogut llegir de: %s"
-#: ../pastebinit:234
+#: ../pastebinit:270
msgid "You are trying to send an empty document, exiting."
+msgstr "Esteu intentant enviar un document buit; se sortirà."
+
+#: ../pastebinit:279
+msgid "The content you are trying to send exceeds the pastebin's size limit."
msgstr ""
-#: ../pastebinit:265
+#: ../pastebinit:310
msgid ""
"Unable to read or parse the result page, it could be a server timeout or a "
"change server side, try with another pastebin."
@@ -88,6 +130,9 @@
"degut a un excés del temps d'espera del servidor o a un canvi en la pàgina. "
"Proveu amb un altre servei."
+#~ msgid "Optional arguments:"
+#~ msgstr "Arguments opcionals:"
+
#~ msgid "Required arguments:"
#~ msgstr "Arguments necessaris:"
diff -Nru pastebinit-1.1/po/cs.po pastebinit-1.2/po/cs.po
--- pastebinit-1.1/po/cs.po 2010-02-18 01:36:16.000000000 +0000
+++ pastebinit-1.2/po/cs.po 2011-01-30 15:20:34.000000000 +0000
@@ -7,80 +7,123 @@
msgstr ""
"Project-Id-Version: pastebinit\n"
"Report-Msgid-Bugs-To: FULL NAME \n"
-"POT-Creation-Date: 2009-12-26 19:36+0000\n"
-"PO-Revision-Date: 2010-01-26 10:12+0000\n"
-"Last-Translator: Kuvaly [LCT] \n"
+"POT-Creation-Date: 2011-01-09 20:24+0000\n"
+"PO-Revision-Date: 2010-02-18 02:24+0000\n"
+"Last-Translator: Stéphane Graber \n"
"Language-Team: Czech \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-02-18 01:36+0000\n"
+"X-Launchpad-Export-Date: 2011-01-10 04:51+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
-#: ../pastebinit:65
+#: ../pastebinit:62
+msgid "%s: no section [pastebin]"
+msgstr ""
+
+#: ../pastebinit:67
+msgid "%s: no 'basename' in [pastebin]"
+msgstr ""
+
+#: ../pastebinit:91
#, docstring
msgid "Return the parameters array for the selected pastebin"
msgstr "Vrátit parametry pole pro vybraný pastebin"
-#: ../pastebinit:96
+#: ../pastebinit:125
msgid ""
"Unknown website, please post a bugreport to request this pastebin to be "
"added (%s)"
msgstr ""
-#: ../pastebinit:119
-msgid "Optional arguments:"
-msgstr "Volitelné argumenty:"
+#: ../pastebinit:148
+msgid "Optional arguments (not supported by all pastebins):"
+msgstr ""
-#: ../pastebinit:120
-msgid "\t-h This help screen"
-msgstr "\t-h Toto zobrazí nápovědu"
+#: ../pastebinit:149
+msgid "\t-a "
+msgstr "\t-a "
-#: ../pastebinit:121
+#: ../pastebinit:150
msgid "\t-b "
msgstr "\t-b "
-#: ../pastebinit:122
-msgid "\t-a "
-msgstr "\t-a "
-
-#: ../pastebinit:123
+#: ../pastebinit:151
msgid "\t-f "
msgstr "\t-f