debian/0000755000000000000000000000000011770700564007175 5ustar debian/control0000644000000000000000000000157511770700564010610 0ustar Source: rhinote Section: x11 Priority: optional Maintainer: Andrea Bolognani Build-Depends: debhelper (>= 7), pandoc Standards-Version: 3.9.3 Homepage: http://rhinote.tuxfamily.org/ Vcs-Git: git://anonscm.debian.org/git/collab-maint/rhinote.git Vcs-Browser: http://anonscm.debian.org/gitweb/?p=collab-maint/rhinote.git;a=summary Package: rhinote Architecture: all Depends: python, python-tk, enscript, cups-client | lpr, ${misc:Depends} Description: virtual sticky-notes for your desktop Rhinote is a small program that provides virtual sticky-notes. It's handy for jotting down quick notes or holding copied text that you plan to paste elsewhere later. . Notes can be saved as plain text for later viewing/editing with Rhinote or any other text editor. . Rhinote is designed to be "keyboard friendly", that is, every single action is bound to a specific keystroke. debian/manpages0000644000000000000000000000001211770700564010704 0ustar rhinote.1 debian/changelog0000644000000000000000000000477711770700564011066 0ustar rhinote (0.7.4-2) unstable; urgency=low * U01-simplify-imports.diff: - improve the way modules are imported. * U02-use-secure-printfile.diff: - avoid potential symlink attacks and cluttering the user's home. * U03-test-for-external-commands.diff: - ensure external commands are available before calling them. * U04-use-popen.diff: - replace os.system() with the more secure subprocess.Popen(). * U05-support-lp.diff: - add support for the lp command in addition to lpr. * U06-set-print-job-name.diff: - provide a descriptive name for the print job. * U07-set-class-name.diff: - set application name for use by window managers. * Simplify Depends: to cups-client | lpr. * Raise priority to optional, as all packages Rhinote depends on are of optional priority. * Bump Standards-Version to 3.9.3 (no changes needed). -- Andrea Bolognani Mon, 18 Jun 2012 22:47:34 +0200 rhinote (0.7.4-1) unstable; urgency=low * New upstream version. * Switch to source format 3.0 (quilt). * Register HTML documentation with doc-base. * Rewrite man page in Markdown; add pandoc to Build-Depends. * Drop priority to extra. * Move to debhelper v7. * Add Vcs-* control fields. * Bump Standards-Version to 3.9.2 (no changes needed). -- Andrea Bolognani Sun, 08 Jan 2012 11:46:39 +0100 rhinote (0.7.2-1) unstable; urgency=low * New upstream version * Install upstream-provided PNG icons * Replaced cupsys-bsd with cups-bsd in Depends * Updated watch file to reflect hosting change * Bumped Standards-Version to 3.8.0 (no changes needed) -- Andrea Bolognani Sat, 19 Jul 2008 08:47:59 +0200 rhinote (0.7.1-1) unstable; urgency=low * New upstream version * Fixed watch file to match the change in upstream's versioning scheme -- Andrea Bolognani Mon, 31 Mar 2008 10:07:24 +0200 rhinote (0.7.0-2) unstable; urgency=low * Updated to new menu policy * Bumped Standards-Version to 3.7.3 (changes made to conform with the new menu policy) * Fixed the desktop file to use the correct categories * Added watch file * Moved Homepage to the proper control field * Changed debian/copyright to comply with the proposed machine-interpretable copyright format (with some modifications) -- Andrea Bolognani Mon, 18 Feb 2008 12:39:35 +0100 rhinote (0.7.0-1) unstable; urgency=low * Initial release. Closes: #359278 -- Andrea Bolognani Fri, 24 Mar 2006 20:21:32 +0100 debian/rhinote.xpm0000644000000000000000000002167511770700564011406 0ustar /* XPM */ static char * rhinote_32x32_xpm[] = { "32 32 432 2", " c None", ". c #444E58", "+ c #8194A8", "@ c #8295A8", "# c #8194AA", "$ c #8DA0B5", "% c #8D9FB3", "& c #8EA1B6", "* c #8DA0B4", "= c #859AB1", "- c #8699AF", "; c #A3AFBC", "> c #94A3B3", ", c #92A2B4", "' c #9CA7B5", ") c #8B9CAF", "! c #98A4B4", "~ c #94A2B2", "{ c #3B444E", "] c #3E4956", "^ c #CCD6EA", "/ c #EEEEF7", "( c #8B9DBA", "_ c #9FACBF", ": c #A2ACBC", "< c #A4AFC0", "[ c #B4BBC8", "} c #7087A9", "| c #7D95B9", "1 c #7D94B8", "2 c #7C94B8", "3 c #8195B7", "4 c #FFFCF4", "5 c #C7C9CD", "6 c #B8BFCE", "7 c #FBF0E5", "8 c #A2AEC1", "9 c #DBD7D9", "0 c #DCDADC", "a c #3E4551", "b c #3C444E", "c c #697A8C", "d c #607081", "e c #5D6E84", "f c #64768F", "g c #63758F", "h c #62758E", "i c #66778F", "j c #687990", "k c #67788F", "l c #62738C", "m c #7E8997", "n c #6B7A8F", "o c #6A7A8F", "p c #7B8796", "q c #63748B", "r c #758495", "s c #818FA0", "t c #393F46", "u c #5A5A48", "v c #E2DD97", "w c #DCD893", "x c #DBD792", "y c #DAD691", "z c #D9D591", "A c #E7E39B", "B c #61604C", "C c #65644C", "D c #FFFEA9", "E c #FEF9A8", "F c #FCF7A7", "G c #FCF8A7", "H c #FFFFB0", "I c #6F6E53", "J c #FEFAA7", "K c #F8F4A5", "L c #F6F2A4", "M c #F7F2A5", "N c #FFFFAE", "O c #F7F2A4", "P c #F9F5A6", "Q c #FDF8A8", "R c #FDF9A9", "S c #FFFDAC", "T c #FEFAAA", "U c #F3EFA3", "V c #F4F0A3", "W c #FFFCAA", "X c #FFFFAF", "Y c #FFFCAB", "Z c #FBF8A8", "` c #F9F5A7", " . c #F7F3A5", ".. c #F6F2A5", "+. c #BEBB7F", "@. c #C0BD7E", "#. c #BDB97B", "$. c #23261A", "%. c #FCF8A6", "&. c #FEFAA6", "*. c #FFFFAB", "=. c #C0BF7E", "-. c #2C2B1D", ";. c #282A1B", ">. c #B5B377", ",. c #B9B77B", "'. c #B9B67C", "). c #FFFBAA", "!. c #FEFAAB", "~. c #F5F1A4", "{. c #F6F1A3", "]. c #FFFEAC", "^. c #C3C180", "/. c #241527", "(. c #292A29", "_. c #383A42", ":. c #A3A58B", "<. c #220C15", "[. c #080F26", "}. c #040810", "|. c #090002", "1. c #222633", "2. c #756670", "3. c #A6A989", "4. c #494A4F", "5. c #000000", "6. c #000006", "7. c #929062", "8. c #949264", "9. c #1D1D17", "0. c #ECE99D", "a. c #ECE99E", "b. c #C5C383", "c. c #2B2E31", "d. c #7B6E67", "e. c #868A71", "f. c #9A9E71", "g. c #A5AA7B", "h. c #C1A59E", "i. c #C8BAB1", "j. c #B4B7B7", "k. c #AB9D7A", "l. c #75786E", "m. c #92837A", "n. c #848662", "o. c #B1928E", "p. c #070907", "q. c #62633E", "r. c #8F8D60", "s. c #D3CE8D", "t. c #E3DF97", "u. c #EFEBA0", "v. c #FFFDAB", "w. c #C3C182", "x. c #07000A", "y. c #5F5148", "z. c #9FA388", "A. c #BDA07A", "B. c #9A7E5C", "C. c #977D5C", "D. c #978D61", "E. c #988D5C", "F. c #93966D", "G. c #74785E", "H. c #95876E", "I. c #95997D", "J. c #6B7067", "K. c #65685C", "L. c #6C6F6C", "M. c #61635E", "N. c #28191E", "O. c #3D3F2F", "P. c #949262", "Q. c #ACA972", "R. c #D9D692", "S. c #EEEA9E", "T. c #F7F3A4", "U. c #323223", "V. c #3F413A", "W. c #777A5E", "X. c #BFA1A9", "Y. c #686D67", "Z. c #A29861", "`. c #9F7340", " + c #8C8156", ".+ c #8F8376", "++ c #7A6B75", "@+ c #65574E", "#+ c #81747A", "$+ c #C1A3A8", "%+ c #86786C", "&+ c #908355", "*+ c #968787", "=+ c #817370", "-+ c #7D6F75", ";+ c #0C0F19", ">+ c #79764E", ",+ c #AEAA73", "'+ c #E2DF97", ")+ c #F3F0A3", "!+ c #FFFFB2", "~+ c #363626", "{+ c #4B4B4C", "]+ c #8E916B", "^+ c #95988C", "/+ c #32352B", "(+ c #756750", "_+ c #5D726E", ":+ c #9B7F68", "<+ c #998D73", "[+ c #5C5E5D", "}+ c #5E5F3B", "|+ c #65675D", "1+ c #ADB0A4", "2+ c #898388", "3+ c #07020A", "4+ c #919378", "5+ c #98994D", "6+ c #45472F", "7+ c #A7A99E", "8+ c #646443", "9+ c #202119", "0+ c #E5E298", "a+ c #EDE99F", "b+ c #F3EFA2", "c+ c #363624", "d+ c #171819", "e+ c #6A6B67", "f+ c #9F8074", "g+ c #1E2015", "h+ c #414236", "i+ c #686C4F", "j+ c #73675B", "k+ c #707369", "l+ c #5A5C38", "m+ c #5B5B38", "n+ c #7A7C71", "o+ c #A1A297", "p+ c #A19A7B", "q+ c #625C60", "r+ c #1B1C24", "s+ c #74776E", "t+ c #B1A18A", "u+ c #B8A79D", "v+ c #272831", "w+ c #817F57", "x+ c #CCC888", "y+ c #E2DF96", "z+ c #313220", "A+ c #2D2D37", "B+ c #3C3D1E", "C+ c #5F6064", "D+ c #111213", "E+ c #323339", "F+ c #5E3F43", "G+ c #606355", "H+ c #57494D", "I+ c #363032", "J+ c #221A42", "K+ c #626347", "L+ c #5C3D44", "M+ c #44454A", "N+ c #090B13", "O+ c #17180E", "P+ c #1F1307", "Q+ c #70727A", "R+ c #5C5D41", "S+ c #737357", "T+ c #3B3927", "U+ c #8D8B5D", "V+ c #ADAB74", "W+ c #DAD791", "X+ c #EFEA9F", "Y+ c #2F301E", "Z+ c #D3D3DB", "`+ c #434346", " @ c #19191A", ".@ c #3A3924", "+@ c #2E2F1F", "@@ c #121316", "#@ c #030700", "$@ c #070002", "%@ c #020005", "&@ c #1D150F", "*@ c #2E3128", "=@ c #696B60", "-@ c #4A4B2F", ";@ c #4D4B33", ">@ c #5C5A3C", ",@ c #333429", "'@ c #040513", ")@ c #2C2B1E", "!@ c #848257", "~@ c #B1AE75", "{@ c #E1DE96", "]@ c #F1EDA0", "^@ c #FEF9A9", "/@ c #706F4A", "(@ c #00000B", "_@ c #727354", ":@ c #050602", "<@ c #59583B", "[@ c #7D7B54", "}@ c #8E8C5D", "|@ c #848258", "1@ c #76754E", "2@ c #6C6B48", "3@ c #706E4A", "4@ c #3C3B27", "5@ c #727258", "6@ c #302E21", "7@ c #676644", "8@ c #8A885B", "9@ c #ABA972", "0@ c #A09E6A", "a@ c #848157", "b@ c #7F7D54", "c@ c #A3A06D", "d@ c #CAC787", "e@ c #EDEA9F", "f@ c #F5F1A3", "g@ c #F7F4A6", "h@ c #FFFEAB", "i@ c #6F5052", "j@ c #3C3D41", "k@ c #49482F", "l@ c #9A9666", "m@ c #B2AF77", "n@ c #B2AE76", "o@ c #A6A36E", "p@ c #9E9B69", "q@ c #A8A56F", "r@ c #605E3F", "s@ c #707056", "t@ c #010103", "u@ c #787651", "v@ c #A2A06C", "w@ c #CBC887", "x@ c #C5C282", "y@ c #AFAC75", "z@ c #ABA871", "A@ c #C5C083", "B@ c #DEDB94", "C@ c #F4EFA4", "D@ c #85887B", "E@ c #20211C", "F@ c #A19D6A", "G@ c #C3C082", "H@ c #E0DB95", "I@ c #E0DE95", "J@ c #DFDB95", "K@ c #EAE79D", "L@ c #5C5B3D", "M@ c #7C7C7D", "N@ c #191A12", "O@ c #000103", "P@ c #848058", "Q@ c #E3DF98", "R@ c #EAE79C", "S@ c #E4E199", "T@ c #E9E59B", "U@ c #F0ECA1", "V@ c #FBF8A7", "W@ c #7F7E56", "X@ c #6C6947", "Y@ c #908E5F", "Z@ c #B9B67B", "`@ c #E5E198", " # c #EEEB9F", ".# c #F8F6A5", "+# c #5E5D3F", "@# c #0E1019", "## c #29291C", "$# c #58563A", "%# c #87855A", "&# c #B6B379", "*# c #E7E29A", "=# c #F0EEA1", "-# c #F2EFA1", ";# c #F1EEA1", "># c #E2DE96", ",# c #C8C485", "'# c #9E9A68", ")# c #8C8A5D", "!# c #999766", "~# c #BBB67C", "{# c #E6E299", "]# c #FAF6A6", "^# c #EDEA9E", "/# c #CFCC8A", "(# c #88865B", "_# c #A7A46F", ":# c #CCC989", "<# c #F5F0A3", "[# c #EBE79C", "}# c #DBD793", "|# c #C1BE80", "1# c #B5B278", "2# c #CECC8A", "3# c #F6F1A4", "4# c #E8E59B", "5# c #D5D28D", "6# c #B7B479", "7# c #B3B077", "8# c #CBC787", "9# c #E1DD96", "0# c #F2EEA1", "a# c #F6F2A3", "b# c #ECE79E", "c# c #E7E299", "d# c #F4F0A4", "e# c #F2EEA2", "f# c #EEEA9F", "g# c #E6E19A", "h# c #E5E299", "i# c #F4EFA2", "j# c #F3EEA3", "k# c #F2EFA2", "l# c #FFFDA9", "m# c #FBF6A6", "n# c #F9F5A5", "o# c #595842", "p# c #FFFEB0", "q# c #FDF8AD", "r# c #FCF7AC", "s# c #FCF7AD", "t# c #FFFFB3", "u# c #686750", "v# c #2A2A24", "w# c #403F2F", "x# c #403F2E", "y# c #1E1E18", ". + @ # $ % & * = = = = = = = = = = = = = = = - ; > , ' ) ! ~ { ", "] ^ / ( _ : < [ } | 1 1 1 1 1 1 1 1 1 1 1 1 2 3 4 5 6 7 8 9 0 a ", "b c d e f g h f i j k k k k k k k k k k k k k l m n o p q r s t ", "u v w x x x x x x x x x x x x x x x x x x x x y z z z z z z A B ", "C D E F F F F F F F F F F F F F F F F F F F F F F F F F F G H I ", "C J K L L L L L L L L L L L L L L L L L L L L L L L L L L M N I ", "C J K L L L L L L L L L L L L L L L L L L L L L L L L L L M N I ", "C J K L L L L L L L L L L L L L L L L L L L L L L L L L L M N I ", "C J K L L L L L L L L L L L L L L L L L L L L L L L L L L M N I ", "C J K L L L L L L O M M M M M M M M M M M M M O L L L L L M N I ", "C J K L L L L P Q R S T F U V K W X N Y Z ` .O .. .O L L M N I ", "C J K L L L P N +.@.#.$.%.&.*.N =.-.;.>.,.'.R ).!.G ~.{.O M N I ", "C J K L L P ].^./.(._.:.<.[.}.|.1.2.3.4.5.6.7.8.9.0.a.U . .N I ", "C J K L P X b.c.d.e.f.g.h.i.j.k.l.m.n.o.p.q.5.5.r.s.t.u.L .N I ", "C J K O v.w.x.y.z.A.B.C.D.E.F.G.H.I.J.K.L.M.N.O.P.Q.R.S.T. .N I ", "C J K M X U.V.W.X.Y.Z.`. +.+++@+#+$+%+&+*+=+-+;+>+,+'+)+~.L X I ", "C J K .!+~+{+]+^+/+(+_+:+<+[+}+|+1+2+3+4+5+6+7+5.8+9+0+a+b+X I ", "C J K .X c+d+e+f+g+h+i+j+k+l+m+n+o+p+q+r+s+t+u+v+5.w+x+y+u.N I ", "C J K L X z+A+B+C+D+E+F+G+H+I+J+K+L+M+N+O+P+Q+R+S+T+U+V+W+X+N I ", "C J K L N Y+Z+`+ @.@+@@@#@$@%@&@*@=@-@5.;@>@,@5.'@)@!@~@{@]@N I ", "C J K .^@/@(@_@:@<@[@}@|@1@2@3@4@5@5.6@7@8@9@0@a@b@c@d@e@f@X I ", "C J K .g@h@5.i@j@k@l@m@n@o@p@q@r@s@5.t@u@v@w@x@y@z@A@B@b+L X I ", "C J K M C@W 5.5.D@E@F@G@H@I@J@K@L@M@N@O@P@~@Q@R@S@'+T@U@~. .N I ", "C J K M f@V@W@X@5.5.Y@Z@`@ #]@.#+#@###$#%#&#*#=#-#;#U ~.M .N I ", "C J K L ..M >#,#'#)#!#~#{#U T.]#^#/#!#(#_#:#S.<# .M M O L M N I ", "C J K L M <#[#}#|#1#Z@2#[#U .3#4#5#6#7#8#9#0#a#O L L L L M N I ", "C J K L O .f@0#b#c#{#[#d#L O .e#f#g#h#S.0# .O L L L L L M N I ", "C J K L L O M L V i#i#j#L O L O {.V i#k#V a#O L L L L L L M N I ", "C J K L L L L O M M M M O L L L O M M M M O L L L L L L L M N I ", "C l#m#n#n#n#n#n#n#n#n#n#n#n#n#n#n#n#n#n#n#n#n#n#n#n#n#n#n#P X I ", "o#p#q#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#r#s#t#u#", "v#w#w#w#w#w#w#w#w#w#w#w#w#w#w#w#w#w#w#w#w#w#w#w#w#w#w#w#w#w#x#y#"}; debian/menu0000644000000000000000000000040711770700564010065 0ustar ?package(rhinote):needs="X11" \ section="Applications/Editors" \ title="Rhinote" \ longtitle="Virtual sticky-notes" \ icon="/usr/share/pixmaps/rhinote.xpm" \ command="/usr/bin/rhinote" debian/docs0000644000000000000000000000003611770700564010047 0ustar rhinote-doc.html AUTHORS NEWS debian/doc-base0000644000000000000000000000045411770700564010600 0ustar Document: rhinote-doc Title: Rhinote Documentation Author: Marv Boyes Abstract: This document explains how Rhinote works and what its features are. Section: Editors Format: HTML Index: /usr/share/doc/rhinote/rhinote-doc.html Files: /usr/share/doc/rhinote/rhinote-doc.html debian/install0000644000000000000000000000033411770700564010566 0ustar rhinote.py usr/bin debian/rhinote.desktop usr/share/applications debian/rhinote.xpm usr/share/pixmaps icons/rhinote_32x32.png usr/share/icons/hicolor/32x32/apps icons/rhinote_48x48.png usr/share/icons/hicolor/48x48/apps debian/copyright0000644000000000000000000000226111770700564011131 0ustar Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: Rhinote Upstream-Contact: Marv Boyes Source: http://rhinote.tuxfamily.org/ Files: * Copyright: 2006-2010, Marv Boyes License: GPL-2+ Files: debian/* Copyright: 2006-2012, Andrea Bolognani License: GPL-2+ License: GPL-2+ 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, 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 . On Debian systems, the full text of the GNU General Public License version 2 can be found in the file `/usr/share/common-licenses/GPL-2'. debian/watch0000644000000000000000000000014611770700564010227 0ustar version=3 http://rhinote.tuxfamily.org/download.html \ (?:.*)/rhinote-download.php\?version=([\d\.]+) debian/rules0000755000000000000000000000276011770700564010262 0ustar #!/usr/bin/make -f DESTDIR="$(CURDIR)/debian/rhinote" BINDIR="$(DESTDIR)/usr/bin" ICONDIR="$(DESTDIR)/usr/share/icons/hicolor" build: build-arch build-indep build-arch: build-indep: build-indep-stamp build-indep-stamp: dh_testdir pandoc -s -w man -o rhinote.1 debian/rhinote.1.text touch $@ binary: binary-arch binary-indep binary-arch: build-arch binary-indep: build-indep dh_testdir dh_testroot dh_prep dh_install mv "$(BINDIR)/rhinote.py" \ "$(BINDIR)/rhinote" mv "$(ICONDIR)/32x32/apps/rhinote_32x32.png" \ "$(ICONDIR)/32x32/apps/rhinote.png" mv "$(ICONDIR)/48x48/apps/rhinote_48x48.png" \ "$(ICONDIR)/48x48/apps/rhinote.png" dh_installchangelogs dh_installdocs dh_installman dh_installmenu dh_compress dh_fixperms dh_installdeb dh_gencontrol dh_md5sums dh_builddeb clean: dh_testdir dh_testroot rm -f build-indep-stamp dh_clean # Rebuild the series file by looking at the contents of the patches directory. # # Patches with names starting with D (Debian-specific) should be applied # after those with names starting with U (to be forwarded upstream). rebuild-series: @( \ SERIES=debian/patches/series; \ echo "# To rebuild this file, use \`debian/rules $@'" \ > $${SERIES}; \ for patch in debian/patches/U*.diff debian/patches/D*.diff; \ do \ test -f "$${patch}" || continue; \ patch=$$(basename $${patch}); \ echo $${patch} \ >> $${SERIES}; \ done; \ ) .PHONY: build build-arch build-indep binary binary-arch binary-indep clean rebuild-series debian/patches/0000755000000000000000000000000011770700564010624 5ustar debian/patches/U03-test-for-external-commands.diff0000644000000000000000000000477111770700564017216 0ustar Description: Make sure external commands are available External commands are not guaranteed to be available on the system, so test for their existence before running them. Author: Andrea Bolognani Forwarded: Marv Boyes Last-Update: 2012-02-01 Index: rhinote.git/rhinote.py =================================================================== --- rhinote.git.orig/rhinote.py 2012-01-30 18:03:46.679582502 +0100 +++ rhinote.git/rhinote.py 2012-01-31 20:01:00.235029574 +0100 @@ -81,14 +81,19 @@ Rhinote() def printfile(self, whatever = None): + if not self.printcommand: + tkMessageBox.showerror('Print error', 'Print command (lpr) not found') + return + if not self.formatcommand: + tkMessageBox.showerror('Print error', 'Format command (enscript) not found') + return # Use a secure temp file for printing f = tempfile.NamedTemporaryFile(prefix = 'Rhinoteprintfile-', delete = False) f.write(self.get('1.0', 'end')) f.close() # 'enscript' formats the text; lpr sends it to the default printer; # enscript's -B option suppresses page headers. - os.system('enscript -B --word-wrap %s > lpr &' % f.name) - os.unlink(f.name) + os.system('%s -B --word-wrap %s > %s &' % (self.formatcommand, f.name, self.printcommand)) def help(self, whatever = None): tkMessageBox.showinfo('Rhinote Help', message = ''' @@ -114,6 +119,23 @@ http://rhinote.tuxfamily.org ''') + def which(self, cmd): + # Abort immediately if PATH is not set + path = os.getenv('PATH') + if not path: + return None + # Look in all directories listed in PATH + dirs = path.split(os.pathsep) + path = None + for d in dirs: + f = os.path.join(d, cmd) + # f must be an executable file + if os.path.isfile(f) and os.access(f, os.X_OK): + # Stop after the first success + path = f + break + return path + def __init__(self, master, **kw): Tkinter.Text.__init__(self, master, **kw) self.bind('', self.new_window) @@ -135,6 +157,9 @@ ('Rhinote files', '*.rhi'), ('All files', '*'), ] + # Find print and format commands + self.printcommand = self.which('lpr') + self.formatcommand = self.which('enscript') # make it so: if __name__ == '__main__': debian/patches/U07-set-class-name.diff0000644000000000000000000000144111770700564014643 0ustar Description: Set class name The default class name for Tk application is "Tk". . This patch sets it to "Rhinote", so the correct application name is displayed in such places as the GNOME Shell top bar. Author: Andrea Bolognani Forwarded: Marv Boyes Last-Update: 2012-02-01 Index: rhinote.git/rhinote.py =================================================================== --- rhinote.git.orig/rhinote.py 2012-02-01 16:18:17.807886562 +0100 +++ rhinote.git/rhinote.py 2012-02-01 16:20:32.841318647 +0100 @@ -29,7 +29,7 @@ # the root window: def Rhinote(): - r = Tkinter.Tk() + r = Tkinter.Tk(className = 'Rhinote') r.option_add('*font', '{Helvetica} 11') t = TextWidget(r, bg = '#f9f3a9', wrap = 'word', undo = True) t.focus_set() debian/patches/U02-use-secure-printfile.diff0000644000000000000000000000336011770700564016076 0ustar Description: Use secure temp file for printing The contents of the current note have to be saved on a temp file for printing. Instead of using a well-defined file in the user's home directory, create a new temp file each time, and remove it after printing. Author: Andrea Bolognani Forwarded: Marv Boyes Last-Update: 2012-01-30 Index: rhinote.git/rhinote.py =================================================================== --- rhinote.git.orig/rhinote.py 2012-01-30 17:29:12.419650342 +0100 +++ rhinote.git/rhinote.py 2012-01-30 17:45:22.957135415 +0100 @@ -24,6 +24,7 @@ import Tkinter import tkFileDialog, tkMessageBox import os +import tempfile # the root window: def Rhinote(): @@ -80,12 +81,14 @@ Rhinote() def printfile(self, whatever = None): - f = open(self.printfilename, 'w') + # Use a secure temp file for printing + f = tempfile.NamedTemporaryFile(prefix = 'Rhinoteprintfile-', delete = False) f.write(self.get('1.0', 'end')) - f.close + f.close() # 'enscript' formats the text; lpr sends it to the default printer; # enscript's -B option suppresses page headers. - os.system('enscript -B --word-wrap $HOME/.Rhinoteprintfile > lpr &') + os.system('enscript -B --word-wrap %s > lpr &' % f.name) + os.unlink(f.name) def help(self, whatever = None): tkMessageBox.showinfo('Rhinote Help', message = ''' @@ -127,7 +130,6 @@ self.bind('', self.help) self.master = master self.filename = '' - self.printfilename = os.environ['HOME']+'/.Rhinoteprintfile' self._filetypes = [ ('Text/ASCII', '*.txt'), ('Rhinote files', '*.rhi'), debian/patches/U06-set-print-job-name.diff0000644000000000000000000000175711770700564015453 0ustar Description: Set print job name When printing from standard input, the job name defaults to "stdin". . This patch adds some parameters to the lp/lpr call to provide the user with a more descriptive name. Author: Andrea Bolognani Forwarded: Marv Boyes Last-Update: 2012-02-01 Index: rhinote.git/rhinote.py =================================================================== --- rhinote.git.orig/rhinote.py 2012-02-01 16:12:56.452244186 +0100 +++ rhinote.git/rhinote.py 2012-02-01 16:13:02.548318787 +0100 @@ -178,9 +178,10 @@ ] # Find print and format commands self.printcommand = self.which('lp') + self.printargs = ['-t', 'Rhinote file'] if not self.printcommand: self.printcommand = self.which('lpr') - self.printargs = [] + self.printargs = ['-T', 'Rhinote file'] self.formatcommand = self.which('enscript') self.formatargs = ['-B', '--word-wrap', '-o', '-'] debian/patches/U04-use-popen.diff0000644000000000000000000000476311770700564013751 0ustar Description: Call external commands via Popen Use the subprocess.Popen() method instead on relying on the less secure os.system() method when calling external commands. . Notify the user of printing errors as well. Author: Andrea Bolognani Forwarded: Marv Boyes Last-Update: 2012-02-01 Index: rhinote.git/rhinote.py =================================================================== --- rhinote.git.orig/rhinote.py 2012-02-01 16:09:01.233375853 +0100 +++ rhinote.git/rhinote.py 2012-02-01 16:10:04.326143254 +0100 @@ -25,6 +25,7 @@ import tkFileDialog, tkMessageBox import os import tempfile +import subprocess # the root window: def Rhinote(): @@ -91,9 +92,27 @@ f = tempfile.NamedTemporaryFile(prefix = 'Rhinoteprintfile-', delete = False) f.write(self.get('1.0', 'end')) f.close() - # 'enscript' formats the text; lpr sends it to the default printer; - # enscript's -B option suppresses page headers. - os.system('%s -B --word-wrap %s > %s &' % (self.formatcommand, f.name, self.printcommand)) + # Prepare the format command + formatargv = [self.formatcommand] + formatargv.extend(self.formatargs) + formatargv.append(f.name) + # Prepare the print command + printargv = [self.printcommand] + printargv.extend(self.printargs) + # Spawn both commands, piping the output of the format command + # to the input of the print command + fp = subprocess.Popen(formatargv, stdout=subprocess.PIPE) + pp = subprocess.Popen(printargv, stdin=fp.stdout, stdout=subprocess.PIPE) + # Required according to http://docs.python.org/library/subprocess.html#replacing-shell-pipeline + fp.stdout.close() + # Wait for both format and print command to complete + fp.wait() + pp.wait() + # Remove the secure temp file + os.unlink(f.name) + # Notify the user of the outcome of the printing operation + if fp.returncode > 0 or pp.returncode > 0: + tkMessageBox.showerror('Print error', 'Printing failed') def help(self, whatever = None): tkMessageBox.showinfo('Rhinote Help', message = ''' @@ -159,7 +178,9 @@ ] # Find print and format commands self.printcommand = self.which('lpr') + self.printargs = [] self.formatcommand = self.which('enscript') + self.formatargs = ['-B', '--word-wrap', '-o', '-'] # make it so: if __name__ == '__main__': debian/patches/series0000644000000000000000000000036111770700564012041 0ustar # To rebuild this file, use `debian/rules rebuild-series' U01-simplify-imports.diff U02-use-secure-printfile.diff U03-test-for-external-commands.diff U04-use-popen.diff U05-support-lp.diff U06-set-print-job-name.diff U07-set-class-name.diff debian/patches/U01-simplify-imports.diff0000644000000000000000000000360411770700564015353 0ustar Description: Simplify imports Importing a whole module using a wildcard is frowned upon, and it confuses static analysis tools such as pyflakes. Author: Andrea Bolognani Forwarded: Marv Boyes Last-Update: 2012-01-30 Index: rhinote.git/rhinote.py =================================================================== --- rhinote.git.orig/rhinote.py 2012-01-24 12:41:00.166800687 +0100 +++ rhinote.git/rhinote.py 2012-01-30 17:19:09.139264727 +0100 @@ -21,14 +21,13 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301 USA -from Tkinter import * +import Tkinter import tkFileDialog, tkMessageBox import os -from os import system # the root window: def Rhinote(): - r = Tk() + r = Tkinter.Tk() r.option_add('*font', '{Helvetica} 11') t = TextWidget(r, bg = '#f9f3a9', wrap = 'word', undo = True) t.focus_set() @@ -38,7 +37,7 @@ r.mainloop() # the text widget, and all of its functions: -class TextWidget(Text): +class TextWidget(Tkinter.Text): def save_file(self, whatever = None): if (self.filename == ''): @@ -86,7 +85,7 @@ f.close # 'enscript' formats the text; lpr sends it to the default printer; # enscript's -B option suppresses page headers. - system('enscript -B --word-wrap $HOME/.Rhinoteprintfile > lpr &') + os.system('enscript -B --word-wrap $HOME/.Rhinoteprintfile > lpr &') def help(self, whatever = None): tkMessageBox.showinfo('Rhinote Help', message = ''' @@ -113,7 +112,7 @@ ''') def __init__(self, master, **kw): - Text.__init__(self, master, **kw) + Tkinter.Text.__init__(self, master, **kw) self.bind('', self.new_window) self.bind('', self.new_window) self.bind('', self.open_file) debian/patches/U05-support-lp.diff0000644000000000000000000000252711770700564014160 0ustar Description: Support lp along with lpr for printing The original printing implementation only supports the lpr command; this patch add support for printing with lp as well. Author: Andrea Bolognani Forwarded: Marv Boyes Last-Update: 2012-02-01 Index: rhinote.git/rhinote.py =================================================================== --- rhinote.git.orig/rhinote.py 2012-02-01 16:12:54.460219812 +0100 +++ rhinote.git/rhinote.py 2012-02-01 16:12:56.452244186 +0100 @@ -83,7 +83,7 @@ def printfile(self, whatever = None): if not self.printcommand: - tkMessageBox.showerror('Print error', 'Print command (lpr) not found') + tkMessageBox.showerror('Print error', 'Print command (lp or lpr) not found') return if not self.formatcommand: tkMessageBox.showerror('Print error', 'Format command (enscript) not found') @@ -177,7 +177,9 @@ ('All files', '*'), ] # Find print and format commands - self.printcommand = self.which('lpr') + self.printcommand = self.which('lp') + if not self.printcommand: + self.printcommand = self.which('lpr') self.printargs = [] self.formatcommand = self.which('enscript') self.formatargs = ['-B', '--word-wrap', '-o', '-'] debian/rhinote.desktop0000644000000000000000000000026611770700564012244 0ustar [Desktop Entry] Name=Rhinote Comment=Virtual sticky-notes Comment[it]=Note di testo virtuali Exec=rhinote Terminal=false Type=Application Icon=rhinote Categories=Utility;TextEditor; debian/rhinote.1.text0000644000000000000000000000204111770700564011707 0ustar % RHINOTE(1) Rhinote % % January 2010 # NAME Rhinote - virtual sticky-notes for your desktop # SYNOPSIS rhinote # DESCRIPTION `Rhinote` is a simple program that provides virtual sticky-notes for your desktop. It's handy for jotting down quick notes or holding copied text that you plan to past elsewhere later. Notes can be saved as plain text for later viewing/editing with `Rhinote` or any other text editor. `Rhinote` is designed to be "keyboard friendly", that is, every single action is bound to a specific keystroke. # KEY BINDINGS Ctrl-x : Cut highlighted text. Ctrl-c : Copy highlighted text. Ctrl-v : Paste text from clipboard. Ctrl-n : Open new (blank) note. Ctrl-o : Open file (via a file dialog). Ctrl-s : Save current note. Ctrl-a : Save current note in a different file. Ctrl-p : Print current note. Ctrl-h : Display help window. # AUTHOR `Rhinote` was written by Marv Boyes . This manual page was written by Andrea Bolognani for the Debian project (but may be used by others). debian/source/0000755000000000000000000000000011770700564010475 5ustar debian/source/format0000644000000000000000000000001411770700564011703 0ustar 3.0 (quilt) debian/clean0000644000000000000000000000001211770700564010173 0ustar rhinote.1 debian/compat0000644000000000000000000000000211770700564010373 0ustar 7