Merge lp:~guadalinex-members/nautilus-md5sum/distutils into lp:nautilus-md5sum

Proposed by Amian
Status: Merged
Approved by: Amian
Approved revision: 89
Merge reported by: Amian
Merged at revision: not available
Proposed branch: lp:~guadalinex-members/nautilus-md5sum/distutils
Merge into: lp:nautilus-md5sum
Diff against target: None lines
To merge this branch: bzr merge lp:~guadalinex-members/nautilus-md5sum/distutils
Reviewer Review Type Date Requested Status
Amian merge Approve
Review via email: mp+11194@code.launchpad.net

Commit message

change the method install package to distutils method

To post a comment you must log in.
Revision history for this message
Amian (amialinux) wrote :

Merge branch distutils with trunk

Revision history for this message
Amian (amialinux) wrote :

change the method install package to distutils method

review: Approve (merge)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added directory 'data'
2=== added file 'data/md5.glade'
3--- data/md5.glade 1970-01-01 00:00:00 +0000
4+++ data/md5.glade 2009-08-28 13:01:43 +0000
5@@ -0,0 +1,165 @@
6+<?xml version="1.0"?>
7+<glade-interface>
8+ <!-- interface-requires gtk+ 2.16 -->
9+ <!-- interface-naming-policy toplevel-contextual -->
10+ <widget class="GtkWindow" id="window1">
11+ <property name="width_request">455</property>
12+ <property name="height_request">145</property>
13+ <property name="visible">True</property>
14+ <property name="resizable">False</property>
15+ <property name="window_position">center-always</property>
16+ <property name="default_width">102</property>
17+ <property name="default_height">221</property>
18+ <property name="destroy_with_parent">True</property>
19+ <child>
20+ <widget class="GtkVBox" id="vbox1">
21+ <property name="height_request">135</property>
22+ <property name="visible">True</property>
23+ <child>
24+ <widget class="GtkVBox" id="vbox2">
25+ <property name="height_request">78</property>
26+ <property name="visible">True</property>
27+ <child>
28+ <widget class="GtkFixed" id="fixed1">
29+ <property name="height_request">35</property>
30+ <property name="visible">True</property>
31+ <child>
32+ <widget class="GtkLabel" id="lbDef">
33+ <property name="width_request">450</property>
34+ <property name="height_request">40</property>
35+ <property name="visible">True</property>
36+ <property name="extension_events">cursor</property>
37+ <property name="justify">center</property>
38+ <property name="wrap">True</property>
39+ <property name="wrap_mode">char</property>
40+ <property name="selectable">True</property>
41+ </widget>
42+ <packing>
43+ <property name="x">2</property>
44+ <property name="y">2</property>
45+ </packing>
46+ </child>
47+ </widget>
48+ <packing>
49+ <property name="expand">False</property>
50+ <property name="position">0</property>
51+ </packing>
52+ </child>
53+ <child>
54+ <widget class="GtkHBox" id="hbox1">
55+ <property name="visible">True</property>
56+ <child>
57+ <widget class="GtkFixed" id="fixed2">
58+ <property name="height_request">35</property>
59+ <property name="visible">True</property>
60+ <property name="extension_events">cursor</property>
61+ <child>
62+ <widget class="GtkLabel" id="lbMd5">
63+ <property name="width_request">360</property>
64+ <property name="height_request">30</property>
65+ <property name="visible">True</property>
66+ <property name="justify">center</property>
67+ <property name="wrap">True</property>
68+ <property name="wrap_mode">char</property>
69+ <property name="selectable">True</property>
70+ </widget>
71+ <packing>
72+ <property name="x">2</property>
73+ <property name="y">2</property>
74+ </packing>
75+ </child>
76+ </widget>
77+ <packing>
78+ <property name="expand">False</property>
79+ <property name="position">0</property>
80+ </packing>
81+ </child>
82+ <child>
83+ <widget class="GtkFixed" id="fixed3">
84+ <property name="height_request">30</property>
85+ <property name="visible">True</property>
86+ <child>
87+ <widget class="GtkButton" id="copy">
88+ <property name="width_request">64</property>
89+ <property name="height_request">31</property>
90+ <property name="visible">True</property>
91+ <property name="can_focus">True</property>
92+ <property name="receives_default">True</property>
93+ <signal name="clicked" handler="on_copy_clicked"/>
94+ </widget>
95+ </child>
96+ </widget>
97+ <packing>
98+ <property name="position">1</property>
99+ </packing>
100+ </child>
101+ </widget>
102+ <packing>
103+ <property name="expand">False</property>
104+ <property name="fill">False</property>
105+ <property name="position">1</property>
106+ </packing>
107+ </child>
108+ </widget>
109+ <packing>
110+ <property name="expand">False</property>
111+ <property name="fill">False</property>
112+ <property name="position">0</property>
113+ </packing>
114+ </child>
115+ <child>
116+ <widget class="GtkAlignment" id="alignment1">
117+ <property name="height_request">35</property>
118+ <property name="visible">True</property>
119+ <property name="sensitive">False</property>
120+ <property name="xscale">0.98000001907348633</property>
121+ <property name="yscale">0</property>
122+ <child>
123+ <widget class="GtkProgressBar" id="pgbar">
124+ <property name="visible">True</property>
125+ <property name="sensitive">False</property>
126+ <property name="activity_mode">True</property>
127+ <property name="fraction">0.050000000000000003</property>
128+ <property name="pulse_step">0.070000000000000007</property>
129+ <property name="discrete_blocks">15</property>
130+ </widget>
131+ </child>
132+ </widget>
133+ <packing>
134+ <property name="expand">False</property>
135+ <property name="fill">False</property>
136+ <property name="position">1</property>
137+ </packing>
138+ </child>
139+ <child>
140+ <widget class="GtkHButtonBox" id="hbuttonbox1">
141+ <property name="height_request">30</property>
142+ <property name="visible">True</property>
143+ <child>
144+ <widget class="GtkButton" id="buttonOk">
145+ <property name="label" translatable="yes">Ok</property>
146+ <property name="visible">True</property>
147+ <property name="can_focus">True</property>
148+ <property name="can_default">True</property>
149+ <property name="receives_default">False</property>
150+ <property name="relief">half</property>
151+ <property name="xalign">0.50999999046325684</property>
152+ <signal name="clicked" handler="on_buttonOk_clicked"/>
153+ </widget>
154+ <packing>
155+ <property name="expand">False</property>
156+ <property name="fill">False</property>
157+ <property name="position">0</property>
158+ </packing>
159+ </child>
160+ </widget>
161+ <packing>
162+ <property name="expand">False</property>
163+ <property name="fill">False</property>
164+ <property name="position">2</property>
165+ </packing>
166+ </child>
167+ </widget>
168+ </child>
169+ </widget>
170+</glade-interface>
171
172=== added file 'data/md5sum-ico.png'
173Binary files data/md5sum-ico.png 1970-01-01 00:00:00 +0000 and data/md5sum-ico.png 2009-08-28 13:01:43 +0000 differ
174=== added file 'data/nautilus-md5sum-notification'
175--- data/nautilus-md5sum-notification 1970-01-01 00:00:00 +0000
176+++ data/nautilus-md5sum-notification 2009-08-28 13:01:43 +0000
177@@ -0,0 +1,7 @@
178+Name: nautilus-md5sum-notification
179+Priority: High
180+Terminal: False
181+DontShowAfterReboot: True
182+DisplayIf: true
183+Description: Nautilus md5sum has been installed. A session restart is needed to make it work properly. Once the session is restarted, a new option will display in nautilus context menu. This option lets you to check md5 sums of image files with '.iso' extension.
184+Description-es: Nautilus md5sum ha sido instalado. Para poder utilizarlo es necesario reiniciar su sesión. Una vez que reinicie la sesión dispondrá de dicha utilidad en el menú contextual de un fichero de imagen de CD/DVD con extensión .iso.
185
186=== modified file 'debian/changelog'
187--- debian/changelog 2009-08-17 18:20:18 +0000
188+++ debian/changelog 2009-09-03 08:04:53 +0000
189@@ -1,3 +1,25 @@
190+nautilus-md5sum (0.3.3-0ubuntu1) karmic; urgency=low
191+
192+ * Added setup.py and setup.cfg file to install python package with distutils method
193+ * Modified nautilus-md5sum.py to chage path of glade file
194+ * Modified rules file to use python-distutils
195+ * Changed prerem file permissions
196+ * Added python-all-dev, cdbs, gettext, python-central, python-distutils-extra depends in control
197+ * Added POTFILES.in and changed the package structure
198+ * Changed version in setup.py
199+ * Changed path scripts and data in setup.py
200+ * Changed path of script and glade in POTFILES.in
201+ * Deleted package label in setup.py, there aren't __init__.py file
202+
203+ -- David Amián Valle <amialinux@gmail.com> Thu, 03 Sep 2009 09:59:42 +0200
204+
205+nautilus-md5sum (0.3.2-0ubuntu2) karmic; urgency=low
206+
207+ * Removed python-dev and gettext packages as a depends
208+ * Added debian/prerm file for removing the update-notifier stuff
209+
210+ -- Juanje Ojeda Croissier <jojeda@emergya.es> Wed, 19 Aug 2009 13:09:39 +0200
211+
212 nautilus-md5sum (0.3.2-0ubuntu1) karmic; urgency=low
213
214 * Added i18n to nautilus-md5sum-notification
215
216=== modified file 'debian/control'
217--- debian/control 2009-08-13 12:30:57 +0000
218+++ debian/control 2009-08-28 11:20:12 +0000
219@@ -6,16 +6,17 @@
220 Uploaders: David Amián <amialinux@gmail.com>,
221 Álvaro Pinel <alvaropinel@gmail.com>,
222 Juanje Ojeda Croissier <jojeda@emergya.es>
223-Build-Depends: debhelper (>= 7)
224-Build-Depends-Indep: gettext
225+Build-Depends: debhelper (>= 7), cdbs (>=0.4.43), python-all-dev (>=2.3.5-11)
226+Build-Depends-Indep: python-central (>=0.5.6), gettext, python-distutils-extra
227 Standards-Version: 3.8.2
228 Homepage: http://launchpad.net/nautilus-md5sum
229 Vcs-Browser: http://codebrowse.launchpad.net/~guadalinex-members/nautilus-md5sum/trunk/changes
230 Vcs-Bzr: http://bazaar.launchpad.net/~guadalinex-members/nautilus-md5sum/trunk
231+XS-Python-Version: current
232
233 Package: nautilus-md5sum
234 Architecture: all
235-Depends: ${misc:Depends}, python, python-nautilus, python-dev, nautilus, python-gtk2, python-glade2, gettext
236+Depends: ${misc:Depends}, python, python-nautilus, nautilus, python-gtk2, python-glade2
237 Description: Nautilus' extension for checking MD5 sum
238 Nautilus' extension for checking MD5 sum of iso files.
239 .
240
241=== added file 'debian/prerm'
242--- debian/prerm 1970-01-01 00:00:00 +0000
243+++ debian/prerm 2009-08-28 11:20:12 +0000
244@@ -0,0 +1,9 @@
245+#!/bin/sh
246+
247+set -e
248+
249+if [ "$1" = "remove" ] || [ "$1" = "deconfigure" ] ; then
250+ rm -f /var/lib/update-notifier/user.d/nautilus-md5sum-notification
251+fi
252+
253+#DEBHELPER#
254
255=== modified file 'debian/rules'
256--- debian/rules 2009-08-14 12:33:09 +0000
257+++ debian/rules 2009-08-28 11:20:12 +0000
258@@ -1,106 +1,7 @@
259 #!/usr/bin/make -f
260-# -*- makefile -*-
261-# Sample debian/rules that uses debhelper.
262-# This file was originally written by Joey Hess and Craig Small.
263-# As a special exception, when this file is copied by dh-make into a
264-# dh-make output file, you may use that output file without restriction.
265-# This special exception was added by Craig Small in version 0.37 of dh-make.
266-
267-# Uncomment this to turn on verbose mode.
268-#export DH_VERBOSE=1
269-
270-
271-PKGNAME=$(shell grep "^Package: " debian/control | head -1 | cut -f 2 -d\ )
272-PKG=$(shell pwd)/debian/$(PKGNAME)
273-LOCALEDIR=$(PKG)/usr/share/locale
274-
275-
276-configure: configure-stamp
277-configure-stamp:
278- dh_testdir
279- # Add here commands to configure the package.
280-
281- touch configure-stamp
282-
283-
284-build: build-stamp
285-
286-build-stamp: configure-stamp
287- dh_testdir
288-
289- # Add here commands to compile the package.
290- #$(MAKE)
291- #docbook-to-man debian/nautilusmd5sum.sgml > nautilusmd5sum.1
292-
293- touch $@
294-
295-clean:
296- dh_testdir
297- dh_testroot
298- rm -f build-stamp configure-stamp
299-
300- # Add here commands to clean up after the build process.
301- #-$(MAKE) clean
302-
303- dh_clean
304-
305-install: build
306- dh_testdir
307- dh_testroot
308- dh_prep
309- dh_installdirs
310- dh_install nautilus-md5sum.py /usr/lib/nautilus/extensions-2.0/python/
311- dh_install nautilus-md5sum-notification /usr/share/nautilus-md5sum/
312- dh_install md5sum-ico.png /usr/share/icons/
313- dh_install md5.glade /usr/lib/nautilus/extensions-2.0/python/
314- dh_icons
315- # Add here commands to install the package into debian/nautilusmd5sum.
316- #$(MAKE) DESTDIR=$(CURDIR)/debian/nautilusmd5sum install
317-
318-
319-# Build architecture-independent files here.
320-binary-indep: build install
321- mkdir -p $(LOCALEDIR)
322- cd po; \
323- find -type d -exec mkdir -p "$(LOCALEDIR)/{}" \; ; \
324- find -type f -name "*.po" -exec sh -c "N='{}'; \
325- N=\$${N#*.\/} ; \
326- L=\$${N%\.po} ; \
327- D=\"$(LOCALEDIR)/\$$L/LC_MESSAGES\" ; \
328- mkdir -p \$$D ; \
329- msgfmt -o \$${D}\/\$(PKGNAME).mo \$$N" \;
330- dh_testdir
331- dh_testroot
332- dh_installchangelogs
333- dh_installdocs
334- dh_installexamples
335-# dh_install
336-# dh_installmenu
337-# dh_installdebconf
338-# dh_installlogrotate
339-# dh_installemacsen
340-# dh_installpam
341-# dh_installmime
342-# dh_python
343-# dh_installinit
344-# dh_installcron
345-# dh_installinfo
346- dh_installman
347- dh_link
348- dh_strip
349- dh_compress
350- dh_fixperms
351-# dh_perl
352-# dh_makeshlibs
353- dh_installdeb
354- dh_shlibdeps
355- dh_gencontrol
356- dh_md5sums
357- dh_builddeb
358-
359-
360-# Build architecture-dependent files here.
361-binary-arch: build install
362-
363-binary: binary-indep binary-arch
364-.PHONY: build clean binary-indep binary-arch binary install configure
365+
366+DEB_PYTHON_SYSTEM=pycentral
367+
368+include /usr/share/cdbs/1/rules/debhelper.mk
369+include /usr/share/cdbs/1/class/python-distutils.mk
370+
371
372=== removed file 'md5.glade'
373--- md5.glade 2009-06-23 12:46:46 +0000
374+++ md5.glade 1970-01-01 00:00:00 +0000
375@@ -1,165 +0,0 @@
376-<?xml version="1.0"?>
377-<glade-interface>
378- <!-- interface-requires gtk+ 2.16 -->
379- <!-- interface-naming-policy toplevel-contextual -->
380- <widget class="GtkWindow" id="window1">
381- <property name="width_request">455</property>
382- <property name="height_request">145</property>
383- <property name="visible">True</property>
384- <property name="resizable">False</property>
385- <property name="window_position">center-always</property>
386- <property name="default_width">102</property>
387- <property name="default_height">221</property>
388- <property name="destroy_with_parent">True</property>
389- <child>
390- <widget class="GtkVBox" id="vbox1">
391- <property name="height_request">135</property>
392- <property name="visible">True</property>
393- <child>
394- <widget class="GtkVBox" id="vbox2">
395- <property name="height_request">78</property>
396- <property name="visible">True</property>
397- <child>
398- <widget class="GtkFixed" id="fixed1">
399- <property name="height_request">35</property>
400- <property name="visible">True</property>
401- <child>
402- <widget class="GtkLabel" id="lbDef">
403- <property name="width_request">450</property>
404- <property name="height_request">40</property>
405- <property name="visible">True</property>
406- <property name="extension_events">cursor</property>
407- <property name="justify">center</property>
408- <property name="wrap">True</property>
409- <property name="wrap_mode">char</property>
410- <property name="selectable">True</property>
411- </widget>
412- <packing>
413- <property name="x">2</property>
414- <property name="y">2</property>
415- </packing>
416- </child>
417- </widget>
418- <packing>
419- <property name="expand">False</property>
420- <property name="position">0</property>
421- </packing>
422- </child>
423- <child>
424- <widget class="GtkHBox" id="hbox1">
425- <property name="visible">True</property>
426- <child>
427- <widget class="GtkFixed" id="fixed2">
428- <property name="height_request">35</property>
429- <property name="visible">True</property>
430- <property name="extension_events">cursor</property>
431- <child>
432- <widget class="GtkLabel" id="lbMd5">
433- <property name="width_request">360</property>
434- <property name="height_request">30</property>
435- <property name="visible">True</property>
436- <property name="justify">center</property>
437- <property name="wrap">True</property>
438- <property name="wrap_mode">char</property>
439- <property name="selectable">True</property>
440- </widget>
441- <packing>
442- <property name="x">2</property>
443- <property name="y">2</property>
444- </packing>
445- </child>
446- </widget>
447- <packing>
448- <property name="expand">False</property>
449- <property name="position">0</property>
450- </packing>
451- </child>
452- <child>
453- <widget class="GtkFixed" id="fixed3">
454- <property name="height_request">30</property>
455- <property name="visible">True</property>
456- <child>
457- <widget class="GtkButton" id="copy">
458- <property name="width_request">64</property>
459- <property name="height_request">31</property>
460- <property name="visible">True</property>
461- <property name="can_focus">True</property>
462- <property name="receives_default">True</property>
463- <signal name="clicked" handler="on_copy_clicked"/>
464- </widget>
465- </child>
466- </widget>
467- <packing>
468- <property name="position">1</property>
469- </packing>
470- </child>
471- </widget>
472- <packing>
473- <property name="expand">False</property>
474- <property name="fill">False</property>
475- <property name="position">1</property>
476- </packing>
477- </child>
478- </widget>
479- <packing>
480- <property name="expand">False</property>
481- <property name="fill">False</property>
482- <property name="position">0</property>
483- </packing>
484- </child>
485- <child>
486- <widget class="GtkAlignment" id="alignment1">
487- <property name="height_request">35</property>
488- <property name="visible">True</property>
489- <property name="sensitive">False</property>
490- <property name="xscale">0.98000001907348633</property>
491- <property name="yscale">0</property>
492- <child>
493- <widget class="GtkProgressBar" id="pgbar">
494- <property name="visible">True</property>
495- <property name="sensitive">False</property>
496- <property name="activity_mode">True</property>
497- <property name="fraction">0.050000000000000003</property>
498- <property name="pulse_step">0.070000000000000007</property>
499- <property name="discrete_blocks">15</property>
500- </widget>
501- </child>
502- </widget>
503- <packing>
504- <property name="expand">False</property>
505- <property name="fill">False</property>
506- <property name="position">1</property>
507- </packing>
508- </child>
509- <child>
510- <widget class="GtkHButtonBox" id="hbuttonbox1">
511- <property name="height_request">30</property>
512- <property name="visible">True</property>
513- <child>
514- <widget class="GtkButton" id="buttonOk">
515- <property name="label" translatable="yes">Ok</property>
516- <property name="visible">True</property>
517- <property name="can_focus">True</property>
518- <property name="can_default">True</property>
519- <property name="receives_default">False</property>
520- <property name="relief">half</property>
521- <property name="xalign">0.50999999046325684</property>
522- <signal name="clicked" handler="on_buttonOk_clicked"/>
523- </widget>
524- <packing>
525- <property name="expand">False</property>
526- <property name="fill">False</property>
527- <property name="position">0</property>
528- </packing>
529- </child>
530- </widget>
531- <packing>
532- <property name="expand">False</property>
533- <property name="fill">False</property>
534- <property name="position">2</property>
535- </packing>
536- </child>
537- </widget>
538- </child>
539- </widget>
540-</glade-interface>
541
542=== removed file 'md5sum-ico.png'
543Binary files md5sum-ico.png 2009-06-30 10:55:32 +0000 and md5sum-ico.png 1970-01-01 00:00:00 +0000 differ
544=== removed file 'nautilus-md5sum-notification'
545--- nautilus-md5sum-notification 2009-08-14 12:42:20 +0000
546+++ nautilus-md5sum-notification 1970-01-01 00:00:00 +0000
547@@ -1,7 +0,0 @@
548-Name: nautilus-md5sum-notification
549-Priority: High
550-Terminal: False
551-DontShowAfterReboot: True
552-DisplayIf: true
553-Description: Nautilus md5sum has been installed. A session restart is needed to make it work properly. Once the session is restarted, a new option will display in nautilus context menu. This option lets you to check md5 sums of image files with '.iso' extension.
554-Description-es: Nautilus md5sum ha sido instalado. Para poder utilizarlo es necesario reiniciar su sesión. Una vez que reinicie la sesión dispondrá de dicha utilidad en el menú contextual de un fichero de imagen de CD/DVD con extensión .iso.
555
556=== removed file 'nautilus-md5sum.py'
557--- nautilus-md5sum.py 2009-08-14 13:06:28 +0000
558+++ nautilus-md5sum.py 1970-01-01 00:00:00 +0000
559@@ -1,157 +0,0 @@
560-#!/usr/bin/env python
561-# -*- encoding: utf-8 -*-
562-#
563-# Copyright (c) 2009, Junta de Andalucía <packmaster@guadalinex.org>
564-#
565-# This package is free software; you can redistribute it and/or modify
566-# it under the terms of the GNU General Public License as published by
567-# the Free Software Foundation; either version 2 of the License, or
568-# (at your option) any later version.
569-#
570-# This package is distributed in the hope that it will be useful,
571-# but WITHOUT ANY WARRANTY; without even the implied warranty of
572-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
573-# GNU General Public License for more details.
574-#
575-# You should have received a copy of the GNU General Public License
576-# along with this package; if not, write to the Free Software
577-# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
578-#
579-# Authors : David Amian <david.amian@price-roch.es>
580-# Alvaro Pinel <alvaro.pinel@price-roch.es>
581-
582-import urllib
583-import nautilus
584-import gtk
585-import pygtk
586-# We use the 2.0 gtk version
587-pygtk.require('2.0')
588-import gtk.glade
589-import os
590-import time
591-import subprocess
592-import signal
593-import gettext
594-from threading import Thread
595-gtk.gdk.threads_init()
596-gettext.install("nautilus-md5sum")
597-
598-#Global
599-NAME_APP = "nautilus-md5sum"
600-FORMAT = ["application/x-cd-image"]
601-PATH = os.path.abspath(os.path.dirname(__file__))+"/"
602-PATH_ICON = "/usr/share/icons/"
603-
604-
605-
606-class MD5Dialog:
607-
608- def main(self):
609- thread = MiThread(self.lbMd5, self)
610- thread.start()
611- while thread.isAlive():
612- time.sleep(0.09)
613- self.pgbar.pulse()
614- while gtk.events_pending():
615- gtk.main_iteration()
616- self.pgbar.set_fraction(1.0)
617- self.button.set_label(_("Ok"))
618- self.pgbar.set_text(_("Checking completed"))
619- self.lbDef.set_text(_("MD5Sum of '")+self.file_cut+_("' is:"))
620- self.copy.show()
621-
622-
623-
624-
625- def __init__(self, fileiso):
626- self.fileiso = fileiso
627- self.list_f = self.fileiso.split('/')
628- self.file_cut = self.fileiso.split('/')[len(self.list_f)-1]
629- self.glade = gtk.glade.XML(PATH+"md5.glade")
630- self.glade.signal_autoconnect(self)
631- self.window = self.glade.get_widget("window1")
632- self.button = self.glade.get_widget("buttonOk")
633- self.lbDef = self.glade.get_widget("lbDef")
634- self.lbMd5 = self.glade.get_widget("lbMd5")
635- self.pgbar = self.glade.get_widget("pgbar")
636- self.copy = self.glade.get_widget("copy")
637- self.copy.set_label(_("Copy"))
638- self.lbDef.set_text(_("MD5Sum can take a long time"))
639- self.lbMd5.set_text(_("File: ")+self.file_cut)
640- self.lbMd5.set_selectable(True)
641- self.button.set_label(_("Cancel"))
642- self.button.grab_default()
643- self.button.grab_focus()
644- self.window.set_title(NAME_APP)
645- self.window.set_focus_child(self.glade.get_widget("buttonOk"))
646- self.window.set_icon_from_file(PATH_ICON+"md5sum-ico.png")
647- self.window.show_all()
648- self.copy.hide()
649- self.Res = subprocess.Popen(["md5sum", fileiso], stdout=subprocess.PIPE)
650-
651- def on_window1_delete_event(self, widget, event):
652- if self.Res.poll()==None:
653- os.kill(self.Res.pid, signal.SIGKILL)
654- time.sleep(0.1)
655- widget.destroy()
656-
657- def on_copy_clicked(self, widget):
658- clipboard = gtk.clipboard_get()
659- clipboard.set_text(self.lbMd5.get_text())
660- clipboard.store
661-
662- def on_buttonOk_clicked(self, widget):
663- if self.Res.poll()==None:
664- os.kill(self.Res.pid, signal.SIGKILL)
665- time.sleep(0.1)
666- self.window.destroy()
667-
668-class MiThread(Thread):
669- def __init__(self, label, md5):
670- self.lb = label
671- self.Res = md5.Res
672- Thread.__init__(self)
673-
674- def run(self):
675- res = self.Res.communicate()[0]
676- result = res.split('/')[0]
677- self.lb.set_text(str(result.rstrip()))
678-
679-
680-
681-class MD5Extension(nautilus.MenuProvider):
682- def __init__(self):
683- pass
684-
685- def get_file_items(self, window, files):
686- if len(files)!=1:
687- return
688- filename = files[0]
689-
690- if filename.get_mime_type() not in FORMAT:
691- return
692- items = []
693- #Called when the user selects a file in Nautilus.
694- item = nautilus.MenuItem("NautilusPython::md5sum_item",
695- _("Check MD5Sum"),
696- _("Check MD5Sum"))
697- item.set_property('icon', "md5sum-ico")
698- item.connect("activate", self.menu_activate_cb, files)
699- items.append(item)
700- return items
701-
702- def menu_activate_cb(self, menu, files):
703- #Called when the user selects the menu.
704- if len(files) != 1:
705- return
706- filename = files[0]
707- if filename.get_uri_scheme() != 'file':
708- return
709-
710- if filename.is_directory():
711- return
712-
713- fileiso = urllib.unquote(filename.get_uri()[7:])
714- md5d = MD5Dialog(fileiso)
715- md5d.main()
716-
717
718=== added file 'po/POTFILES.in'
719--- po/POTFILES.in 1970-01-01 00:00:00 +0000
720+++ po/POTFILES.in 2009-09-03 08:04:53 +0000
721@@ -0,0 +1,2 @@
722+./scripts/nautilus-md5sum.py
723+./data/md5.glade
724
725=== added directory 'scripts'
726=== added file 'scripts/nautilus-md5sum.py'
727--- scripts/nautilus-md5sum.py 1970-01-01 00:00:00 +0000
728+++ scripts/nautilus-md5sum.py 2009-08-28 13:01:43 +0000
729@@ -0,0 +1,157 @@
730+#!/usr/bin/env python
731+# -*- encoding: utf-8 -*-
732+#
733+# Copyright (c) 2009, Junta de Andalucía <packmaster@guadalinex.org>
734+#
735+# This package is free software; you can redistribute it and/or modify
736+# it under the terms of the GNU General Public License as published by
737+# the Free Software Foundation; either version 2 of the License, or
738+# (at your option) any later version.
739+#
740+# This package is distributed in the hope that it will be useful,
741+# but WITHOUT ANY WARRANTY; without even the implied warranty of
742+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
743+# GNU General Public License for more details.
744+#
745+# You should have received a copy of the GNU General Public License
746+# along with this package; if not, write to the Free Software
747+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
748+#
749+# Authors : David Amian <david.amian@price-roch.es>
750+# Alvaro Pinel <alvaro.pinel@price-roch.es>
751+
752+import urllib
753+import nautilus
754+import gtk
755+import pygtk
756+# We use the 2.0 gtk version
757+pygtk.require('2.0')
758+import gtk.glade
759+import os
760+import time
761+import subprocess
762+import signal
763+import gettext
764+from threading import Thread
765+gtk.gdk.threads_init()
766+gettext.install("nautilus-md5sum")
767+
768+#Global
769+NAME_APP = "nautilus-md5sum"
770+FORMAT = ["application/x-cd-image"]
771+PATH = "/usr/share/nautilus-md5sum/"
772+PATH_ICON = "/usr/share/icons/"
773+
774+
775+
776+class MD5Dialog:
777+
778+ def main(self):
779+ thread = MiThread(self.lbMd5, self)
780+ thread.start()
781+ while thread.isAlive():
782+ time.sleep(0.09)
783+ self.pgbar.pulse()
784+ while gtk.events_pending():
785+ gtk.main_iteration()
786+ self.pgbar.set_fraction(1.0)
787+ self.button.set_label(_("Ok"))
788+ self.pgbar.set_text(_("Checking completed"))
789+ self.lbDef.set_text(_("MD5Sum of '")+self.file_cut+_("' is:"))
790+ self.copy.show()
791+
792+
793+
794+
795+ def __init__(self, fileiso):
796+ self.fileiso = fileiso
797+ self.list_f = self.fileiso.split('/')
798+ self.file_cut = self.fileiso.split('/')[len(self.list_f)-1]
799+ self.glade = gtk.glade.XML(PATH+"md5.glade")
800+ self.glade.signal_autoconnect(self)
801+ self.window = self.glade.get_widget("window1")
802+ self.button = self.glade.get_widget("buttonOk")
803+ self.lbDef = self.glade.get_widget("lbDef")
804+ self.lbMd5 = self.glade.get_widget("lbMd5")
805+ self.pgbar = self.glade.get_widget("pgbar")
806+ self.copy = self.glade.get_widget("copy")
807+ self.copy.set_label(_("Copy"))
808+ self.lbDef.set_text(_("MD5Sum can take a long time"))
809+ self.lbMd5.set_text(_("File: ")+self.file_cut)
810+ self.lbMd5.set_selectable(True)
811+ self.button.set_label(_("Cancel"))
812+ self.button.grab_default()
813+ self.button.grab_focus()
814+ self.window.set_title(NAME_APP)
815+ self.window.set_focus_child(self.glade.get_widget("buttonOk"))
816+ self.window.set_icon_from_file(PATH_ICON+"md5sum-ico.png")
817+ self.window.show_all()
818+ self.copy.hide()
819+ self.Res = subprocess.Popen(["md5sum", fileiso], stdout=subprocess.PIPE)
820+
821+ def on_window1_delete_event(self, widget, event):
822+ if self.Res.poll()==None:
823+ os.kill(self.Res.pid, signal.SIGKILL)
824+ time.sleep(0.1)
825+ widget.destroy()
826+
827+ def on_copy_clicked(self, widget):
828+ clipboard = gtk.clipboard_get()
829+ clipboard.set_text(self.lbMd5.get_text())
830+ clipboard.store
831+
832+ def on_buttonOk_clicked(self, widget):
833+ if self.Res.poll()==None:
834+ os.kill(self.Res.pid, signal.SIGKILL)
835+ time.sleep(0.1)
836+ self.window.destroy()
837+
838+class MiThread(Thread):
839+ def __init__(self, label, md5):
840+ self.lb = label
841+ self.Res = md5.Res
842+ Thread.__init__(self)
843+
844+ def run(self):
845+ res = self.Res.communicate()[0]
846+ result = res.split('/')[0]
847+ self.lb.set_text(str(result.rstrip()))
848+
849+
850+
851+class MD5Extension(nautilus.MenuProvider):
852+ def __init__(self):
853+ pass
854+
855+ def get_file_items(self, window, files):
856+ if len(files)!=1:
857+ return
858+ filename = files[0]
859+
860+ if filename.get_mime_type() not in FORMAT:
861+ return
862+ items = []
863+ #Called when the user selects a file in Nautilus.
864+ item = nautilus.MenuItem("NautilusPython::md5sum_item",
865+ _("Check MD5Sum"),
866+ _("Check MD5Sum"))
867+ item.set_property('icon', "md5sum-ico")
868+ item.connect("activate", self.menu_activate_cb, files)
869+ items.append(item)
870+ return items
871+
872+ def menu_activate_cb(self, menu, files):
873+ #Called when the user selects the menu.
874+ if len(files) != 1:
875+ return
876+ filename = files[0]
877+ if filename.get_uri_scheme() != 'file':
878+ return
879+
880+ if filename.is_directory():
881+ return
882+
883+ fileiso = urllib.unquote(filename.get_uri()[7:])
884+ md5d = MD5Dialog(fileiso)
885+ md5d.main()
886+
887
888=== added file 'setup.cfg'
889--- setup.cfg 1970-01-01 00:00:00 +0000
890+++ setup.cfg 2009-08-28 11:20:12 +0000
891@@ -0,0 +1,6 @@
892+[build]
893+i18n = True
894+
895+[build_i18n]
896+domain = nautilus-md5sum
897+
898
899=== added file 'setup.py'
900--- setup.py 1970-01-01 00:00:00 +0000
901+++ setup.py 2009-09-03 08:04:53 +0000
902@@ -0,0 +1,17 @@
903+from distutils.core import setup
904+from DistUtilsExtra.command import *
905+
906+setup(name='nautilus-md5sum',
907+ version='0.3.3',
908+ author='David Amian',
909+ author_email='amialinux@gmail.com',
910+ data_files=[('lib/nautilus/extensions-2.0/python/', ['scripts/nautilus-md5sum.py']),
911+ ('share/nautilus-md5sum/',['data/nautilus-md5sum-notification', 'data/md5.glade']),
912+ ('share/icons/',['data/md5sum-ico.png'])],
913+ cmdclass = { "build" : build_extra.build_extra,
914+ "build_i18n" : build_i18n.build_i18n,
915+ "clean": clean_i18n.clean_i18n,
916+ }
917+ )
918+
919+

Subscribers

People subscribed via source and target branches

to all changes: