Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
stgraber committed Nov 13, 2006
0 parents commit 192de8f
Show file tree
Hide file tree
Showing 7 changed files with 174 additions and 0 deletions.
22 changes: 22 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
pastebinit (0.3) feisty; urgency=low

* Make it work with paste.ubuntu-nl.org and all pastebin.com pastebins (maybe some others as well)
* Clean a little bit the code (no more regexp and parsing)
* Add a second parameter to give the Pastebin URL when not using the default one.

-- Stéphane Graber <stgraber@stgraber.org> Fri, 11 Nov 2006 19:26:25 +0100

pastebinit (0.2) feisty; urgency=low

* Fixing some debian packaging files
* Updating the usages
* Variable to store the Pastebin URL (to support more than one pastebin later)

-- Stéphane Graber <stgraber@stgraber.org> Fri, 11 Nov 2006 00:27:31 +0100

pastebinit (0.1) feisty; urgency=low

* Initial release

-- Stéphane Graber <stgraber@stgraber.org> Fri, 10 Nov 2006 22:00:16 +0100

1 change: 1 addition & 0 deletions debian/compat
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
5
14 changes: 14 additions & 0 deletions debian/control
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
Source: pastebinit
Section: misc
Priority: optional
Maintainer: Stéphane Graber <stgraber@stgraber.org>
Build-Depends: debhelper (>= 5)
Standards-Version: 3.7.2

Package: pastebinit
Architecture: all
Depends: python
Description: A command line pastebin client
This tools can send the result of a command or
a file passed as argument directly to a pastebin
(actually http://paste.ubuntu-nl.org).
28 changes: 28 additions & 0 deletions debian/copyright
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
This package was debianized by Stéphane Graber <stgraber@stgraber.org> on
Fri, 11 Nov 2006 00:27:16 +0100.

It was downloaded from http://www.stgraber.org

Upstream Author: Stéphane Graber <stgraber@stgraber.org>

Copyright:
Copyright (C) 2006 by Stéphane Graber <stgraber@stgraber.org>

License:

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this package; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, N: MA 02110-1301, USA.

The Debian packaging is (C) 2006, Stéphane Graber <stgraber@stgraber.org> and
is licensed under the GPL, see `/usr/share/common-licenses/GPL'.
1 change: 1 addition & 0 deletions debian/pastebinit.install
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pastebinit /usr/bin/
45 changes: 45 additions & 0 deletions debian/rules
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
#!/usr/bin/make -f
# -*- makefile -*-
# debian rules file for pastebinit

#export DH_VERBOSE=1


build: build-stamp

build-stamp:
dh_testdir
touch build-stamp

clean:
dh_testdir
dh_testroot
rm -f build-stamp
dh_clean

install: build
dh_testdir
dh_testroot
dh_clean -k
dh_installdirs
dh_installchangelogs
dh_installdocs
dh_installexamples
dh_install
dh_compress
dh_fixperms
dh_installdeb
dh_shlibdeps
dh_gencontrol
dh_md5sums
dh_builddeb


# Build architecture-independent files here.
binary-indep: build install
# We have nothing to do by default.

binary-arch:

binary: binary-indep
.PHONY: build clean binary-indep binary install
63 changes: 63 additions & 0 deletions pastebinit
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
#!/usr/bin/python

# Writen by Stephane Graber <stgraber@stgraber.org>
# Last modification : Fri Nov 10 21:57:40 CET 2006

# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA

import urllib, os, sys

try:
filename=sys.argv[1]
except:
sys.exit("usage:\n command | "+sys.argv[0]+" - [pastebin URL]\n "+sys.argv[0]+" file [pastebin URL]\n\n Default pastebin : http://ubuntu.pastebin.com")

try:
website=sys.argv[2]
except:
website="http://ubuntu.pastebin.com"

if filename == "-":
content=sys.stdin.read()
else:
try:
f=open(filename)
content=f.read()
f.close()
except:
sys.exit("Unable to open : "+filename)

user=os.environ.get('USER')

params={}

#Common fro pastebin.com and paste.ubuntu-nl.org
params['poster']=user

#For pastebin.com
params['parent_pid']=""
params['format']="text"
params['code2']=content
params['paste']="Send"
params['remember']="1"
params['expiry']="f"

#For paste.ubuntu-nl.org
params['content']=content

params=urllib.urlencode(params)

page=urllib.urlopen(website+'/',params)
print page.url

0 comments on commit 192de8f

Please sign in to comment.