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
=== added directory 'data'
=== added file 'data/md5.glade'
--- data/md5.glade 1970-01-01 00:00:00 +0000
+++ data/md5.glade 2009-08-28 13:01:43 +0000
@@ -0,0 +1,165 @@
1<?xml version="1.0"?>
2<glade-interface>
3 <!-- interface-requires gtk+ 2.16 -->
4 <!-- interface-naming-policy toplevel-contextual -->
5 <widget class="GtkWindow" id="window1">
6 <property name="width_request">455</property>
7 <property name="height_request">145</property>
8 <property name="visible">True</property>
9 <property name="resizable">False</property>
10 <property name="window_position">center-always</property>
11 <property name="default_width">102</property>
12 <property name="default_height">221</property>
13 <property name="destroy_with_parent">True</property>
14 <child>
15 <widget class="GtkVBox" id="vbox1">
16 <property name="height_request">135</property>
17 <property name="visible">True</property>
18 <child>
19 <widget class="GtkVBox" id="vbox2">
20 <property name="height_request">78</property>
21 <property name="visible">True</property>
22 <child>
23 <widget class="GtkFixed" id="fixed1">
24 <property name="height_request">35</property>
25 <property name="visible">True</property>
26 <child>
27 <widget class="GtkLabel" id="lbDef">
28 <property name="width_request">450</property>
29 <property name="height_request">40</property>
30 <property name="visible">True</property>
31 <property name="extension_events">cursor</property>
32 <property name="justify">center</property>
33 <property name="wrap">True</property>
34 <property name="wrap_mode">char</property>
35 <property name="selectable">True</property>
36 </widget>
37 <packing>
38 <property name="x">2</property>
39 <property name="y">2</property>
40 </packing>
41 </child>
42 </widget>
43 <packing>
44 <property name="expand">False</property>
45 <property name="position">0</property>
46 </packing>
47 </child>
48 <child>
49 <widget class="GtkHBox" id="hbox1">
50 <property name="visible">True</property>
51 <child>
52 <widget class="GtkFixed" id="fixed2">
53 <property name="height_request">35</property>
54 <property name="visible">True</property>
55 <property name="extension_events">cursor</property>
56 <child>
57 <widget class="GtkLabel" id="lbMd5">
58 <property name="width_request">360</property>
59 <property name="height_request">30</property>
60 <property name="visible">True</property>
61 <property name="justify">center</property>
62 <property name="wrap">True</property>
63 <property name="wrap_mode">char</property>
64 <property name="selectable">True</property>
65 </widget>
66 <packing>
67 <property name="x">2</property>
68 <property name="y">2</property>
69 </packing>
70 </child>
71 </widget>
72 <packing>
73 <property name="expand">False</property>
74 <property name="position">0</property>
75 </packing>
76 </child>
77 <child>
78 <widget class="GtkFixed" id="fixed3">
79 <property name="height_request">30</property>
80 <property name="visible">True</property>
81 <child>
82 <widget class="GtkButton" id="copy">
83 <property name="width_request">64</property>
84 <property name="height_request">31</property>
85 <property name="visible">True</property>
86 <property name="can_focus">True</property>
87 <property name="receives_default">True</property>
88 <signal name="clicked" handler="on_copy_clicked"/>
89 </widget>
90 </child>
91 </widget>
92 <packing>
93 <property name="position">1</property>
94 </packing>
95 </child>
96 </widget>
97 <packing>
98 <property name="expand">False</property>
99 <property name="fill">False</property>
100 <property name="position">1</property>
101 </packing>
102 </child>
103 </widget>
104 <packing>
105 <property name="expand">False</property>
106 <property name="fill">False</property>
107 <property name="position">0</property>
108 </packing>
109 </child>
110 <child>
111 <widget class="GtkAlignment" id="alignment1">
112 <property name="height_request">35</property>
113 <property name="visible">True</property>
114 <property name="sensitive">False</property>
115 <property name="xscale">0.98000001907348633</property>
116 <property name="yscale">0</property>
117 <child>
118 <widget class="GtkProgressBar" id="pgbar">
119 <property name="visible">True</property>
120 <property name="sensitive">False</property>
121 <property name="activity_mode">True</property>
122 <property name="fraction">0.050000000000000003</property>
123 <property name="pulse_step">0.070000000000000007</property>
124 <property name="discrete_blocks">15</property>
125 </widget>
126 </child>
127 </widget>
128 <packing>
129 <property name="expand">False</property>
130 <property name="fill">False</property>
131 <property name="position">1</property>
132 </packing>
133 </child>
134 <child>
135 <widget class="GtkHButtonBox" id="hbuttonbox1">
136 <property name="height_request">30</property>
137 <property name="visible">True</property>
138 <child>
139 <widget class="GtkButton" id="buttonOk">
140 <property name="label" translatable="yes">Ok</property>
141 <property name="visible">True</property>
142 <property name="can_focus">True</property>
143 <property name="can_default">True</property>
144 <property name="receives_default">False</property>
145 <property name="relief">half</property>
146 <property name="xalign">0.50999999046325684</property>
147 <signal name="clicked" handler="on_buttonOk_clicked"/>
148 </widget>
149 <packing>
150 <property name="expand">False</property>
151 <property name="fill">False</property>
152 <property name="position">0</property>
153 </packing>
154 </child>
155 </widget>
156 <packing>
157 <property name="expand">False</property>
158 <property name="fill">False</property>
159 <property name="position">2</property>
160 </packing>
161 </child>
162 </widget>
163 </child>
164 </widget>
165</glade-interface>
0166
=== added file 'data/md5sum-ico.png'
1Binary files data/md5sum-ico.png 1970-01-01 00:00:00 +0000 and data/md5sum-ico.png 2009-08-28 13:01:43 +0000 differ167Binary 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
=== added file 'data/nautilus-md5sum-notification'
--- data/nautilus-md5sum-notification 1970-01-01 00:00:00 +0000
+++ data/nautilus-md5sum-notification 2009-08-28 13:01:43 +0000
@@ -0,0 +1,7 @@
1Name: nautilus-md5sum-notification
2Priority: High
3Terminal: False
4DontShowAfterReboot: True
5DisplayIf: true
6Description: 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.
7Description-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.
08
=== modified file 'debian/changelog'
--- debian/changelog 2009-08-17 18:20:18 +0000
+++ debian/changelog 2009-09-03 08:04:53 +0000
@@ -1,3 +1,25 @@
1nautilus-md5sum (0.3.3-0ubuntu1) karmic; urgency=low
2
3 * Added setup.py and setup.cfg file to install python package with distutils method
4 * Modified nautilus-md5sum.py to chage path of glade file
5 * Modified rules file to use python-distutils
6 * Changed prerem file permissions
7 * Added python-all-dev, cdbs, gettext, python-central, python-distutils-extra depends in control
8 * Added POTFILES.in and changed the package structure
9 * Changed version in setup.py
10 * Changed path scripts and data in setup.py
11 * Changed path of script and glade in POTFILES.in
12 * Deleted package label in setup.py, there aren't __init__.py file
13
14 -- David Amián Valle <amialinux@gmail.com> Thu, 03 Sep 2009 09:59:42 +0200
15
16nautilus-md5sum (0.3.2-0ubuntu2) karmic; urgency=low
17
18 * Removed python-dev and gettext packages as a depends
19 * Added debian/prerm file for removing the update-notifier stuff
20
21 -- Juanje Ojeda Croissier <jojeda@emergya.es> Wed, 19 Aug 2009 13:09:39 +0200
22
1nautilus-md5sum (0.3.2-0ubuntu1) karmic; urgency=low23nautilus-md5sum (0.3.2-0ubuntu1) karmic; urgency=low
224
3 * Added i18n to nautilus-md5sum-notification25 * Added i18n to nautilus-md5sum-notification
426
=== modified file 'debian/control'
--- debian/control 2009-08-13 12:30:57 +0000
+++ debian/control 2009-08-28 11:20:12 +0000
@@ -6,16 +6,17 @@
6Uploaders: David Amián <amialinux@gmail.com>,6Uploaders: David Amián <amialinux@gmail.com>,
7 Álvaro Pinel <alvaropinel@gmail.com>,7 Álvaro Pinel <alvaropinel@gmail.com>,
8 Juanje Ojeda Croissier <jojeda@emergya.es>8 Juanje Ojeda Croissier <jojeda@emergya.es>
9Build-Depends: debhelper (>= 7)9Build-Depends: debhelper (>= 7), cdbs (>=0.4.43), python-all-dev (>=2.3.5-11)
10Build-Depends-Indep: gettext10Build-Depends-Indep: python-central (>=0.5.6), gettext, python-distutils-extra
11Standards-Version: 3.8.211Standards-Version: 3.8.2
12Homepage: http://launchpad.net/nautilus-md5sum12Homepage: http://launchpad.net/nautilus-md5sum
13Vcs-Browser: http://codebrowse.launchpad.net/~guadalinex-members/nautilus-md5sum/trunk/changes13Vcs-Browser: http://codebrowse.launchpad.net/~guadalinex-members/nautilus-md5sum/trunk/changes
14Vcs-Bzr: http://bazaar.launchpad.net/~guadalinex-members/nautilus-md5sum/trunk14Vcs-Bzr: http://bazaar.launchpad.net/~guadalinex-members/nautilus-md5sum/trunk
15XS-Python-Version: current
1516
16Package: nautilus-md5sum17Package: nautilus-md5sum
17Architecture: all18Architecture: all
18Depends: ${misc:Depends}, python, python-nautilus, python-dev, nautilus, python-gtk2, python-glade2, gettext19Depends: ${misc:Depends}, python, python-nautilus, nautilus, python-gtk2, python-glade2
19Description: Nautilus' extension for checking MD5 sum20Description: Nautilus' extension for checking MD5 sum
20 Nautilus' extension for checking MD5 sum of iso files.21 Nautilus' extension for checking MD5 sum of iso files.
21 .22 .
2223
=== added file 'debian/prerm'
--- debian/prerm 1970-01-01 00:00:00 +0000
+++ debian/prerm 2009-08-28 11:20:12 +0000
@@ -0,0 +1,9 @@
1#!/bin/sh
2
3set -e
4
5if [ "$1" = "remove" ] || [ "$1" = "deconfigure" ] ; then
6 rm -f /var/lib/update-notifier/user.d/nautilus-md5sum-notification
7fi
8
9#DEBHELPER#
010
=== modified file 'debian/rules'
--- debian/rules 2009-08-14 12:33:09 +0000
+++ debian/rules 2009-08-28 11:20:12 +0000
@@ -1,106 +1,7 @@
1#!/usr/bin/make -f1#!/usr/bin/make -f
2# -*- makefile -*-2
3# Sample debian/rules that uses debhelper.3DEB_PYTHON_SYSTEM=pycentral
4# This file was originally written by Joey Hess and Craig Small.4
5# As a special exception, when this file is copied by dh-make into a5include /usr/share/cdbs/1/rules/debhelper.mk
6# dh-make output file, you may use that output file without restriction.6include /usr/share/cdbs/1/class/python-distutils.mk
7# This special exception was added by Craig Small in version 0.37 of dh-make.7
8
9# Uncomment this to turn on verbose mode.
10#export DH_VERBOSE=1
11
12
13PKGNAME=$(shell grep "^Package: " debian/control | head -1 | cut -f 2 -d\ )
14PKG=$(shell pwd)/debian/$(PKGNAME)
15LOCALEDIR=$(PKG)/usr/share/locale
16
17
18configure: configure-stamp
19configure-stamp:
20 dh_testdir
21 # Add here commands to configure the package.
22
23 touch configure-stamp
24
25
26build: build-stamp
27
28build-stamp: configure-stamp
29 dh_testdir
30
31 # Add here commands to compile the package.
32 #$(MAKE)
33 #docbook-to-man debian/nautilusmd5sum.sgml > nautilusmd5sum.1
34
35 touch $@
36
37clean:
38 dh_testdir
39 dh_testroot
40 rm -f build-stamp configure-stamp
41
42 # Add here commands to clean up after the build process.
43 #-$(MAKE) clean
44
45 dh_clean
46
47install: build
48 dh_testdir
49 dh_testroot
50 dh_prep
51 dh_installdirs
52 dh_install nautilus-md5sum.py /usr/lib/nautilus/extensions-2.0/python/
53 dh_install nautilus-md5sum-notification /usr/share/nautilus-md5sum/
54 dh_install md5sum-ico.png /usr/share/icons/
55 dh_install md5.glade /usr/lib/nautilus/extensions-2.0/python/
56 dh_icons
57 # Add here commands to install the package into debian/nautilusmd5sum.
58 #$(MAKE) DESTDIR=$(CURDIR)/debian/nautilusmd5sum install
59
60
61# Build architecture-independent files here.
62binary-indep: build install
63 mkdir -p $(LOCALEDIR)
64 cd po; \
65 find -type d -exec mkdir -p "$(LOCALEDIR)/{}" \; ; \
66 find -type f -name "*.po" -exec sh -c "N='{}'; \
67 N=\$${N#*.\/} ; \
68 L=\$${N%\.po} ; \
69 D=\"$(LOCALEDIR)/\$$L/LC_MESSAGES\" ; \
70 mkdir -p \$$D ; \
71 msgfmt -o \$${D}\/\$(PKGNAME).mo \$$N" \;
72 dh_testdir
73 dh_testroot
74 dh_installchangelogs
75 dh_installdocs
76 dh_installexamples
77# dh_install
78# dh_installmenu
79# dh_installdebconf
80# dh_installlogrotate
81# dh_installemacsen
82# dh_installpam
83# dh_installmime
84# dh_python
85# dh_installinit
86# dh_installcron
87# dh_installinfo
88 dh_installman
89 dh_link
90 dh_strip
91 dh_compress
92 dh_fixperms
93# dh_perl
94# dh_makeshlibs
95 dh_installdeb
96 dh_shlibdeps
97 dh_gencontrol
98 dh_md5sums
99 dh_builddeb
100
101
102# Build architecture-dependent files here.
103binary-arch: build install
104
105binary: binary-indep binary-arch
106.PHONY: build clean binary-indep binary-arch binary install configure
1078
=== removed file 'md5.glade'
--- md5.glade 2009-06-23 12:46:46 +0000
+++ md5.glade 1970-01-01 00:00:00 +0000
@@ -1,165 +0,0 @@
1<?xml version="1.0"?>
2<glade-interface>
3 <!-- interface-requires gtk+ 2.16 -->
4 <!-- interface-naming-policy toplevel-contextual -->
5 <widget class="GtkWindow" id="window1">
6 <property name="width_request">455</property>
7 <property name="height_request">145</property>
8 <property name="visible">True</property>
9 <property name="resizable">False</property>
10 <property name="window_position">center-always</property>
11 <property name="default_width">102</property>
12 <property name="default_height">221</property>
13 <property name="destroy_with_parent">True</property>
14 <child>
15 <widget class="GtkVBox" id="vbox1">
16 <property name="height_request">135</property>
17 <property name="visible">True</property>
18 <child>
19 <widget class="GtkVBox" id="vbox2">
20 <property name="height_request">78</property>
21 <property name="visible">True</property>
22 <child>
23 <widget class="GtkFixed" id="fixed1">
24 <property name="height_request">35</property>
25 <property name="visible">True</property>
26 <child>
27 <widget class="GtkLabel" id="lbDef">
28 <property name="width_request">450</property>
29 <property name="height_request">40</property>
30 <property name="visible">True</property>
31 <property name="extension_events">cursor</property>
32 <property name="justify">center</property>
33 <property name="wrap">True</property>
34 <property name="wrap_mode">char</property>
35 <property name="selectable">True</property>
36 </widget>
37 <packing>
38 <property name="x">2</property>
39 <property name="y">2</property>
40 </packing>
41 </child>
42 </widget>
43 <packing>
44 <property name="expand">False</property>
45 <property name="position">0</property>
46 </packing>
47 </child>
48 <child>
49 <widget class="GtkHBox" id="hbox1">
50 <property name="visible">True</property>
51 <child>
52 <widget class="GtkFixed" id="fixed2">
53 <property name="height_request">35</property>
54 <property name="visible">True</property>
55 <property name="extension_events">cursor</property>
56 <child>
57 <widget class="GtkLabel" id="lbMd5">
58 <property name="width_request">360</property>
59 <property name="height_request">30</property>
60 <property name="visible">True</property>
61 <property name="justify">center</property>
62 <property name="wrap">True</property>
63 <property name="wrap_mode">char</property>
64 <property name="selectable">True</property>
65 </widget>
66 <packing>
67 <property name="x">2</property>
68 <property name="y">2</property>
69 </packing>
70 </child>
71 </widget>
72 <packing>
73 <property name="expand">False</property>
74 <property name="position">0</property>
75 </packing>
76 </child>
77 <child>
78 <widget class="GtkFixed" id="fixed3">
79 <property name="height_request">30</property>
80 <property name="visible">True</property>
81 <child>
82 <widget class="GtkButton" id="copy">
83 <property name="width_request">64</property>
84 <property name="height_request">31</property>
85 <property name="visible">True</property>
86 <property name="can_focus">True</property>
87 <property name="receives_default">True</property>
88 <signal name="clicked" handler="on_copy_clicked"/>
89 </widget>
90 </child>
91 </widget>
92 <packing>
93 <property name="position">1</property>
94 </packing>
95 </child>
96 </widget>
97 <packing>
98 <property name="expand">False</property>
99 <property name="fill">False</property>
100 <property name="position">1</property>
101 </packing>
102 </child>
103 </widget>
104 <packing>
105 <property name="expand">False</property>
106 <property name="fill">False</property>
107 <property name="position">0</property>
108 </packing>
109 </child>
110 <child>
111 <widget class="GtkAlignment" id="alignment1">
112 <property name="height_request">35</property>
113 <property name="visible">True</property>
114 <property name="sensitive">False</property>
115 <property name="xscale">0.98000001907348633</property>
116 <property name="yscale">0</property>
117 <child>
118 <widget class="GtkProgressBar" id="pgbar">
119 <property name="visible">True</property>
120 <property name="sensitive">False</property>
121 <property name="activity_mode">True</property>
122 <property name="fraction">0.050000000000000003</property>
123 <property name="pulse_step">0.070000000000000007</property>
124 <property name="discrete_blocks">15</property>
125 </widget>
126 </child>
127 </widget>
128 <packing>
129 <property name="expand">False</property>
130 <property name="fill">False</property>
131 <property name="position">1</property>
132 </packing>
133 </child>
134 <child>
135 <widget class="GtkHButtonBox" id="hbuttonbox1">
136 <property name="height_request">30</property>
137 <property name="visible">True</property>
138 <child>
139 <widget class="GtkButton" id="buttonOk">
140 <property name="label" translatable="yes">Ok</property>
141 <property name="visible">True</property>
142 <property name="can_focus">True</property>
143 <property name="can_default">True</property>
144 <property name="receives_default">False</property>
145 <property name="relief">half</property>
146 <property name="xalign">0.50999999046325684</property>
147 <signal name="clicked" handler="on_buttonOk_clicked"/>
148 </widget>
149 <packing>
150 <property name="expand">False</property>
151 <property name="fill">False</property>
152 <property name="position">0</property>
153 </packing>
154 </child>
155 </widget>
156 <packing>
157 <property name="expand">False</property>
158 <property name="fill">False</property>
159 <property name="position">2</property>
160 </packing>
161 </child>
162 </widget>
163 </child>
164 </widget>
165</glade-interface>
1660
=== removed file 'md5sum-ico.png'
167Binary files md5sum-ico.png 2009-06-30 10:55:32 +0000 and md5sum-ico.png 1970-01-01 00:00:00 +0000 differ1Binary files md5sum-ico.png 2009-06-30 10:55:32 +0000 and md5sum-ico.png 1970-01-01 00:00:00 +0000 differ
=== removed file 'nautilus-md5sum-notification'
--- nautilus-md5sum-notification 2009-08-14 12:42:20 +0000
+++ nautilus-md5sum-notification 1970-01-01 00:00:00 +0000
@@ -1,7 +0,0 @@
1Name: nautilus-md5sum-notification
2Priority: High
3Terminal: False
4DontShowAfterReboot: True
5DisplayIf: true
6Description: 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.
7Description-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.
80
=== removed file 'nautilus-md5sum.py'
--- nautilus-md5sum.py 2009-08-14 13:06:28 +0000
+++ nautilus-md5sum.py 1970-01-01 00:00:00 +0000
@@ -1,157 +0,0 @@
1#!/usr/bin/env python
2# -*- encoding: utf-8 -*-
3#
4# Copyright (c) 2009, Junta de Andalucía <packmaster@guadalinex.org>
5#
6# This package is free software; you can redistribute it and/or modify
7# it under the terms of the GNU General Public License as published by
8# the Free Software Foundation; either version 2 of the License, or
9# (at your option) any later version.
10#
11# This package is distributed in the hope that it will be useful,
12# but WITHOUT ANY WARRANTY; without even the implied warranty of
13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14# GNU General Public License for more details.
15#
16# You should have received a copy of the GNU General Public License
17# along with this package; if not, write to the Free Software
18# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19#
20# Authors : David Amian <david.amian@price-roch.es>
21# Alvaro Pinel <alvaro.pinel@price-roch.es>
22
23import urllib
24import nautilus
25import gtk
26import pygtk
27# We use the 2.0 gtk version
28pygtk.require('2.0')
29import gtk.glade
30import os
31import time
32import subprocess
33import signal
34import gettext
35from threading import Thread
36gtk.gdk.threads_init()
37gettext.install("nautilus-md5sum")
38
39#Global
40NAME_APP = "nautilus-md5sum"
41FORMAT = ["application/x-cd-image"]
42PATH = os.path.abspath(os.path.dirname(__file__))+"/"
43PATH_ICON = "/usr/share/icons/"
44
45
46
47class MD5Dialog:
48
49 def main(self):
50 thread = MiThread(self.lbMd5, self)
51 thread.start()
52 while thread.isAlive():
53 time.sleep(0.09)
54 self.pgbar.pulse()
55 while gtk.events_pending():
56 gtk.main_iteration()
57 self.pgbar.set_fraction(1.0)
58 self.button.set_label(_("Ok"))
59 self.pgbar.set_text(_("Checking completed"))
60 self.lbDef.set_text(_("MD5Sum of '")+self.file_cut+_("' is:"))
61 self.copy.show()
62
63
64
65
66 def __init__(self, fileiso):
67 self.fileiso = fileiso
68 self.list_f = self.fileiso.split('/')
69 self.file_cut = self.fileiso.split('/')[len(self.list_f)-1]
70 self.glade = gtk.glade.XML(PATH+"md5.glade")
71 self.glade.signal_autoconnect(self)
72 self.window = self.glade.get_widget("window1")
73 self.button = self.glade.get_widget("buttonOk")
74 self.lbDef = self.glade.get_widget("lbDef")
75 self.lbMd5 = self.glade.get_widget("lbMd5")
76 self.pgbar = self.glade.get_widget("pgbar")
77 self.copy = self.glade.get_widget("copy")
78 self.copy.set_label(_("Copy"))
79 self.lbDef.set_text(_("MD5Sum can take a long time"))
80 self.lbMd5.set_text(_("File: ")+self.file_cut)
81 self.lbMd5.set_selectable(True)
82 self.button.set_label(_("Cancel"))
83 self.button.grab_default()
84 self.button.grab_focus()
85 self.window.set_title(NAME_APP)
86 self.window.set_focus_child(self.glade.get_widget("buttonOk"))
87 self.window.set_icon_from_file(PATH_ICON+"md5sum-ico.png")
88 self.window.show_all()
89 self.copy.hide()
90 self.Res = subprocess.Popen(["md5sum", fileiso], stdout=subprocess.PIPE)
91
92 def on_window1_delete_event(self, widget, event):
93 if self.Res.poll()==None:
94 os.kill(self.Res.pid, signal.SIGKILL)
95 time.sleep(0.1)
96 widget.destroy()
97
98 def on_copy_clicked(self, widget):
99 clipboard = gtk.clipboard_get()
100 clipboard.set_text(self.lbMd5.get_text())
101 clipboard.store
102
103 def on_buttonOk_clicked(self, widget):
104 if self.Res.poll()==None:
105 os.kill(self.Res.pid, signal.SIGKILL)
106 time.sleep(0.1)
107 self.window.destroy()
108
109class MiThread(Thread):
110 def __init__(self, label, md5):
111 self.lb = label
112 self.Res = md5.Res
113 Thread.__init__(self)
114
115 def run(self):
116 res = self.Res.communicate()[0]
117 result = res.split('/')[0]
118 self.lb.set_text(str(result.rstrip()))
119
120
121
122class MD5Extension(nautilus.MenuProvider):
123 def __init__(self):
124 pass
125
126 def get_file_items(self, window, files):
127 if len(files)!=1:
128 return
129 filename = files[0]
130
131 if filename.get_mime_type() not in FORMAT:
132 return
133 items = []
134 #Called when the user selects a file in Nautilus.
135 item = nautilus.MenuItem("NautilusPython::md5sum_item",
136 _("Check MD5Sum"),
137 _("Check MD5Sum"))
138 item.set_property('icon', "md5sum-ico")
139 item.connect("activate", self.menu_activate_cb, files)
140 items.append(item)
141 return items
142
143 def menu_activate_cb(self, menu, files):
144 #Called when the user selects the menu.
145 if len(files) != 1:
146 return
147 filename = files[0]
148 if filename.get_uri_scheme() != 'file':
149 return
150
151 if filename.is_directory():
152 return
153
154 fileiso = urllib.unquote(filename.get_uri()[7:])
155 md5d = MD5Dialog(fileiso)
156 md5d.main()
157
1580
=== added file 'po/POTFILES.in'
--- po/POTFILES.in 1970-01-01 00:00:00 +0000
+++ po/POTFILES.in 2009-09-03 08:04:53 +0000
@@ -0,0 +1,2 @@
1./scripts/nautilus-md5sum.py
2./data/md5.glade
03
=== added directory 'scripts'
=== added file 'scripts/nautilus-md5sum.py'
--- scripts/nautilus-md5sum.py 1970-01-01 00:00:00 +0000
+++ scripts/nautilus-md5sum.py 2009-08-28 13:01:43 +0000
@@ -0,0 +1,157 @@
1#!/usr/bin/env python
2# -*- encoding: utf-8 -*-
3#
4# Copyright (c) 2009, Junta de Andalucía <packmaster@guadalinex.org>
5#
6# This package is free software; you can redistribute it and/or modify
7# it under the terms of the GNU General Public License as published by
8# the Free Software Foundation; either version 2 of the License, or
9# (at your option) any later version.
10#
11# This package is distributed in the hope that it will be useful,
12# but WITHOUT ANY WARRANTY; without even the implied warranty of
13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14# GNU General Public License for more details.
15#
16# You should have received a copy of the GNU General Public License
17# along with this package; if not, write to the Free Software
18# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19#
20# Authors : David Amian <david.amian@price-roch.es>
21# Alvaro Pinel <alvaro.pinel@price-roch.es>
22
23import urllib
24import nautilus
25import gtk
26import pygtk
27# We use the 2.0 gtk version
28pygtk.require('2.0')
29import gtk.glade
30import os
31import time
32import subprocess
33import signal
34import gettext
35from threading import Thread
36gtk.gdk.threads_init()
37gettext.install("nautilus-md5sum")
38
39#Global
40NAME_APP = "nautilus-md5sum"
41FORMAT = ["application/x-cd-image"]
42PATH = "/usr/share/nautilus-md5sum/"
43PATH_ICON = "/usr/share/icons/"
44
45
46
47class MD5Dialog:
48
49 def main(self):
50 thread = MiThread(self.lbMd5, self)
51 thread.start()
52 while thread.isAlive():
53 time.sleep(0.09)
54 self.pgbar.pulse()
55 while gtk.events_pending():
56 gtk.main_iteration()
57 self.pgbar.set_fraction(1.0)
58 self.button.set_label(_("Ok"))
59 self.pgbar.set_text(_("Checking completed"))
60 self.lbDef.set_text(_("MD5Sum of '")+self.file_cut+_("' is:"))
61 self.copy.show()
62
63
64
65
66 def __init__(self, fileiso):
67 self.fileiso = fileiso
68 self.list_f = self.fileiso.split('/')
69 self.file_cut = self.fileiso.split('/')[len(self.list_f)-1]
70 self.glade = gtk.glade.XML(PATH+"md5.glade")
71 self.glade.signal_autoconnect(self)
72 self.window = self.glade.get_widget("window1")
73 self.button = self.glade.get_widget("buttonOk")
74 self.lbDef = self.glade.get_widget("lbDef")
75 self.lbMd5 = self.glade.get_widget("lbMd5")
76 self.pgbar = self.glade.get_widget("pgbar")
77 self.copy = self.glade.get_widget("copy")
78 self.copy.set_label(_("Copy"))
79 self.lbDef.set_text(_("MD5Sum can take a long time"))
80 self.lbMd5.set_text(_("File: ")+self.file_cut)
81 self.lbMd5.set_selectable(True)
82 self.button.set_label(_("Cancel"))
83 self.button.grab_default()
84 self.button.grab_focus()
85 self.window.set_title(NAME_APP)
86 self.window.set_focus_child(self.glade.get_widget("buttonOk"))
87 self.window.set_icon_from_file(PATH_ICON+"md5sum-ico.png")
88 self.window.show_all()
89 self.copy.hide()
90 self.Res = subprocess.Popen(["md5sum", fileiso], stdout=subprocess.PIPE)
91
92 def on_window1_delete_event(self, widget, event):
93 if self.Res.poll()==None:
94 os.kill(self.Res.pid, signal.SIGKILL)
95 time.sleep(0.1)
96 widget.destroy()
97
98 def on_copy_clicked(self, widget):
99 clipboard = gtk.clipboard_get()
100 clipboard.set_text(self.lbMd5.get_text())
101 clipboard.store
102
103 def on_buttonOk_clicked(self, widget):
104 if self.Res.poll()==None:
105 os.kill(self.Res.pid, signal.SIGKILL)
106 time.sleep(0.1)
107 self.window.destroy()
108
109class MiThread(Thread):
110 def __init__(self, label, md5):
111 self.lb = label
112 self.Res = md5.Res
113 Thread.__init__(self)
114
115 def run(self):
116 res = self.Res.communicate()[0]
117 result = res.split('/')[0]
118 self.lb.set_text(str(result.rstrip()))
119
120
121
122class MD5Extension(nautilus.MenuProvider):
123 def __init__(self):
124 pass
125
126 def get_file_items(self, window, files):
127 if len(files)!=1:
128 return
129 filename = files[0]
130
131 if filename.get_mime_type() not in FORMAT:
132 return
133 items = []
134 #Called when the user selects a file in Nautilus.
135 item = nautilus.MenuItem("NautilusPython::md5sum_item",
136 _("Check MD5Sum"),
137 _("Check MD5Sum"))
138 item.set_property('icon', "md5sum-ico")
139 item.connect("activate", self.menu_activate_cb, files)
140 items.append(item)
141 return items
142
143 def menu_activate_cb(self, menu, files):
144 #Called when the user selects the menu.
145 if len(files) != 1:
146 return
147 filename = files[0]
148 if filename.get_uri_scheme() != 'file':
149 return
150
151 if filename.is_directory():
152 return
153
154 fileiso = urllib.unquote(filename.get_uri()[7:])
155 md5d = MD5Dialog(fileiso)
156 md5d.main()
157
0158
=== added file 'setup.cfg'
--- setup.cfg 1970-01-01 00:00:00 +0000
+++ setup.cfg 2009-08-28 11:20:12 +0000
@@ -0,0 +1,6 @@
1[build]
2i18n = True
3
4[build_i18n]
5domain = nautilus-md5sum
6
07
=== added file 'setup.py'
--- setup.py 1970-01-01 00:00:00 +0000
+++ setup.py 2009-09-03 08:04:53 +0000
@@ -0,0 +1,17 @@
1from distutils.core import setup
2from DistUtilsExtra.command import *
3
4setup(name='nautilus-md5sum',
5 version='0.3.3',
6 author='David Amian',
7 author_email='amialinux@gmail.com',
8 data_files=[('lib/nautilus/extensions-2.0/python/', ['scripts/nautilus-md5sum.py']),
9 ('share/nautilus-md5sum/',['data/nautilus-md5sum-notification', 'data/md5.glade']),
10 ('share/icons/',['data/md5sum-ico.png'])],
11 cmdclass = { "build" : build_extra.build_extra,
12 "build_i18n" : build_i18n.build_i18n,
13 "clean": clean_i18n.clean_i18n,
14 }
15 )
16
17

Subscribers

People subscribed via source and target branches

to all changes: