diff -Nru nautilus-pastebin-0.4.1/ChangeLog nautilus-pastebin-0.5.0/ChangeLog
--- nautilus-pastebin-0.4.1/ChangeLog 2010-01-25 17:56:14.000000000 +0100
+++ nautilus-pastebin-0.5.0/ChangeLog 2010-06-18 15:30:53.000000000 +0200
@@ -1,5 +1,170 @@
Changes:
+revno: 58
+ Update translations.
+
+revno: 57
+ Remove tests dir, update translations template.
+
+revno: 56
+ Update NEWS file
+
+revno: 55
+ Update NEWS file, fix stikked.com preset
+
+revno: 54
+ Fix paste() prototypes
+
+revno: 53
+ PRESET_PATH must be set
+
+revno: 52
+ Fix small mistakes, improve right-click menu.
+
+revno: 51
+ Notify users when the selected pastebin is not available. Show preset's name from the right-click menu (LP: #helper = gtk.Button().
+
+revno: 50
+ Improve error message on MIME detection, fixes LP: #577569
+
+revno: 49
+ Pastebin.com wrapper now uses official API.
+
+revno: 48
+ Update translations template.
+
+revno: 47
+ Update POTFILES.in
+
+revno: 46
+ Update NEWS file
+
+revno: 45
+ Update pastebin.com.conf preset.
+
+revno: 44
+ Log post contents, preset paths must be fixed
+
+revno: 43
+ Drop maintainer mode check
+
+revno: 42
+ Chmod +x on nautilus-pastebin-configurator.py
+
+revno: 41
+ Launchpad automatic translations update.
+
+revno: 40
+ Launchpad automatic translations update.
+
+revno: 39
+ Delete empty scripts dir
+
+revno: 38
+ Remove old scripts dir
+
+revno: 37
+ Move scripts into the sources root
+
+revno: 36
+ Launchpad automatic translations update.
+
+revno: 35
+ Launchpad automatic translations update.
+
+revno: 34
+ Launchpad automatic translations update.
+
+revno: 33
+ Launchpad automatic translations update.
+
+revno: 32
+ Launchpad automatic translations update.
+
+revno: 31
+ Update NEWS file
+
+revno: 30
+ Update setup.py
+
+revno: 29
+ Launchpad automatic translations update.
+
+revno: 28
+ Launchpad automatic translations update.
+
+revno: 27
+ Launchpad automatic translations update.
+
+revno: 26
+ Launchpad automatic translations update.
+
+revno: 25
+ Launchpad automatic translations update.
+
+revno: 24
+ Launchpad automatic translations update.
+
+revno: 23
+ Launchpad automatic translations update.
+
+revno: 22
+ Launchpad automatic translations update.
+
+revno: 21
+ Launchpad automatic translations update.
+
+revno: 20
+ Launchpad automatic translations update.
+
+revno: 19
+ Launchpad automatic translations update.
+
+revno: 18
+ Launchpad automatic translations update.
+
+revno: 17
+ Update TODOlist
+
+revno: 16
+ Launchpad automatic translations update.
+
+revno: 15
+ Launchpad automatic translations update.
+
+revno: 14
+ Prepare to release 0.4.2
+
+revno: 13 [merge]
+ Merge
+
+revno: 12
+ Patch pastebin.com.conf to make it working with the new pastebin release.
+
+revno: 11
+ Update translations template.
+
+revno: 10
+ Update TODO file
+
+revno: 9
+ Update NEWS
+
+revno: 8
+ Supports codepad.org.
+
+revno: 7
+ Update TODO file
+
+revno: 6
+ Settings.__load_settings no longer needs any parameter.
+
+revno: 5
+ Retrieve preset search path from GConf; nautilus-pastebin-configurator needs to be updated.
+
+revno: 4
+ Update TODO
+
revno: 3
Releasing 0.4.1
diff -Nru nautilus-pastebin-0.4.1/data/nautilus-pastebin.schemas nautilus-pastebin-0.5.0/data/nautilus-pastebin.schemas
--- nautilus-pastebin-0.4.1/data/nautilus-pastebin.schemas 2010-01-25 17:33:49.000000000 +0100
+++ nautilus-pastebin-0.5.0/data/nautilus-pastebin.schemas 2010-06-17 15:35:17.000000000 +0200
@@ -53,6 +53,6 @@
The pastebin to which the file will be sent.
-
+
diff -Nru nautilus-pastebin-0.4.1/data/presets/codepad.org.conf nautilus-pastebin-0.5.0/data/presets/codepad.org.conf
--- nautilus-pastebin-0.4.1/data/presets/codepad.org.conf 1970-01-01 01:00:00.000000000 +0100
+++ nautilus-pastebin-0.5.0/data/presets/codepad.org.conf 2010-06-17 15:35:17.000000000 +0200
@@ -0,0 +1,29 @@
+[codepad.org]
+website: http://codepad.org
+wrapper: GenericPastebin
+default_mime: Plain Text
+aliases:
+ map['user'] = ['poster']
+ map['content'] = ['code']
+ map['parentid'] = ['parent_pid']
+ map['format'] = ['lang']
+extras:
+ map['private'] = 'False'
+ map['run'] = 'False'
+mimetypes:
+ map['application/x-ruby'] = 'Ruby'
+ map['application/x-httpd-eruby'] = 'Ruby'
+ map['application/x-httpd-php'] = 'PHP'
+ map['application/x-httpd-php-source'] = 'PHP'
+ map['application/x-httpd-php3'] = 'PHP'
+ map['application/x-httpd-php3-preprocessed'] = 'PHP'
+ map['application/x-httpd-php4'] = 'PHP'
+ map['text/x-csrc'] = 'C'
+ map['text/x-c++src'] = 'C++'
+ map['text/x-haskell'] = 'Haskell'
+ map['text/x-literate-haskell'] = 'Haskell'
+ map['text/x-python'] = 'Python'
+ map['text/x-perl'] = 'Perl'
+ map['text/x-dsrc'] = 'D'
+ map['application/x-shellscript'] = 'Plain Text'
+ map['application/x-desktop'] = 'Plain Text'
diff -Nru nautilus-pastebin-0.4.1/data/presets/pastebin.com.conf nautilus-pastebin-0.5.0/data/presets/pastebin.com.conf
--- nautilus-pastebin-0.4.1/data/presets/pastebin.com.conf 2010-01-25 17:33:49.000000000 +0100
+++ nautilus-pastebin-0.5.0/data/presets/pastebin.com.conf 2010-06-17 15:54:55.000000000 +0200
@@ -3,14 +3,17 @@
wrapper: GenericPastebin
default_mime: text
aliases:
- map['user'] = ['poster']
- map['content'] = ['code2']
- map['parentid'] = ['parent_pid']
- map['format'] = ['format']
+ map['user'] = ['paste_name']
+ map['content'] = ['paste_code']
+ map['parentid'] = ['paste_parent_key']
+ map['format'] = ['paste_format']
extras:
- map['paste'] = 'Send'
- map['remember'] = '0'
- map['expiry'] = '0'
+ map['paste_remember'] = '0'
+ map['paste_expire_date'] = 'N'
+ map['submit'] = 'submit'
+ map['paste_private'] = '0'
+ map['page'] = "/api_public.php"
+ map['regexp'] = 'http://pastebin.com/(.*)'
mimetypes:
map['application/xml'] = 'xml'
map['application/javascript'] = 'js'
diff -Nru nautilus-pastebin-0.4.1/data/presets/stikked.com.conf nautilus-pastebin-0.5.0/data/presets/stikked.com.conf
--- nautilus-pastebin-0.4.1/data/presets/stikked.com.conf 2010-01-25 17:33:49.000000000 +0100
+++ nautilus-pastebin-0.5.0/data/presets/stikked.com.conf 2010-06-17 22:10:45.000000000 +0200
@@ -13,4 +13,4 @@
map['email'] = ''
mimetypes:
map['text/x-python'] = 'python'
- map['application/x-desktop'] = 'text
+ map['application/x-desktop'] = 'text'
diff -Nru nautilus-pastebin-0.4.1/debian/changelog nautilus-pastebin-0.5.0/debian/changelog
--- nautilus-pastebin-0.4.1/debian/changelog 2010-06-21 17:44:50.000000000 +0200
+++ nautilus-pastebin-0.5.0/debian/changelog 2010-06-21 17:42:08.000000000 +0200
@@ -1,3 +1,24 @@
+nautilus-pastebin (0.5.0-1ubuntu1) maverick; urgency=low
+
+ * Merge from debian unstable (LP: #596929). Remaining changes:
+ - Set paste.ubuntu.com as default pastebin.
+
+ -- Angel Abad Sat, 19 Jun 2010 03:26:56 +0100
+
+nautilus-pastebin (0.5.0-1) unstable; urgency=low
+
+ * New upstream release:
+ - New supported pastebins:
+ + http://codepad.org
+ - Fix pastebin.com preset.
+ * Switch to 3.0 (quilt) format.
+ * Change maintainer's mail address.
+ * Update debian/copyright.
+ * Add Python to Build-Depends field, it's needed by the clean target.
+ * Bump nautilus-pastebin's dependency on python-pastebin >=${source:Version}
+
+ -- Alessio Treglia Fri, 18 Jun 2010 17:24:56 +0200
+
nautilus-pastebin (0.4.1-2ubuntu1) lucid; urgency=low
* Merge from debian, Ubuntu-specific changes:
@@ -75,3 +96,4 @@
post-installation details.
-- Alessio Treglia Fri, 02 Oct 2009 14:46:39 +0200
+
diff -Nru nautilus-pastebin-0.4.1/debian/control nautilus-pastebin-0.5.0/debian/control
--- nautilus-pastebin-0.4.1/debian/control 2010-06-21 17:44:50.000000000 +0200
+++ nautilus-pastebin-0.5.0/debian/control 2010-06-21 17:36:21.000000000 +0200
@@ -1,11 +1,13 @@
Source: nautilus-pastebin
Section: gnome
Priority: optional
-Maintainer: Alessio Treglia
-DM-Upload-Allowed: yes
+Maintainer: Ubuntu Developers
+XSBC-Original-Maintainer: Alessio Treglia
Uploaders: Debian Python Modules Team
-Build-Depends: debhelper (>= 7.0.50~), quilt (>= 0.46-7~)
-Build-Depends-Indep: python-support (>= 0.5.3), python-distutils-extra
+Build-Depends: debhelper (>= 7.0.50~),
+ python (>= 2.5)
+Build-Depends-Indep: python-support (>= 0.5.3),
+ python-distutils-extra
Standards-Version: 3.8.4
Homepage: https://launchpad.net/nautilus-pastebin
Vcs-Svn: svn://svn.debian.org/python-modules/packages/nautilus-pastebin/trunk
@@ -20,7 +22,7 @@
python-gtk2,
python-gconf,
python-notify,
- python-pastebin
+ python-pastebin (>= ${source:Version})
Description: Nautilus extension to send files to a pastebin
nautilus-pastebin is a Nautilus extension written in Python, which
allows users to upload text-only files to a pastebin service just
@@ -35,7 +37,8 @@
Package: python-pastebin
Section: python
Architecture: all
-Depends: ${misc:Depends}, ${python:Depends}
+Depends: ${misc:Depends},
+ ${python:Depends}
Description: Python module to send text files to pastebin web applications
A pastebin is a web application which allows users to upload text files for
public viewing. This module provides a quick and easy way to submit textual
diff -Nru nautilus-pastebin-0.4.1/debian/copyright nautilus-pastebin-0.5.0/debian/copyright
--- nautilus-pastebin-0.4.1/debian/copyright 2010-06-21 17:44:50.000000000 +0200
+++ nautilus-pastebin-0.5.0/debian/copyright 2010-06-18 15:46:04.000000000 +0200
@@ -3,7 +3,10 @@
Maintainer: Alessio Treglia
Source: https://launchpad.net/nautilus-pastebin/+download
-Files: pastebin/core.py:
+Copyright: 2009-2010, Alessio Treglia
+License: GPL-2+
+
+Files: ./pastebin/core.py:
Copyright:
2009-2010, Alessio Treglia
2006-2009, Stéphane Graber
@@ -11,11 +14,7 @@
2006-2009, David Paleino
License: GPL-2+
-Files: *
-Copyright: 2009-2010, Alessio Treglia
-License: GPL-2+
-
-Files: debian/*
+Files: ./debian/*
Copyright: 2009-2010, Alessio Treglia
License: GPL-2+
diff -Nru nautilus-pastebin-0.4.1/debian/patches/01-default_pastebin.diff nautilus-pastebin-0.5.0/debian/patches/01-default_pastebin.diff
--- nautilus-pastebin-0.4.1/debian/patches/01-default_pastebin.diff 2010-06-21 17:44:50.000000000 +0200
+++ nautilus-pastebin-0.5.0/debian/patches/01-default_pastebin.diff 2010-06-21 17:33:44.000000000 +0200
@@ -4,8 +4,8 @@
data/nautilus-pastebin.schemas | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
---- nautilus-pastebin-0.3.0.orig/data/nautilus-pastebin.schemas
-+++ nautilus-pastebin-0.3.0/data/nautilus-pastebin.schemas
+--- a/data/nautilus-pastebin.schemas
++++ b/data/nautilus-pastebin.schemas
@@ -46,7 +46,7 @@
/apps/nautilus-pastebin/preset
nautilus-pastebin
diff -Nru nautilus-pastebin-0.4.1/debian/README.source nautilus-pastebin-0.5.0/debian/README.source
--- nautilus-pastebin-0.4.1/debian/README.source 2010-06-21 17:44:50.000000000 +0200
+++ nautilus-pastebin-0.5.0/debian/README.source 1970-01-01 01:00:00.000000000 +0100
@@ -1,57 +0,0 @@
-This package uses quilt to manage all modifications to the upstream
-source. Changes are stored in the source package as diffs in
-debian/patches and applied during the build.
-
-To configure quilt to use debian/patches instead of patches, you want
-either to export QUILT_PATCHES=debian/patches in your environment
-or use this snippet in your ~/.quiltrc:
-
- for where in ./ ../ ../../ ../../../ ../../../../ ../../../../../; do
- if [ -e ${where}debian/rules -a -d ${where}debian/patches ]; then
- export QUILT_PATCHES=debian/patches
- fi
- done
-
-To get the fully patched source after unpacking the source package, cd to
-the root level of the source package and run:
-
- quilt push -a
-
-The last patch listed in debian/patches/series will become the current
-patch.
-
-To add a new set of changes, first run quilt push -a, and then run:
-
- quilt new
-
-where is a descriptive name for the patch, used as the filename in
-debian/patches. Then, for every file that will be modified by this patch,
-run:
-
- quilt add
-
-before editing those files. You must tell quilt with quilt add what files
-will be part of the patch before making changes or quilt will not work
-properly. After editing the files, run:
-
- quilt refresh
-
-to save the results as a patch.
-
-Alternately, if you already have an external patch and you just want to
-add it to the build system, run quilt push -a and then:
-
- quilt import -P /path/to/patch
- quilt push -a
-
-(add -p 0 to quilt import if needed). as above is the filename to
-use in debian/patches. The last quilt push -a will apply the patch to
-make sure it works properly.
-
-To remove an existing patch from the list of patches that will be applied,
-run:
-
- quilt delete
-
-You may need to run quilt pop -a to unapply patches first before running
-this command.
diff -Nru nautilus-pastebin-0.4.1/debian/rules nautilus-pastebin-0.5.0/debian/rules
--- nautilus-pastebin-0.4.1/debian/rules 2010-06-21 17:44:50.000000000 +0200
+++ nautilus-pastebin-0.5.0/debian/rules 2010-06-18 15:52:33.000000000 +0200
@@ -1,7 +1,7 @@
#!/usr/bin/make -f
%:
- dh --with quilt $@
+ dh $@
override_dh_auto_install:
dh_auto_install -- --install-scripts=/usr/share/nautilus-pastebin/
diff -Nru nautilus-pastebin-0.4.1/debian/source/format nautilus-pastebin-0.5.0/debian/source/format
--- nautilus-pastebin-0.4.1/debian/source/format 1970-01-01 01:00:00.000000000 +0100
+++ nautilus-pastebin-0.5.0/debian/source/format 2010-06-18 15:47:40.000000000 +0200
@@ -0,0 +1 @@
+3.0 (quilt)
diff -Nru nautilus-pastebin-0.4.1/nautilus-pastebin-configurator.py nautilus-pastebin-0.5.0/nautilus-pastebin-configurator.py
--- nautilus-pastebin-0.4.1/nautilus-pastebin-configurator.py 1970-01-01 01:00:00.000000000 +0100
+++ nautilus-pastebin-0.5.0/nautilus-pastebin-configurator.py 2010-06-17 22:02:27.000000000 +0200
@@ -0,0 +1,180 @@
+#!/usr/bin/python
+# -*- coding: utf-8 -*-
+# nautilus-pastebin - Nautilus extension to paste a file to a pastebin service
+# Written by:
+# Alessio Treglia
+# Copyright (C) 2009-2010, Alessio Treglia
+#
+# This package is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This package is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this package; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+#
+
+import os
+import sys
+import gettext
+import gtk
+import gconf
+from ConfigParser import ConfigParser
+
+# Globals
+APP_NAME = "nautilus-pastebin"
+MAINTAINER_MODE = False
+APP_PATH = os.path.join(sys.prefix, "share", APP_NAME)
+
+# By default, the program looks for presets in the following paths:
+# /etc/nautilus-pastebin/presets/
+# ~/.config/nautilus-pastebin/presets
+PRESET_PATHS = [
+ os.path.join(sys.prefix, 'share', 'nautilus-pastebin', 'presets'),
+ os.path.expanduser(os.path.join('~','.config','nautilus-pastebin', 'presets')),
+]
+
+gettext.install(APP_NAME)
+
+def get_presets():
+ presets = []
+
+ for path in PRESET_PATHS:
+ if os.path.exists(path):
+ append_these = filter(
+ lambda x: x.endswith('.conf'), os.listdir(path)
+ )
+ presets.extend(
+ map(
+ lambda x: os.path.join(path,x),
+ append_these
+ )
+ )
+ return presets
+
+def getSearchResPaths():
+ return [
+ os.path.join(sys.prefix, "share", "nautilus-pastebin"),
+ os.path.join(sys.prefix, "share", "pixmaps"),
+ os.path.join(sys.prefix, "local", "share", "nautilus-pastebin"),
+ os.path.expanduser(os.path.join("~", ".nautilus-pastebin", "data")),
+ os.getcwd()
+ ]
+
+def getPath(path):
+ search_paths = getSearchResPaths()
+ for search in search_paths:
+ fullpath = os.path.join(search, path)
+ if os.path.exists(fullpath):
+ return fullpath
+ else:
+ raise IOError(_("Can't find %s in any known prefix!") % kwargs[component])
+
+GLADE_FILE = getPath('nautilus-pastebin-configurator.glade')
+ICON_FILE = getPath('nautilus-pastebin.png')
+USERCONFIG_DIR = os.path.expanduser(os.path.join('~', '.config', 'nautilus-pastebin'))
+
+class Settings(object):
+ GCONF_PATH = "/apps/nautilus-pastebin/"
+ KEYMAP = {
+ 'preset' : 'string',
+ 'ask_confirmation' : 'bool',
+ 'show_notification' : 'bool',
+ 'open_browser' : 'bool'
+ }
+
+ def update_configuration(self):
+ for kname, ktype in self.KEYMAP.items():
+ kvalue = getattr(self, kname)
+ getattr(self.__gconf_client, 'set_%s' % ktype)(self.GCONF_PATH + kname, kvalue)
+
+ def __retrieve_settings(self):
+ for kname, ktype in self.KEYMAP.items():
+ setattr(self, kname, getattr(self.__gconf_client, 'get_%s' % ktype)(self.GCONF_PATH + kname))
+
+ def __load_presets(self):
+ cp = ConfigParser()
+ cp.read(get_presets())
+ self.presets = cp.sections()
+
+ def __init__(self):
+ self.__gconf_client = gconf.client_get_default()
+ self.__retrieve_settings()
+ self.__load_presets()
+
+class Controller(object):
+
+ def showErrorMessage(self, message):
+ md = gtk.MessageDialog(parent=self.dialogMain,
+ message_format=message,
+ buttons=gtk.BUTTONS_CLOSE,
+ type = gtk.MESSAGE_ERROR,
+ flags = gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT)
+ md.run()
+ md.destroy()
+
+ def quit(self, *args):
+ gtk.main_quit()
+
+ def on_button_close_clicked(self, widget, data=None):
+ self.dialogMain.destroy()
+ self._retrieve_config_from_ui()
+ self.settings.update_configuration()
+ self.quit()
+
+ def _retrieve_config_from_ui(self):
+ params = self.settings.KEYMAP.keys()
+ for i in params:
+ if i == 'preset':
+ setattr(self.settings, i, self.builder.get_object("combobox_pastebin").get_active_text())
+ else:
+ setattr(self.settings, i, self.builder.get_object(i).get_active())
+
+ def _setup_widgets(self):
+ builder = self.builder
+ presets = self.settings.presets
+ # Set the icon
+ self.dialogMain.set_icon_from_file(ICON_FILE)
+ # Populate the combobox widget
+ comboboxPastebin = builder.get_object("combobox_pastebin")
+ comboboxPastebin.set_model(gtk.ListStore(str))
+ cell = gtk.CellRendererText()
+ comboboxPastebin.pack_start(cell, True)
+ comboboxPastebin.add_attribute(cell, 'text', 0)
+
+ [comboboxPastebin.append_text(k) for k in presets]
+ comboboxPastebin.set_active(presets.index(self.settings.preset))
+
+ # Set the boolean flags
+ for k in [option for option in self.settings.KEYMAP.keys() if option is not 'preset']:
+ builder.get_object(k).set_active(
+ getattr(self.settings, k)
+ )
+
+ def __init__(self):
+ builder = gtk.Builder()
+ builder.add_from_file(GLADE_FILE)
+ self.settings = Settings()
+ self.dialogMain = builder.get_object('dialog_main')
+ self.tableOptions = builder.get_object('table_options')
+ builder.connect_signals(self)
+ self.dialogMain.connect('delete_event', self.quit)
+
+ self.builder = builder
+
+ self._setup_widgets()
+ self.dialogMain.show_all()
+
+def main():
+ c = Controller()
+ gtk.main()
+
+if __name__ == "__main__":
+ main()
+
diff -Nru nautilus-pastebin-0.4.1/nautilus-pastebin.py nautilus-pastebin-0.5.0/nautilus-pastebin.py
--- nautilus-pastebin-0.4.1/nautilus-pastebin.py 1970-01-01 01:00:00.000000000 +0100
+++ nautilus-pastebin-0.5.0/nautilus-pastebin.py 2010-06-17 16:23:11.000000000 +0200
@@ -0,0 +1,250 @@
+#!/usr/bin/python
+# -*- coding: utf-8 -*-
+# nautilus-pastebin - Nautilus extension to paste a file to a pastebin service
+# Written by:
+# Alessio Treglia
+# Copyright (C) 2009-2010, Alessio Treglia
+#
+# This package is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This package is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this package; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+#
+
+import os
+import sys
+import time
+import gettext
+import urllib
+import webbrowser
+from threading import Thread
+from ConfigParser import ConfigParser
+import gtk
+import gconf
+import nautilus
+import pynotify
+
+# Globals
+APP_NAME = "nautilus-pastebin"
+LOGGING = 1
+MAINTAINER_MODE = False
+APP_PATH = os.path.join(sys.prefix, "share", APP_NAME)
+
+# Check whether running in maintainer mode
+if os.path.expanduser('~') in os.path.realpath(__file__):
+ sys.path.append(os.path.expanduser(os.path.join('~', '.nautilus-pastebin')))
+ APP_PATH = os.path.expanduser(os.path.join('~', '.nautilus-pastebin'))
+ MAINTAINER_MODE = True
+from pastebin.core import *
+
+gettext.install(APP_NAME)
+
+class log:
+ def log(self, message):
+ if self.logger:
+ self.logger.debug(message)
+ def __init__(self):
+ logger = None
+ if LOGGING:
+ import logging
+ logger = logging.getLogger(APP_NAME)
+ logger.setLevel(logging.DEBUG)
+ ch = logging.StreamHandler()
+ ch.setLevel(logging.DEBUG)
+ logger.addHandler(ch)
+ self.logger = logger
+
+log = log().log
+
+# By default, the program looks for presets in the following paths:
+# /etc/nautilus-pastebin/presets/
+# ~/.config/nautilus-pastebin/presets
+PRESET_PATHS = [
+ os.path.join(sys.prefix, 'share', 'nautilus-pastebin', 'presets'),
+ os.path.expanduser(os.path.join('~','.config','nautilus-pastebin', 'presets'))
+]
+
+class ConfigFileException(Exception):
+ pass
+
+def get_presets(preset_paths):
+ presets = []
+
+ for path in preset_paths:
+ if os.path.exists(path):
+ append_these = filter(
+ lambda x: x.endswith('.conf'), os.listdir(path)
+ )
+ presets.extend(
+ map(
+ lambda x: os.path.join(path,x),
+ append_these
+ )
+ )
+ return presets
+
+pynotify.init("Nautilus pastebin extension")
+
+class Settings(object):
+ """Configuration wrapper"""
+ GCONF_PATH = "/apps/%s/" % APP_NAME
+ KEYMAP = {
+ 'preset' : 'string',
+ 'ask_confirmation' : 'bool',
+ 'show_notification' : 'bool',
+ 'open_browser' : 'bool'
+ }
+
+ def validate(self):
+ return self.__preset_is_available(getattr(self, 'preset'))
+
+ def get_pastebin_configuration(self):
+ """Retrieve and returns the configuration related to the pastebin service."""
+ return PastebinConfiguration(dict(self.__presets.items(self.preset)))
+
+ def get_available_pastebins(self):
+ """Returns a list of available presets."""
+ return self.__presets.sections()
+
+ def get_settings(self):
+ """Returns application's global settings."""
+ return dict([(k, getattr(self, k)) for k in self.KEYMAP])
+
+ def __preset_is_available(self, preset):
+ return self.__presets.has_section(preset)
+
+ def __init__(self):
+ log ("Create Settings object...")
+ self.__gconf_client = gconf.client_get_default()
+ self.__presets = ConfigParser()
+ log ("Reading configuration from GConf...")
+ for kname, ktype in self.KEYMAP.items():
+ setattr(self, kname, getattr(self.__gconf_client, 'get_%s' % ktype)(self.GCONF_PATH + kname))
+ log ("Loaded configuration: ")
+ for i in self.get_settings():
+ log ("%s = %s" % (i, getattr(self, i)))
+ self.__presets.read(get_presets(PRESET_PATHS))
+
+class PastebinThread(Thread):
+ def __init__(self, settings, pasteconf):
+ self.settings = settings
+ self.pasteconf = pasteconf
+ self.wrapper = PastebinWrapperFactory().get_wrapper(pasteconf)
+ Thread.__init__(self)
+
+ def run(self):
+ log ("PastebinThread started!")
+
+ # Ask user to confirm the action
+ if self.settings['ask_confirmation']:
+ md = gtk.MessageDialog(None,
+ message_format=_("The file will be sent to the selected pastebin: \
+are you sure to continue?"),
+ flags=gtk.DIALOG_MODAL,
+ buttons=gtk.BUTTONS_YES_NO,
+ type=gtk.MESSAGE_QUESTION
+ )
+ response = md.run()
+ md.destroy()
+ if response == gtk.RESPONSE_NO:
+ return
+ pasteurl = self.wrapper.paste(log)
+
+ summary = ''
+ message = ''
+ icon = None
+ helper = gtk.Button()
+
+ if not pasteurl:
+ summary = _("Unable to read or parse the result page.")
+ message = _("It could be a server timeout or a change server side. Try later.")
+ icon = helper.render_icon(gtk.STOCK_DIALOG_ERROR, gtk.ICON_SIZE_DIALOG)
+ else:
+ summary = 'File pasted to: '
+ URLmarkup = '%(pasteurl)s'
+ message = URLmarkup % {'pasteurl':pasteurl}
+ icon = helper.render_icon(gtk.STOCK_PASTE, gtk.ICON_SIZE_DIALOG)
+
+ cb = gtk.clipboard_get('CLIPBOARD')
+ cb.clear()
+ cb.set_text(pasteurl)
+
+ # Open a browser window
+ if self.settings['open_browser']:
+ webbrowser.open(pasteurl)
+
+ # Show a bubble
+ if self.settings['show_notification']:
+ n = pynotify.Notification(summary, message)
+ n.set_icon_from_pixbuf(icon)
+ n.show()
+
+class PastebinitExtension(nautilus.MenuProvider):
+ def __init__(self):
+ log ("Intializing nautilus-pastebin extension...")
+
+ def get_file_items(self, window, files):
+ if len(files)!=1:
+ return
+ filename = files[0]
+
+ if filename.get_uri_scheme() != 'file' or filename.is_directory():
+ return
+
+ items = []
+ settings = Settings()
+ if not settings.validate():
+ return
+ preset = settings.preset
+ #Called when the user selects a file in Nautilus.
+ item = nautilus.MenuItem("NautilusPython::pastebin_item",
+ _("Pastebin to %s" % preset),
+ _("Send this file to %s" % preset))
+ item.set_property('icon', "nautilus-pastebin")
+ item.connect("activate", self.menu_activate_cb, files)
+ items.append(item)
+ return items
+
+ def menu_activate_cb(self, menu, files):
+ if len(files) != 1:
+ return
+ filename = files[0]
+
+ settings = Settings()
+ if not settings.validate():
+ n = pynotify.Notification(_("Wrong configuration"), _("The selected pastebin is not available, please check your configuration."))
+ helper = gtk.Button()
+ icon = helper.render_icon(gtk.STOCK_DIALOG_ERROR, gtk.ICON_SIZE_DIALOG)
+ n.set_icon_from_pixbuf(icon)
+ n.show()
+ return
+ pasteconf = settings.get_pastebin_configuration()
+
+ if not pasteconf.set_format_by_mimetype(filename.get_mime_type()):
+ n = pynotify.Notification(_("Unsupported MIME type"), _("The selected file cannot be pasted."))
+ helper = gtk.Button()
+ icon = helper.render_icon(gtk.STOCK_DIALOG_ERROR, gtk.ICON_SIZE_DIALOG)
+ n.set_icon_from_pixbuf(icon)
+ n.show()
+ return
+
+ pastefile = urllib.unquote(filename.get_uri()[7:])
+ if not pasteconf.set_content(pastefile):
+ return
+
+ thread = PastebinThread(settings.get_settings(), pasteconf)
+ thread.start()
+ while (thread.isAlive()):
+ time.sleep(0.09)
+ while gtk.events_pending():
+ gtk.main_iteration()
+
diff -Nru nautilus-pastebin-0.4.1/NEWS nautilus-pastebin-0.5.0/NEWS
--- nautilus-pastebin-0.4.1/NEWS 2010-01-25 17:43:08.000000000 +0100
+++ nautilus-pastebin-0.5.0/NEWS 2010-06-17 22:15:33.000000000 +0200
@@ -1,3 +1,14 @@
+0.5.0:
+
+ * New supported pastebins:
+ - http://codepad.org
+ * Fix pastebin.com.conf preset.
+ * The following pastebins seem no longer to work and they will be dropped
+ in the next release:
+ - paste.lisp.org
+ - pastebot.ltsp.org
+ - pastebin.ws
+
0.4.1:
* Re-add translations.
diff -Nru nautilus-pastebin-0.4.1/pastebin/core.py nautilus-pastebin-0.5.0/pastebin/core.py
--- nautilus-pastebin-0.4.1/pastebin/core.py 2010-01-25 17:33:49.000000000 +0100
+++ nautilus-pastebin-0.5.0/pastebin/core.py 2010-06-17 22:06:34.000000000 +0200
@@ -144,7 +144,7 @@
# Execute after-setup hook
self.hook_after_setup_parameters()
- def paste(self):
+ def paste(self, logger=None):
if not self.validate():
return None
@@ -168,6 +168,8 @@
params.__delitem__("regexp")
# Convert to a format usable with the HTML POST
params = urllib.urlencode(params)
+ if logger is not None:
+ logger("POST contents: %s" % str(params))
try:
url_opener = PasteURLOpener()
@@ -239,7 +241,7 @@
# return params
class PasteDebianNetXMLRPCWrapper(GenericPastebinWrapper):
- def paste(self):
+ def paste(self, logger=None):
if not self.validate():
return None
server = xmlrpclib.Server(self.conf.website)
@@ -256,7 +258,7 @@
return None
class PasteLispOrgXMLRPCWrapper(GenericPastebinWrapper):
- def paste(self):
+ def paste(self, logger=None):
if not self.validate():
return None
server = xmlrpclib.Server(self.conf.website)
diff -Nru nautilus-pastebin-0.4.1/PKG-INFO nautilus-pastebin-0.5.0/PKG-INFO
--- nautilus-pastebin-0.4.1/PKG-INFO 2010-01-25 17:56:14.000000000 +0100
+++ nautilus-pastebin-0.5.0/PKG-INFO 2010-06-18 15:30:53.000000000 +0200
@@ -1,6 +1,6 @@
Metadata-Version: 1.0
Name: nautilus-pastebin
-Version: 0.4.1
+Version: 0.5.0
Summary: Nautilus extension to send files to a pastebin
Home-page: https://launchpad.net/nautilus-pastebin
Author: Alessio Treglia
diff -Nru nautilus-pastebin-0.4.1/po/cs.po nautilus-pastebin-0.5.0/po/cs.po
--- nautilus-pastebin-0.4.1/po/cs.po 1970-01-01 01:00:00.000000000 +0100
+++ nautilus-pastebin-0.5.0/po/cs.po 2010-06-18 15:28:56.000000000 +0200
@@ -0,0 +1,88 @@
+# Czech translation for nautilus-pastebin
+# Copyright (c) 2010 Rosetta Contributors and Canonical Ltd 2010
+# This file is distributed under the same license as the nautilus-pastebin package.
+# FIRST AUTHOR , 2010.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: nautilus-pastebin\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2010-06-18 15:15+0200\n"
+"PO-Revision-Date: 2010-02-26 22:40+0000\n"
+"Last-Translator: Roman Horník \n"
+"Language-Team: Czech \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Launchpad-Export-Date: 2010-02-27 04:56+0000\n"
+"X-Generator: Launchpad (build Unknown)\n"
+
+#: ../nautilus-pastebin.py:150
+msgid ""
+"The file will be sent to the selected pastebin: are you sure to continue?"
+msgstr "Soubor bude odeslán do zvoleného pastebinu: přejete si pokračovat?"
+
+#: ../nautilus-pastebin.py:168
+msgid "Unable to read or parse the result page."
+msgstr "Nemohu načíst či rozlousknout výslednou stránku."
+
+#: ../nautilus-pastebin.py:169
+msgid "It could be a server timeout or a change server side. Try later."
+msgstr ""
+"Může to být způsobeno buď překročením časového limitu serveru, nebo jakousi "
+"změnou na straně serveru. Zkuste to za chvíli."
+
+#: ../nautilus-pastebin.py:210
+#, fuzzy, python-format
+msgid "Pastebin to %s"
+msgstr "Pastebin"
+
+#: ../nautilus-pastebin.py:211
+#, fuzzy, python-format
+msgid "Send this file to %s"
+msgstr "Odeslat tento soubor do pastebinu"
+
+#: ../nautilus-pastebin.py:224
+msgid "Wrong configuration"
+msgstr ""
+
+#: ../nautilus-pastebin.py:224
+msgid ""
+"The selected pastebin is not available, please check your configuration."
+msgstr ""
+
+#: ../nautilus-pastebin.py:233
+msgid "Unsupported MIME type"
+msgstr ""
+
+#: ../nautilus-pastebin.py:233
+msgid "The selected file cannot be pasted."
+msgstr "Vybraný soubor nemůže být vložen."
+
+#: ../nautilus-pastebin-configurator.py:77
+#, python-format
+msgid "Can't find %s in any known prefix!"
+msgstr "Nemohu nelézt %s v žádném známém prefixu!"
+
+#: ../data/nautilus-pastebin-configurator.glade.h:1
+msgid "Ask to confirm:"
+msgstr "Zeptat se na potvrzení:"
+
+#: ../data/nautilus-pastebin-configurator.glade.h:2
+msgid "Open browser:"
+msgstr "Otevřít prohlížeč"
+
+#: ../data/nautilus-pastebin-configurator.glade.h:3
+msgid "Pastebin:"
+msgstr "Pastebin:"
+
+#: ../data/nautilus-pastebin-configurator.glade.h:4
+msgid "Show a notification:"
+msgstr "Zobrazit upozornění:"
+
+#: ../data/nautilus-pastebin-configurator.glade.h:5
+msgid "Nautilus Pastebin configuration panel"
+msgstr "Konfigurační panel programu Nautilus Pastebin"
+
+#~ msgid "Unable to send the file"
+#~ msgstr "Nelze tento soubor odeslat"
diff -Nru nautilus-pastebin-0.4.1/po/de.po nautilus-pastebin-0.5.0/po/de.po
--- nautilus-pastebin-0.4.1/po/de.po 2010-01-25 17:33:49.000000000 +0100
+++ nautilus-pastebin-0.5.0/po/de.po 2010-06-18 15:28:56.000000000 +0200
@@ -6,50 +6,62 @@
msgid ""
msgstr ""
"Project-Id-Version: nautilus-pastebin\n"
-"Report-Msgid-Bugs-To: FULL NAME \n"
-"POT-Creation-Date: 2009-12-01 22:02+0100\n"
-"PO-Revision-Date: 2010-01-23 16:55+0000\n"
-"Last-Translator: Alessio Treglia \n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2010-06-18 15:15+0200\n"
+"PO-Revision-Date: 2010-04-17 05:28+0000\n"
+"Last-Translator: Jan-Christoph Borchardt \n"
"Language-Team: German \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-01-24 04:54+0000\n"
+"X-Launchpad-Export-Date: 2010-04-18 03:56+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
-#: ../scripts/nautilus-pastebin.py:156
+#: ../nautilus-pastebin.py:150
msgid ""
"The file will be sent to the selected pastebin: are you sure to continue?"
msgstr ""
+"Diese Datei wird zum ausgewählen Pastebin gesendet. Wirklich fortfahren?"
-#: ../scripts/nautilus-pastebin.py:174
+#: ../nautilus-pastebin.py:168
msgid "Unable to read or parse the result page."
-msgstr ""
+msgstr "Konnte die Ergebnisseite nicht lesen."
-#: ../scripts/nautilus-pastebin.py:175
+#: ../nautilus-pastebin.py:169
msgid "It could be a server timeout or a change server side. Try later."
-msgstr ""
+msgstr "Es könnte ein Serverfehler sein. Versuchen Sie es später noch einmal."
-#: ../scripts/nautilus-pastebin.py:212
-msgid "Pastebin"
+#: ../nautilus-pastebin.py:210
+#, fuzzy, python-format
+msgid "Pastebin to %s"
msgstr "Pastebin"
-#: ../scripts/nautilus-pastebin.py:213
-msgid "Send this file to a pastebin"
+#: ../nautilus-pastebin.py:211
+#, fuzzy, python-format
+msgid "Send this file to %s"
msgstr "Sende diese Datei zu einem Pastebin"
-#: ../scripts/nautilus-pastebin.py:229
-msgid "Unable to send the file"
-msgstr "Die Datei konnte nicht übertragen werden"
+#: ../nautilus-pastebin.py:224
+msgid "Wrong configuration"
+msgstr ""
-#: ../scripts/nautilus-pastebin.py:229
-msgid "The selected file cannot be pasted."
+#: ../nautilus-pastebin.py:224
+msgid ""
+"The selected pastebin is not available, please check your configuration."
msgstr ""
-#: ../scripts/nautilus-pastebin-configurator.py:86
+#: ../nautilus-pastebin.py:233
+msgid "Unsupported MIME type"
+msgstr ""
+
+#: ../nautilus-pastebin.py:233
+msgid "The selected file cannot be pasted."
+msgstr "Die gewählte Datei kann nicht eingefügt werden."
+
+#: ../nautilus-pastebin-configurator.py:77
#, python-format
msgid "Can't find %s in any known prefix!"
-msgstr ""
+msgstr "Konnte %s in keinem bekannten Präfix finden!"
#: ../data/nautilus-pastebin-configurator.glade.h:1
msgid "Ask to confirm:"
@@ -69,4 +81,7 @@
#: ../data/nautilus-pastebin-configurator.glade.h:5
msgid "Nautilus Pastebin configuration panel"
-msgstr "Nautilus Pastebin Konfigurationsfeld"
+msgstr "Nautilus-Konfigurationsleiste für Pastebin-Dienste"
+
+#~ msgid "Unable to send the file"
+#~ msgstr "Die Datei konnte nicht übertragen werden"
diff -Nru nautilus-pastebin-0.4.1/po/es.po nautilus-pastebin-0.5.0/po/es.po
--- nautilus-pastebin-0.4.1/po/es.po 2010-01-25 17:33:49.000000000 +0100
+++ nautilus-pastebin-0.5.0/po/es.po 2010-06-18 15:28:56.000000000 +0200
@@ -6,51 +6,62 @@
msgid ""
msgstr ""
"Project-Id-Version: nautilus-pastebin\n"
-"Report-Msgid-Bugs-To: FULL NAME \n"
-"POT-Creation-Date: 2009-12-01 22:02+0100\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2010-06-18 15:15+0200\n"
"PO-Revision-Date: 2010-01-23 16:00+0000\n"
"Last-Translator: DiegoJ \n"
"Language-Team: Spanish \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-01-24 04:54+0000\n"
+"X-Launchpad-Export-Date: 2010-02-26 04:57+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
-#: ../scripts/nautilus-pastebin.py:156
+#: ../nautilus-pastebin.py:150
msgid ""
"The file will be sent to the selected pastebin: are you sure to continue?"
msgstr ""
"El archivo se enviará al pastebin seleccionado: ¿está seguro de que quiere "
"continuar?"
-#: ../scripts/nautilus-pastebin.py:174
+#: ../nautilus-pastebin.py:168
msgid "Unable to read or parse the result page."
msgstr "No se pudo leer o analizar la página de resultados."
-#: ../scripts/nautilus-pastebin.py:175
+#: ../nautilus-pastebin.py:169
msgid "It could be a server timeout or a change server side. Try later."
msgstr ""
"Ha podido vencer el tiempo de conexión o ha podido ocurrir un cambio en el "
"lado del servidor. Inténtelo de nuevo."
-#: ../scripts/nautilus-pastebin.py:212
-msgid "Pastebin"
+#: ../nautilus-pastebin.py:210
+#, fuzzy, python-format
+msgid "Pastebin to %s"
msgstr "Pastebin"
-#: ../scripts/nautilus-pastebin.py:213
-msgid "Send this file to a pastebin"
+#: ../nautilus-pastebin.py:211
+#, fuzzy, python-format
+msgid "Send this file to %s"
msgstr "Enviar este archivo a un \"pastebin\""
-#: ../scripts/nautilus-pastebin.py:229
-msgid "Unable to send the file"
-msgstr "No es posible enviar el fichero"
+#: ../nautilus-pastebin.py:224
+msgid "Wrong configuration"
+msgstr ""
+
+#: ../nautilus-pastebin.py:224
+msgid ""
+"The selected pastebin is not available, please check your configuration."
+msgstr ""
-#: ../scripts/nautilus-pastebin.py:229
+#: ../nautilus-pastebin.py:233
+msgid "Unsupported MIME type"
+msgstr ""
+
+#: ../nautilus-pastebin.py:233
msgid "The selected file cannot be pasted."
msgstr "No se puede pegar el siguiente archivo."
-#: ../scripts/nautilus-pastebin-configurator.py:86
+#: ../nautilus-pastebin-configurator.py:77
#, python-format
msgid "Can't find %s in any known prefix!"
msgstr "%s no es ningún prefijo conocido."
@@ -74,3 +85,6 @@
#: ../data/nautilus-pastebin-configurator.glade.h:5
msgid "Nautilus Pastebin configuration panel"
msgstr "Panel de configuración de Nautilus \"Pastebin\""
+
+#~ msgid "Unable to send the file"
+#~ msgstr "No es posible enviar el fichero"
diff -Nru nautilus-pastebin-0.4.1/po/fr.po nautilus-pastebin-0.5.0/po/fr.po
--- nautilus-pastebin-0.4.1/po/fr.po 2010-01-25 17:33:49.000000000 +0100
+++ nautilus-pastebin-0.5.0/po/fr.po 2010-06-18 15:28:56.000000000 +0200
@@ -6,51 +6,62 @@
msgid ""
msgstr ""
"Project-Id-Version: nautilus-pastebin\n"
-"Report-Msgid-Bugs-To: FULL NAME \n"
-"POT-Creation-Date: 2009-12-01 22:02+0100\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2010-06-18 15:15+0200\n"
"PO-Revision-Date: 2010-01-23 16:00+0000\n"
"Last-Translator: FULL NAME \n"
"Language-Team: French \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-01-24 04:54+0000\n"
+"X-Launchpad-Export-Date: 2010-02-26 04:57+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
-#: ../scripts/nautilus-pastebin.py:156
+#: ../nautilus-pastebin.py:150
msgid ""
"The file will be sent to the selected pastebin: are you sure to continue?"
msgstr ""
"Le fichier va être envoyé dans le pastebin sélectionné : êtes vous sûr de "
"vouloir continuer ?"
-#: ../scripts/nautilus-pastebin.py:174
+#: ../nautilus-pastebin.py:168
msgid "Unable to read or parse the result page."
msgstr "Impossible de lire ou d'analyser la page de résultat."
-#: ../scripts/nautilus-pastebin.py:175
+#: ../nautilus-pastebin.py:169
msgid "It could be a server timeout or a change server side. Try later."
msgstr ""
"C'est peut-être du à un temps de latence du serveur ou un à une modification "
"côté serveur. Essayez plus tard."
-#: ../scripts/nautilus-pastebin.py:212
-msgid "Pastebin"
+#: ../nautilus-pastebin.py:210
+#, fuzzy, python-format
+msgid "Pastebin to %s"
msgstr "Pastebin"
-#: ../scripts/nautilus-pastebin.py:213
-msgid "Send this file to a pastebin"
+#: ../nautilus-pastebin.py:211
+#, fuzzy, python-format
+msgid "Send this file to %s"
msgstr "Envoyer ce fichier sur un pastebin"
-#: ../scripts/nautilus-pastebin.py:229
-msgid "Unable to send the file"
-msgstr "Impossible d'envoyer le fichier"
+#: ../nautilus-pastebin.py:224
+msgid "Wrong configuration"
+msgstr ""
+
+#: ../nautilus-pastebin.py:224
+msgid ""
+"The selected pastebin is not available, please check your configuration."
+msgstr ""
-#: ../scripts/nautilus-pastebin.py:229
+#: ../nautilus-pastebin.py:233
+msgid "Unsupported MIME type"
+msgstr ""
+
+#: ../nautilus-pastebin.py:233
msgid "The selected file cannot be pasted."
msgstr "Le fichier selectionné ne peut pas être collé."
-#: ../scripts/nautilus-pastebin-configurator.py:86
+#: ../nautilus-pastebin-configurator.py:77
#, python-format
msgid "Can't find %s in any known prefix!"
msgstr "%s non trouvé dans les préfixes !"
@@ -74,3 +85,6 @@
#: ../data/nautilus-pastebin-configurator.glade.h:5
msgid "Nautilus Pastebin configuration panel"
msgstr "Panneau de configuration de Nautilus Pastebin"
+
+#~ msgid "Unable to send the file"
+#~ msgstr "Impossible d'envoyer le fichier"
diff -Nru nautilus-pastebin-0.4.1/po/it.po nautilus-pastebin-0.5.0/po/it.po
--- nautilus-pastebin-0.4.1/po/it.po 2010-01-25 17:33:49.000000000 +0100
+++ nautilus-pastebin-0.5.0/po/it.po 2010-06-18 15:28:56.000000000 +0200
@@ -6,51 +6,62 @@
msgid ""
msgstr ""
"Project-Id-Version: nautilus-pastebin\n"
-"Report-Msgid-Bugs-To: FULL NAME \n"
-"POT-Creation-Date: 2009-12-01 22:02+0100\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2010-06-18 15:15+0200\n"
"PO-Revision-Date: 2010-01-23 16:54+0000\n"
"Last-Translator: Alessio Treglia \n"
"Language-Team: Italian \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-01-24 04:54+0000\n"
+"X-Launchpad-Export-Date: 2010-02-26 04:57+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
-#: ../scripts/nautilus-pastebin.py:156
+#: ../nautilus-pastebin.py:150
msgid ""
"The file will be sent to the selected pastebin: are you sure to continue?"
msgstr ""
"Il file verrà inviato al pastebin selezionato: si è sicuri di voler "
"continuare?"
-#: ../scripts/nautilus-pastebin.py:174
+#: ../nautilus-pastebin.py:168
msgid "Unable to read or parse the result page."
msgstr "Impossibile leggere o interpretare la pagina di risultato."
-#: ../scripts/nautilus-pastebin.py:175
+#: ../nautilus-pastebin.py:169
msgid "It could be a server timeout or a change server side. Try later."
msgstr ""
"Può essersi verificato un timeout o un problema del server. Provare più "
"tardi."
-#: ../scripts/nautilus-pastebin.py:212
-msgid "Pastebin"
+#: ../nautilus-pastebin.py:210
+#, fuzzy, python-format
+msgid "Pastebin to %s"
msgstr "Pastebin"
-#: ../scripts/nautilus-pastebin.py:213
-msgid "Send this file to a pastebin"
+#: ../nautilus-pastebin.py:211
+#, fuzzy, python-format
+msgid "Send this file to %s"
msgstr "Invia questo file a un pastebin"
-#: ../scripts/nautilus-pastebin.py:229
-msgid "Unable to send the file"
-msgstr "Impossibile inviare il file"
+#: ../nautilus-pastebin.py:224
+msgid "Wrong configuration"
+msgstr ""
+
+#: ../nautilus-pastebin.py:224
+msgid ""
+"The selected pastebin is not available, please check your configuration."
+msgstr ""
-#: ../scripts/nautilus-pastebin.py:229
+#: ../nautilus-pastebin.py:233
+msgid "Unsupported MIME type"
+msgstr ""
+
+#: ../nautilus-pastebin.py:233
msgid "The selected file cannot be pasted."
msgstr "Il file selezionato non può essere incollato."
-#: ../scripts/nautilus-pastebin-configurator.py:86
+#: ../nautilus-pastebin-configurator.py:77
#, python-format
msgid "Can't find %s in any known prefix!"
msgstr "Impossibile trovare %s in un qualsiasi prefisso conosciuto."
@@ -74,3 +85,6 @@
#: ../data/nautilus-pastebin-configurator.glade.h:5
msgid "Nautilus Pastebin configuration panel"
msgstr "Pannello di configurazione di Nautilus Pastebin"
+
+#~ msgid "Unable to send the file"
+#~ msgstr "Impossibile inviare il file"
diff -Nru nautilus-pastebin-0.4.1/po/nautilus-pastebin.pot nautilus-pastebin-0.5.0/po/nautilus-pastebin.pot
--- nautilus-pastebin-0.4.1/po/nautilus-pastebin.pot 2010-01-25 17:33:49.000000000 +0100
+++ nautilus-pastebin-0.5.0/po/nautilus-pastebin.pot 2010-06-18 15:15:57.000000000 +0200
@@ -8,7 +8,7 @@
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2009-12-01 22:02+0100\n"
+"POT-Creation-Date: 2010-06-18 15:15+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME \n"
"Language-Team: LANGUAGE \n"
@@ -16,36 +16,47 @@
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n"
-#: ../scripts/nautilus-pastebin.py:156
+#: ../nautilus-pastebin.py:150
msgid ""
"The file will be sent to the selected pastebin: are you sure to continue?"
msgstr ""
-#: ../scripts/nautilus-pastebin.py:174
+#: ../nautilus-pastebin.py:168
msgid "Unable to read or parse the result page."
msgstr ""
-#: ../scripts/nautilus-pastebin.py:175
+#: ../nautilus-pastebin.py:169
msgid "It could be a server timeout or a change server side. Try later."
msgstr ""
-#: ../scripts/nautilus-pastebin.py:212
-msgid "Pastebin"
+#: ../nautilus-pastebin.py:210
+#, python-format
+msgid "Pastebin to %s"
+msgstr ""
+
+#: ../nautilus-pastebin.py:211
+#, python-format
+msgid "Send this file to %s"
msgstr ""
-#: ../scripts/nautilus-pastebin.py:213
-msgid "Send this file to a pastebin"
+#: ../nautilus-pastebin.py:224
+msgid "Wrong configuration"
+msgstr ""
+
+#: ../nautilus-pastebin.py:224
+msgid ""
+"The selected pastebin is not available, please check your configuration."
msgstr ""
-#: ../scripts/nautilus-pastebin.py:229
-msgid "Unable to send the file"
+#: ../nautilus-pastebin.py:233
+msgid "Unsupported MIME type"
msgstr ""
-#: ../scripts/nautilus-pastebin.py:229
+#: ../nautilus-pastebin.py:233
msgid "The selected file cannot be pasted."
msgstr ""
-#: ../scripts/nautilus-pastebin-configurator.py:86
+#: ../nautilus-pastebin-configurator.py:77
#, python-format
msgid "Can't find %s in any known prefix!"
msgstr ""
diff -Nru nautilus-pastebin-0.4.1/po/nautilus-pastebin.pot.~1~ nautilus-pastebin-0.5.0/po/nautilus-pastebin.pot.~1~
--- nautilus-pastebin-0.4.1/po/nautilus-pastebin.pot.~1~ 1970-01-01 01:00:00.000000000 +0100
+++ nautilus-pastebin-0.5.0/po/nautilus-pastebin.pot.~1~ 2010-06-18 15:12:33.000000000 +0200
@@ -0,0 +1,82 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# FIRST AUTHOR , YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2010-06-18 15:12+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME \n"
+"Language-Team: LANGUAGE \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=CHARSET\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: ../nautilus-pastebin.py:150
+msgid ""
+"The file will be sent to the selected pastebin: are you sure to continue?"
+msgstr ""
+
+#: ../nautilus-pastebin.py:168
+msgid "Unable to read or parse the result page."
+msgstr ""
+
+#: ../nautilus-pastebin.py:169
+msgid "It could be a server timeout or a change server side. Try later."
+msgstr ""
+
+#: ../nautilus-pastebin.py:210
+#, python-format
+msgid "Pastebin to %s"
+msgstr ""
+
+#: ../nautilus-pastebin.py:211
+#, python-format
+msgid "Send this file to %s"
+msgstr ""
+
+#: ../nautilus-pastebin.py:224
+msgid "Wrong configuration"
+msgstr ""
+
+#: ../nautilus-pastebin.py:224
+msgid ""
+"The selected pastebin is not available, please check your configuration."
+msgstr ""
+
+#: ../nautilus-pastebin.py:233
+msgid "Unsupported MIME type"
+msgstr ""
+
+#: ../nautilus-pastebin.py:233
+msgid "The selected file cannot be pasted."
+msgstr ""
+
+#: ../nautilus-pastebin-configurator.py:77
+#, python-format
+msgid "Can't find %s in any known prefix!"
+msgstr ""
+
+#: ../data/nautilus-pastebin-configurator.glade.h:1
+msgid "Ask to confirm:"
+msgstr ""
+
+#: ../data/nautilus-pastebin-configurator.glade.h:2
+msgid "Open browser:"
+msgstr ""
+
+#: ../data/nautilus-pastebin-configurator.glade.h:3
+msgid "Pastebin:"
+msgstr ""
+
+#: ../data/nautilus-pastebin-configurator.glade.h:4
+msgid "Show a notification:"
+msgstr ""
+
+#: ../data/nautilus-pastebin-configurator.glade.h:5
+msgid "Nautilus Pastebin configuration panel"
+msgstr ""
diff -Nru nautilus-pastebin-0.4.1/po/nl.po nautilus-pastebin-0.5.0/po/nl.po
--- nautilus-pastebin-0.4.1/po/nl.po 2010-01-25 17:33:49.000000000 +0100
+++ nautilus-pastebin-0.5.0/po/nl.po 2010-06-18 15:28:56.000000000 +0200
@@ -6,51 +6,62 @@
msgid ""
msgstr ""
"Project-Id-Version: nautilus-pastebin\n"
-"Report-Msgid-Bugs-To: FULL NAME \n"
-"POT-Creation-Date: 2009-12-01 22:02+0100\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2010-06-18 15:15+0200\n"
"PO-Revision-Date: 2010-01-23 16:00+0000\n"
"Last-Translator: FULL NAME \n"
"Language-Team: Dutch \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-01-24 04:54+0000\n"
+"X-Launchpad-Export-Date: 2010-02-26 04:57+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
-#: ../scripts/nautilus-pastebin.py:156
+#: ../nautilus-pastebin.py:150
msgid ""
"The file will be sent to the selected pastebin: are you sure to continue?"
msgstr ""
"Het bestand zal verstuurd worden naar de geselecteerde pastebin: weet u "
"zeker dat u wilt doorgaan?"
-#: ../scripts/nautilus-pastebin.py:174
+#: ../nautilus-pastebin.py:168
msgid "Unable to read or parse the result page."
msgstr "Kon de resultaatpagina niet verwerkeen of lezen."
-#: ../scripts/nautilus-pastebin.py:175
+#: ../nautilus-pastebin.py:169
msgid "It could be a server timeout or a change server side. Try later."
msgstr ""
"Mogelijk trad er een servertime-out op, of is er iets aan de server "
"veranderd. Probeer het later nog eens."
-#: ../scripts/nautilus-pastebin.py:212
-msgid "Pastebin"
+#: ../nautilus-pastebin.py:210
+#, fuzzy, python-format
+msgid "Pastebin to %s"
msgstr "Pastebin"
-#: ../scripts/nautilus-pastebin.py:213
-msgid "Send this file to a pastebin"
+#: ../nautilus-pastebin.py:211
+#, fuzzy, python-format
+msgid "Send this file to %s"
msgstr "Dit bestand naar een pastebin versturen"
-#: ../scripts/nautilus-pastebin.py:229
-msgid "Unable to send the file"
-msgstr "Kan het bestand niet verzenden"
+#: ../nautilus-pastebin.py:224
+msgid "Wrong configuration"
+msgstr ""
+
+#: ../nautilus-pastebin.py:224
+msgid ""
+"The selected pastebin is not available, please check your configuration."
+msgstr ""
-#: ../scripts/nautilus-pastebin.py:229
+#: ../nautilus-pastebin.py:233
+msgid "Unsupported MIME type"
+msgstr ""
+
+#: ../nautilus-pastebin.py:233
msgid "The selected file cannot be pasted."
msgstr "Het geselecteerde bestand kan niet geplaatst worden."
-#: ../scripts/nautilus-pastebin-configurator.py:86
+#: ../nautilus-pastebin-configurator.py:77
#, python-format
msgid "Can't find %s in any known prefix!"
msgstr "Kan %s niet in de prefixes vinden!"
@@ -74,3 +85,6 @@
#: ../data/nautilus-pastebin-configurator.glade.h:5
msgid "Nautilus Pastebin configuration panel"
msgstr "Configuratiepaneel voor Nautilus Pastebin"
+
+#~ msgid "Unable to send the file"
+#~ msgstr "Kan het bestand niet verzenden"
diff -Nru nautilus-pastebin-0.4.1/po/oc.po nautilus-pastebin-0.5.0/po/oc.po
--- nautilus-pastebin-0.4.1/po/oc.po 1970-01-01 01:00:00.000000000 +0100
+++ nautilus-pastebin-0.5.0/po/oc.po 2010-06-18 15:28:56.000000000 +0200
@@ -0,0 +1,86 @@
+# Occitan (post 1500) translation for nautilus-pastebin
+# Copyright (c) 2010 Rosetta Contributors and Canonical Ltd 2010
+# This file is distributed under the same license as the nautilus-pastebin package.
+# FIRST AUTHOR , 2010.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: nautilus-pastebin\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2010-06-18 15:15+0200\n"
+"PO-Revision-Date: 2010-03-19 08:49+0000\n"
+"Last-Translator: Cédric VALMARY (Per Tot en òc) \n"
+"Language-Team: Occitan (post 1500) \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Launchpad-Export-Date: 2010-03-20 04:59+0000\n"
+"X-Generator: Launchpad (build Unknown)\n"
+
+#: ../nautilus-pastebin.py:150
+msgid ""
+"The file will be sent to the selected pastebin: are you sure to continue?"
+msgstr ""
+
+#: ../nautilus-pastebin.py:168
+msgid "Unable to read or parse the result page."
+msgstr ""
+
+#: ../nautilus-pastebin.py:169
+msgid "It could be a server timeout or a change server side. Try later."
+msgstr ""
+
+#: ../nautilus-pastebin.py:210
+#, fuzzy, python-format
+msgid "Pastebin to %s"
+msgstr "Pastebin"
+
+#: ../nautilus-pastebin.py:211
+#, python-format
+msgid "Send this file to %s"
+msgstr ""
+
+#: ../nautilus-pastebin.py:224
+msgid "Wrong configuration"
+msgstr ""
+
+#: ../nautilus-pastebin.py:224
+msgid ""
+"The selected pastebin is not available, please check your configuration."
+msgstr ""
+
+#: ../nautilus-pastebin.py:233
+msgid "Unsupported MIME type"
+msgstr ""
+
+#: ../nautilus-pastebin.py:233
+msgid "The selected file cannot be pasted."
+msgstr ""
+
+#: ../nautilus-pastebin-configurator.py:77
+#, python-format
+msgid "Can't find %s in any known prefix!"
+msgstr ""
+
+#: ../data/nautilus-pastebin-configurator.glade.h:1
+msgid "Ask to confirm:"
+msgstr "Demandar de confirmar:"
+
+#: ../data/nautilus-pastebin-configurator.glade.h:2
+msgid "Open browser:"
+msgstr ""
+
+#: ../data/nautilus-pastebin-configurator.glade.h:3
+msgid "Pastebin:"
+msgstr "Pastebin:"
+
+#: ../data/nautilus-pastebin-configurator.glade.h:4
+msgid "Show a notification:"
+msgstr "Afichar una notificacion:"
+
+#: ../data/nautilus-pastebin-configurator.glade.h:5
+msgid "Nautilus Pastebin configuration panel"
+msgstr "Panèl de configuracion de Nautilus Pastebin"
+
+#~ msgid "Unable to send the file"
+#~ msgstr "Impossible de mandar lo fichièr"
diff -Nru nautilus-pastebin-0.4.1/po/POTFILES.in nautilus-pastebin-0.5.0/po/POTFILES.in
--- nautilus-pastebin-0.4.1/po/POTFILES.in 2010-01-25 17:33:49.000000000 +0100
+++ nautilus-pastebin-0.5.0/po/POTFILES.in 2010-06-17 15:39:25.000000000 +0200
@@ -1,5 +1,5 @@
-scripts/nautilus-pastebin.py
-scripts/nautilus-pastebin-configurator.py
+nautilus-pastebin.py
+nautilus-pastebin-configurator.py
data/nautilus-pastebin-configurator.glade
data/nautilus-pastebin-configurator.desktop
data/nautilus-pastebin.schemas
diff -Nru nautilus-pastebin-0.4.1/po/ro.po nautilus-pastebin-0.5.0/po/ro.po
--- nautilus-pastebin-0.4.1/po/ro.po 1970-01-01 01:00:00.000000000 +0100
+++ nautilus-pastebin-0.5.0/po/ro.po 2010-06-18 15:28:56.000000000 +0200
@@ -0,0 +1,83 @@
+# Romanian translation for nautilus-pastebin
+# Copyright (c) 2010 Rosetta Contributors and Canonical Ltd 2010
+# This file is distributed under the same license as the nautilus-pastebin package.
+# FIRST AUTHOR , 2010.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: nautilus-pastebin\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2010-06-18 15:15+0200\n"
+"PO-Revision-Date: 2010-06-01 09:32+0000\n"
+"Last-Translator: FULL NAME \n"
+"Language-Team: Romanian \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Launchpad-Export-Date: 2010-06-02 03:40+0000\n"
+"X-Generator: Launchpad (build Unknown)\n"
+
+#: ../nautilus-pastebin.py:150
+msgid ""
+"The file will be sent to the selected pastebin: are you sure to continue?"
+msgstr ""
+
+#: ../nautilus-pastebin.py:168
+msgid "Unable to read or parse the result page."
+msgstr ""
+
+#: ../nautilus-pastebin.py:169
+msgid "It could be a server timeout or a change server side. Try later."
+msgstr ""
+
+#: ../nautilus-pastebin.py:210
+#, python-format
+msgid "Pastebin to %s"
+msgstr ""
+
+#: ../nautilus-pastebin.py:211
+#, python-format
+msgid "Send this file to %s"
+msgstr ""
+
+#: ../nautilus-pastebin.py:224
+msgid "Wrong configuration"
+msgstr ""
+
+#: ../nautilus-pastebin.py:224
+msgid ""
+"The selected pastebin is not available, please check your configuration."
+msgstr ""
+
+#: ../nautilus-pastebin.py:233
+msgid "Unsupported MIME type"
+msgstr ""
+
+#: ../nautilus-pastebin.py:233
+msgid "The selected file cannot be pasted."
+msgstr ""
+
+#: ../nautilus-pastebin-configurator.py:77
+#, python-format
+msgid "Can't find %s in any known prefix!"
+msgstr ""
+
+#: ../data/nautilus-pastebin-configurator.glade.h:1
+msgid "Ask to confirm:"
+msgstr ""
+
+#: ../data/nautilus-pastebin-configurator.glade.h:2
+msgid "Open browser:"
+msgstr ""
+
+#: ../data/nautilus-pastebin-configurator.glade.h:3
+msgid "Pastebin:"
+msgstr ""
+
+#: ../data/nautilus-pastebin-configurator.glade.h:4
+msgid "Show a notification:"
+msgstr ""
+
+#: ../data/nautilus-pastebin-configurator.glade.h:5
+msgid "Nautilus Pastebin configuration panel"
+msgstr ""
diff -Nru nautilus-pastebin-0.4.1/po/ru.po nautilus-pastebin-0.5.0/po/ru.po
--- nautilus-pastebin-0.4.1/po/ru.po 2010-01-25 17:33:49.000000000 +0100
+++ nautilus-pastebin-0.5.0/po/ru.po 2010-06-18 15:28:56.000000000 +0200
@@ -6,52 +6,63 @@
msgid ""
msgstr ""
"Project-Id-Version: nautilus-pastebin\n"
-"Report-Msgid-Bugs-To: FULL NAME \n"
-"POT-Creation-Date: 2009-12-01 22:02+0100\n"
-"PO-Revision-Date: 2010-01-23 16:00+0000\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2010-06-18 15:15+0200\n"
+"PO-Revision-Date: 2010-03-03 05:54+0000\n"
"Last-Translator: Alessio Treglia \n"
"Language-Team: Russian \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-01-24 04:54+0000\n"
+"X-Launchpad-Export-Date: 2010-03-04 05:05+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
-#: ../scripts/nautilus-pastebin.py:156
+#: ../nautilus-pastebin.py:150
msgid ""
"The file will be sent to the selected pastebin: are you sure to continue?"
msgstr "Файл будет послан в выбранное хранилище: продолжить?"
-#: ../scripts/nautilus-pastebin.py:174
+#: ../nautilus-pastebin.py:168
msgid "Unable to read or parse the result page."
msgstr "Невозможно обработать страницу с результатами."
-#: ../scripts/nautilus-pastebin.py:175
+#: ../nautilus-pastebin.py:169
msgid "It could be a server timeout or a change server side. Try later."
msgstr ""
"Возможно причина в задержке от сервера или в изменениях на стороне сервера. "
"Попробуйте позже."
-#: ../scripts/nautilus-pastebin.py:212
-msgid "Pastebin"
+#: ../nautilus-pastebin.py:210
+#, fuzzy, python-format
+msgid "Pastebin to %s"
msgstr "Pastebin"
-#: ../scripts/nautilus-pastebin.py:213
-msgid "Send this file to a pastebin"
+#: ../nautilus-pastebin.py:211
+#, fuzzy, python-format
+msgid "Send this file to %s"
msgstr "Отправить файл в pastebin"
-#: ../scripts/nautilus-pastebin.py:229
-msgid "Unable to send the file"
-msgstr "Не удалось отправить файл"
+#: ../nautilus-pastebin.py:224
+msgid "Wrong configuration"
+msgstr ""
+
+#: ../nautilus-pastebin.py:224
+msgid ""
+"The selected pastebin is not available, please check your configuration."
+msgstr ""
-#: ../scripts/nautilus-pastebin.py:229
+#: ../nautilus-pastebin.py:233
+msgid "Unsupported MIME type"
+msgstr ""
+
+#: ../nautilus-pastebin.py:233
msgid "The selected file cannot be pasted."
msgstr "Выбранный файл не может быть загружен."
-#: ../scripts/nautilus-pastebin-configurator.py:86
+#: ../nautilus-pastebin-configurator.py:77
#, python-format
msgid "Can't find %s in any known prefix!"
-msgstr ""
+msgstr "Не удается найти %s в любом известном префиксе!"
#: ../data/nautilus-pastebin-configurator.glade.h:1
msgid "Ask to confirm:"
@@ -72,3 +83,6 @@
#: ../data/nautilus-pastebin-configurator.glade.h:5
msgid "Nautilus Pastebin configuration panel"
msgstr "Nautilus Pastebin панель настроек"
+
+#~ msgid "Unable to send the file"
+#~ msgstr "Не удалось отправить файл"
diff -Nru nautilus-pastebin-0.4.1/po/sk.po nautilus-pastebin-0.5.0/po/sk.po
--- nautilus-pastebin-0.4.1/po/sk.po 1970-01-01 01:00:00.000000000 +0100
+++ nautilus-pastebin-0.5.0/po/sk.po 2010-06-18 15:28:56.000000000 +0200
@@ -0,0 +1,86 @@
+# Slovak translation for nautilus-pastebin
+# Copyright (c) 2010 Rosetta Contributors and Canonical Ltd 2010
+# This file is distributed under the same license as the nautilus-pastebin package.
+# FIRST AUTHOR , 2010.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: nautilus-pastebin\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2010-06-18 15:15+0200\n"
+"PO-Revision-Date: 2010-05-09 17:55+0000\n"
+"Last-Translator: FULL NAME \n"
+"Language-Team: Slovak \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Launchpad-Export-Date: 2010-05-20 05:46+0000\n"
+"X-Generator: Launchpad (build Unknown)\n"
+
+#: ../nautilus-pastebin.py:150
+msgid ""
+"The file will be sent to the selected pastebin: are you sure to continue?"
+msgstr ""
+
+#: ../nautilus-pastebin.py:168
+msgid "Unable to read or parse the result page."
+msgstr ""
+
+#: ../nautilus-pastebin.py:169
+msgid "It could be a server timeout or a change server side. Try later."
+msgstr ""
+
+#: ../nautilus-pastebin.py:210
+#, fuzzy, python-format
+msgid "Pastebin to %s"
+msgstr "Pastebin"
+
+#: ../nautilus-pastebin.py:211
+#, fuzzy, python-format
+msgid "Send this file to %s"
+msgstr "Poslať tento súbor do pastebin"
+
+#: ../nautilus-pastebin.py:224
+msgid "Wrong configuration"
+msgstr ""
+
+#: ../nautilus-pastebin.py:224
+msgid ""
+"The selected pastebin is not available, please check your configuration."
+msgstr ""
+
+#: ../nautilus-pastebin.py:233
+msgid "Unsupported MIME type"
+msgstr ""
+
+#: ../nautilus-pastebin.py:233
+msgid "The selected file cannot be pasted."
+msgstr ""
+
+#: ../nautilus-pastebin-configurator.py:77
+#, python-format
+msgid "Can't find %s in any known prefix!"
+msgstr ""
+
+#: ../data/nautilus-pastebin-configurator.glade.h:1
+msgid "Ask to confirm:"
+msgstr "Spýtať sa na potvrdenie:"
+
+#: ../data/nautilus-pastebin-configurator.glade.h:2
+msgid "Open browser:"
+msgstr "Otvoriť prehliadač:"
+
+#: ../data/nautilus-pastebin-configurator.glade.h:3
+msgid "Pastebin:"
+msgstr "Pastebin:"
+
+#: ../data/nautilus-pastebin-configurator.glade.h:4
+msgid "Show a notification:"
+msgstr "Zobraziť oznámenie:"
+
+#: ../data/nautilus-pastebin-configurator.glade.h:5
+msgid "Nautilus Pastebin configuration panel"
+msgstr "Konfiguračný panel Nautilus Pastebin"
+
+#~ msgid "Unable to send the file"
+#~ msgstr "Súbor sa nedá poslať"
diff -Nru nautilus-pastebin-0.4.1/po/tr.po nautilus-pastebin-0.5.0/po/tr.po
--- nautilus-pastebin-0.4.1/po/tr.po 1970-01-01 01:00:00.000000000 +0100
+++ nautilus-pastebin-0.5.0/po/tr.po 2010-06-18 15:28:56.000000000 +0200
@@ -0,0 +1,88 @@
+# Turkish translation for nautilus-pastebin
+# Copyright (c) 2010 Rosetta Contributors and Canonical Ltd 2010
+# This file is distributed under the same license as the nautilus-pastebin package.
+# FIRST AUTHOR , 2010.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: nautilus-pastebin\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2010-06-18 15:15+0200\n"
+"PO-Revision-Date: 2010-06-14 04:34+0000\n"
+"Last-Translator: newzath \n"
+"Language-Team: Turkish \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Launchpad-Export-Date: 2010-06-15 03:41+0000\n"
+"X-Generator: Launchpad (build Unknown)\n"
+
+#: ../nautilus-pastebin.py:150
+msgid ""
+"The file will be sent to the selected pastebin: are you sure to continue?"
+msgstr "Dosya seçilen uzak kutuya gönderilecek: devam ediyor musunuz?"
+
+#: ../nautilus-pastebin.py:168
+msgid "Unable to read or parse the result page."
+msgstr "Sonuç sayfası okunamıyor ya da ayrıştırılamıyor."
+
+#: ../nautilus-pastebin.py:169
+msgid "It could be a server timeout or a change server side. Try later."
+msgstr ""
+"Bu durum bir sunucunun zaman aşımından ya da sunucu tarfında bir "
+"değişikliğin yapılmakta olmasından oluşabilir. Daha sonra tekrar deneyin."
+
+#: ../nautilus-pastebin.py:210
+#, fuzzy, python-format
+msgid "Pastebin to %s"
+msgstr "Uzak Kutu"
+
+#: ../nautilus-pastebin.py:211
+#, fuzzy, python-format
+msgid "Send this file to %s"
+msgstr "Bu dosyayı uzak kutuya gönder"
+
+#: ../nautilus-pastebin.py:224
+msgid "Wrong configuration"
+msgstr ""
+
+#: ../nautilus-pastebin.py:224
+msgid ""
+"The selected pastebin is not available, please check your configuration."
+msgstr ""
+
+#: ../nautilus-pastebin.py:233
+msgid "Unsupported MIME type"
+msgstr ""
+
+#: ../nautilus-pastebin.py:233
+msgid "The selected file cannot be pasted."
+msgstr "Seçilen dosya yapıştırılamıyor."
+
+#: ../nautilus-pastebin-configurator.py:77
+#, python-format
+msgid "Can't find %s in any known prefix!"
+msgstr "%s tüm bilinen uzantılar içinde bulunamıyor!"
+
+#: ../data/nautilus-pastebin-configurator.glade.h:1
+msgid "Ask to confirm:"
+msgstr "Onay iste:"
+
+#: ../data/nautilus-pastebin-configurator.glade.h:2
+msgid "Open browser:"
+msgstr "Tarayıcı aç:"
+
+#: ../data/nautilus-pastebin-configurator.glade.h:3
+msgid "Pastebin:"
+msgstr "Uzak Kutu:"
+
+#: ../data/nautilus-pastebin-configurator.glade.h:4
+msgid "Show a notification:"
+msgstr "Bir bildirim göster:"
+
+#: ../data/nautilus-pastebin-configurator.glade.h:5
+msgid "Nautilus Pastebin configuration panel"
+msgstr "Nautilus Uzak Kutu yapılandırıcı paneli"
+
+#~ msgid "Unable to send the file"
+#~ msgstr "Dosya gönderilemedi"
diff -Nru nautilus-pastebin-0.4.1/po/zh_CN.po nautilus-pastebin-0.5.0/po/zh_CN.po
--- nautilus-pastebin-0.4.1/po/zh_CN.po 2010-01-25 17:33:49.000000000 +0100
+++ nautilus-pastebin-0.5.0/po/zh_CN.po 2010-06-18 15:28:56.000000000 +0200
@@ -6,67 +6,81 @@
msgid ""
msgstr ""
"Project-Id-Version: nautilus-pastebin\n"
-"Report-Msgid-Bugs-To: FULL NAME \n"
-"POT-Creation-Date: 2009-12-01 22:02+0100\n"
-"PO-Revision-Date: 2010-01-23 16:54+0000\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2010-06-18 15:15+0200\n"
+"PO-Revision-Date: 2010-06-09 04:29+0000\n"
"Last-Translator: Alessio Treglia \n"
"Language-Team: Simplified Chinese \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-01-24 04:54+0000\n"
+"X-Launchpad-Export-Date: 2010-06-10 03:46+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
-#: ../scripts/nautilus-pastebin.py:156
+#: ../nautilus-pastebin.py:150
msgid ""
"The file will be sent to the selected pastebin: are you sure to continue?"
-msgstr ""
+msgstr "此文件将被发送至指定的 pastebin,确定继续吗?"
-#: ../scripts/nautilus-pastebin.py:174
+#: ../nautilus-pastebin.py:168
msgid "Unable to read or parse the result page."
-msgstr ""
+msgstr "无法读取或解析结果页。"
-#: ../scripts/nautilus-pastebin.py:175
+#: ../nautilus-pastebin.py:169
msgid "It could be a server timeout or a change server side. Try later."
-msgstr ""
+msgstr "可能是服务器超时或服务器调整,请稍后重试。"
-#: ../scripts/nautilus-pastebin.py:212
-msgid "Pastebin"
+#: ../nautilus-pastebin.py:210
+#, fuzzy, python-format
+msgid "Pastebin to %s"
msgstr "Pastebin"
-#: ../scripts/nautilus-pastebin.py:213
-msgid "Send this file to a pastebin"
+#: ../nautilus-pastebin.py:211
+#, fuzzy, python-format
+msgid "Send this file to %s"
+msgstr "将此文件发送到 pastebin"
+
+#: ../nautilus-pastebin.py:224
+msgid "Wrong configuration"
msgstr ""
-#: ../scripts/nautilus-pastebin.py:229
-msgid "Unable to send the file"
-msgstr "无法发送文件"
+#: ../nautilus-pastebin.py:224
+msgid ""
+"The selected pastebin is not available, please check your configuration."
+msgstr ""
-#: ../scripts/nautilus-pastebin.py:229
-msgid "The selected file cannot be pasted."
+#: ../nautilus-pastebin.py:233
+msgid "Unsupported MIME type"
msgstr ""
-#: ../scripts/nautilus-pastebin-configurator.py:86
+#: ../nautilus-pastebin.py:233
+msgid "The selected file cannot be pasted."
+msgstr "无法粘贴选定的文件。"
+
+#: ../nautilus-pastebin-configurator.py:77
#, python-format
msgid "Can't find %s in any known prefix!"
-msgstr ""
+msgstr "在已知前缀中无法找到 %s !"
#: ../data/nautilus-pastebin-configurator.glade.h:1
msgid "Ask to confirm:"
-msgstr ""
+msgstr "询问以确认:"
#: ../data/nautilus-pastebin-configurator.glade.h:2
msgid "Open browser:"
-msgstr ""
+msgstr "打开浏览器:"
#: ../data/nautilus-pastebin-configurator.glade.h:3
msgid "Pastebin:"
-msgstr ""
+msgstr "Pastebin:"
#: ../data/nautilus-pastebin-configurator.glade.h:4
msgid "Show a notification:"
-msgstr ""
+msgstr "显示通知:"
#: ../data/nautilus-pastebin-configurator.glade.h:5
msgid "Nautilus Pastebin configuration panel"
-msgstr ""
+msgstr "Nautilus Pastebin 配置面板"
+
+#~ msgid "Unable to send the file"
+#~ msgstr "无法发送文件"
diff -Nru nautilus-pastebin-0.4.1/scripts/nautilus-pastebin-configurator.py nautilus-pastebin-0.5.0/scripts/nautilus-pastebin-configurator.py
--- nautilus-pastebin-0.4.1/scripts/nautilus-pastebin-configurator.py 2010-01-25 17:33:49.000000000 +0100
+++ nautilus-pastebin-0.5.0/scripts/nautilus-pastebin-configurator.py 1970-01-01 01:00:00.000000000 +0100
@@ -1,189 +0,0 @@
-#!/usr/bin/python
-# -*- coding: utf-8 -*-
-# nautilus-pastebin - Nautilus extension to paste a file to a pastebin service
-# Written by:
-# Alessio Treglia
-# Copyright (C) 2009-2010, Alessio Treglia
-#
-# This package is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This package is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this package; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-#
-
-import os
-import sys
-import gettext
-import gtk
-import gconf
-from ConfigParser import ConfigParser
-
-# Globals
-APP_NAME = "nautilus-pastebin"
-MAINTAINER_MODE = False
-APP_PATH = os.path.join(sys.prefix, "share", APP_NAME)
-
-# Check whether running in maintainer mode
-if os.path.expanduser('~') in os.path.realpath(__file__):
- sys.path.append(os.path.expanduser(os.path.join('~', '.nautilus-pastebin')))
- APP_PATH = os.path.expanduser(os.path.join('~', '.nautilus-pastebin'))
- MAINTAINER_MODE = True
-
-# By default, the program looks for presets in the following paths:
-# /etc/nautilus-pastebin/presets/
-# ~/.config/nautilus-pastebin/presets
-PRESETS_PATHS = [
- os.path.join(sys.prefix, 'share', 'nautilus-pastebin', 'presets'),
- os.path.expanduser(os.path.join('~','.config','nautilus-pastebin', 'presets'))
-]
-
-gettext.install(APP_NAME)
-
-def get_presets():
- presets = []
-
- if MAINTAINER_MODE:
- PRESETS_PATHS.append(os.path.join(APP_PATH, 'data', 'presets'))
-
- for path in PRESETS_PATHS:
- if os.path.exists(path):
- append_these = filter(
- lambda x: x.endswith('.conf'), os.listdir(path)
- )
- presets.extend(
- map(
- lambda x: os.path.join(path,x),
- append_these
- )
- )
- return presets
-
-def getSearchResPaths():
- return [
- os.path.join(sys.prefix, "share", "nautilus-pastebin"),
- os.path.join(sys.prefix, "share", "pixmaps"),
- os.path.join(sys.prefix, "local", "share", "nautilus-pastebin"),
- os.path.expanduser(os.path.join("~", ".nautilus-pastebin", "data")),
- os.getcwd()
- ]
-
-def getPath(path):
- search_paths = getSearchResPaths()
- for search in search_paths:
- fullpath = os.path.join(search, path)
- if os.path.exists(fullpath):
- return fullpath
- else:
- raise IOError(_("Can't find %s in any known prefix!") % kwargs[component])
-
-GLADE_FILE = getPath('nautilus-pastebin-configurator.glade')
-ICON_FILE = getPath('nautilus-pastebin.png')
-USERCONFIG_DIR = os.path.expanduser(os.path.join('~', '.config', 'nautilus-pastebin'))
-
-class Settings(object):
- GCONF_PATH = "/apps/nautilus-pastebin/"
- KEYMAP = {
- 'preset' : 'string',
- 'ask_confirmation' : 'bool',
- 'show_notification' : 'bool',
- 'open_browser' : 'bool'
- }
-
- def update_configuration(self):
- for kname, ktype in self.KEYMAP.items():
- kvalue = getattr(self, kname)
- getattr(self.__gconf_client, 'set_%s' % ktype)(self.GCONF_PATH + kname, kvalue)
-
- def __retrieve_settings(self):
- for kname, ktype in self.KEYMAP.items():
- setattr(self, kname, getattr(self.__gconf_client, 'get_%s' % ktype)(self.GCONF_PATH + kname))
-
- def __load_presets(self):
- cp = ConfigParser()
- cp.read(get_presets())
- self.presets = cp.sections()
-
- def __init__(self):
- self.__gconf_client = gconf.client_get_default()
- self.__retrieve_settings()
- self.__load_presets()
-
-class Controller(object):
-
- def showErrorMessage(self, message):
- md = gtk.MessageDialog(parent=self.dialogMain,
- message_format=message,
- buttons=gtk.BUTTONS_CLOSE,
- type = gtk.MESSAGE_ERROR,
- flags = gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT)
- md.run()
- md.destroy()
-
- def quit(self, *args):
- gtk.main_quit()
-
- def on_button_close_clicked(self, widget, data=None):
- self.dialogMain.destroy()
- self._retrieve_config_from_ui()
- self.settings.update_configuration()
- self.quit()
-
- def _retrieve_config_from_ui(self):
- params = self.settings.KEYMAP.keys()
- for i in params:
- if i == 'preset':
- setattr(self.settings, i, self.builder.get_object("combobox_pastebin").get_active_text())
- else:
- setattr(self.settings, i, self.builder.get_object(i).get_active())
-
- def _setup_widgets(self):
- builder = self.builder
- presets = self.settings.presets
- # Set the icon
- self.dialogMain.set_icon_from_file(ICON_FILE)
- # Populate the combobox widget
- comboboxPastebin = builder.get_object("combobox_pastebin")
- comboboxPastebin.set_model(gtk.ListStore(str))
- cell = gtk.CellRendererText()
- comboboxPastebin.pack_start(cell, True)
- comboboxPastebin.add_attribute(cell, 'text', 0)
-
- [comboboxPastebin.append_text(k) for k in presets]
- comboboxPastebin.set_active(presets.index(self.settings.preset))
-
- # Set the boolean flags
- for k in [option for option in self.settings.KEYMAP.keys() if option is not 'preset']:
- builder.get_object(k).set_active(
- getattr(self.settings, k)
- )
-
- def __init__(self):
- builder = gtk.Builder()
- builder.add_from_file(GLADE_FILE)
- self.settings = Settings()
- self.dialogMain = builder.get_object('dialog_main')
- self.tableOptions = builder.get_object('table_options')
- builder.connect_signals(self)
- self.dialogMain.connect('delete_event', self.quit)
-
- self.builder = builder
-
- self._setup_widgets()
- self.dialogMain.show_all()
-
-def main():
- c = Controller()
- gtk.main()
-
-if __name__ == "__main__":
- main()
-
diff -Nru nautilus-pastebin-0.4.1/scripts/nautilus-pastebin.py nautilus-pastebin-0.5.0/scripts/nautilus-pastebin.py
--- nautilus-pastebin-0.4.1/scripts/nautilus-pastebin.py 2010-01-25 17:33:49.000000000 +0100
+++ nautilus-pastebin-0.5.0/scripts/nautilus-pastebin.py 1970-01-01 01:00:00.000000000 +0100
@@ -1,246 +0,0 @@
-#!/usr/bin/python
-# -*- coding: utf-8 -*-
-# nautilus-pastebin - Nautilus extension to paste a file to a pastebin service
-# Written by:
-# Alessio Treglia
-# Copyright (C) 2009-2010, Alessio Treglia
-#
-# This package is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This package is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this package; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-#
-
-import os
-import sys
-import time
-import gettext
-import urllib
-import webbrowser
-from threading import Thread
-from ConfigParser import ConfigParser
-import gtk
-import gconf
-import nautilus
-import pynotify
-
-# Globals
-APP_NAME = "nautilus-pastebin"
-LOGGING = 1
-MAINTAINER_MODE = False
-APP_PATH = os.path.join(sys.prefix, "share", APP_NAME)
-
-# Check whether running in maintainer mode
-if os.path.expanduser('~') in os.path.realpath(__file__):
- sys.path.append(os.path.expanduser(os.path.join('~', '.nautilus-pastebin')))
- APP_PATH = os.path.expanduser(os.path.join('~', '.nautilus-pastebin'))
- MAINTAINER_MODE = True
-from pastebin.core import *
-
-gettext.install(APP_NAME)
-
-class log:
- def log(self, message):
- if self.logger:
- self.logger.debug(message)
- def __init__(self):
- logger = None
- if LOGGING:
- import logging
- logger = logging.getLogger(APP_NAME)
- logger.setLevel(logging.DEBUG)
- ch = logging.StreamHandler()
- ch.setLevel(logging.DEBUG)
- logger.addHandler(ch)
- self.logger = logger
-
-log = log().log
-
-# By default, the program looks for presets in the following paths:
-# /etc/nautilus-pastebin/presets/
-# ~/.config/nautilus-pastebin/presets
-PRESETS_PATHS = [
- os.path.join(sys.prefix, 'share', 'nautilus-pastebin', 'presets'),
- os.path.expanduser(os.path.join('~','.config','nautilus-pastebin', 'presets'))
-]
-
-class ConfigFileException(Exception):
- pass
-
-def get_presets():
- presets = []
-
- if MAINTAINER_MODE:
- PRESETS_PATHS.append(os.path.join(APP_PATH, 'data', 'presets'))
-
- for path in PRESETS_PATHS:
- if os.path.exists(path):
- append_these = filter(
- lambda x: x.endswith('.conf'), os.listdir(path)
- )
- presets.extend(
- map(
- lambda x: os.path.join(path,x),
- append_these
- )
- )
- return presets
-
-pynotify.init("Nautilus pastebin extension")
-
-class Settings(object):
- """Configuration wrapper"""
- GCONF_PATH = "/apps/%s/" % APP_NAME
- KEYMAP = {
- 'preset' : 'string',
- 'ask_confirmation' : 'bool',
- 'show_notification' : 'bool',
- 'open_browser' : 'bool'
- }
-
- def validate(self):
- return self.__preset_is_available(self.__settings['preset'])
-
- def get_pastebin_configuration(self):
- """Retrieve and returns the configuration related to the pastebin service."""
- preset = self.__settings['preset']
- return PastebinConfiguration(dict(self.__presets.items(preset)))
-
- def get_available_pastebins(self):
- """Returns a list of available presets."""
- return self.__presets.sections()
-
- def get_settings(self):
- """Returns application's global settings.'"""
- return self.__settings
-
- def __preset_is_available(self, preset):
- return self.__presets.has_section(preset)
-
- def __load_presets(self, presets):
- self.__presets.read(presets)
-
- def __retrieve_settings(self):
- self.__settings = {}
- for kname, ktype in self.KEYMAP.items():
- self.__settings[kname] = getattr(self.__gconf_client, 'get_%s' % ktype)(self.GCONF_PATH + kname)
-
- def __init__(self, presets):
- self.__gconf_client = gconf.client_get_default()
- self.__presets = ConfigParser()
- self.__load_presets(presets)
- self.__retrieve_settings()
-
-class PastebinThread(Thread):
- def __init__(self, settings, pasteconf):
- self.settings = settings
- self.pasteconf = pasteconf
- self.wrapper = PastebinWrapperFactory().get_wrapper(pasteconf)
- Thread.__init__(self)
-
- def run(self):
- log ("PastebinThread started!")
-
- # Ask user to confirm the action
- if self.settings['ask_confirmation']:
- md = gtk.MessageDialog(None,
- message_format=_("The file will be sent to the selected pastebin: \
-are you sure to continue?"),
- flags=gtk.DIALOG_MODAL,
- buttons=gtk.BUTTONS_YES_NO,
- type=gtk.MESSAGE_QUESTION
- )
- response = md.run()
- md.destroy()
- if response == gtk.RESPONSE_NO:
- return
- pasteurl = self.wrapper.paste()
-
- summary = ''
- message = ''
- icon = None
- helper = gtk.Button()
-
- if not pasteurl:
- summary = _("Unable to read or parse the result page.")
- message = _("It could be a server timeout or a change server side. Try later.")
- icon = helper.render_icon(gtk.STOCK_DIALOG_ERROR, gtk.ICON_SIZE_DIALOG)
- else:
- summary = 'File pasted to: '
- URLmarkup = '%(pasteurl)s'
- message = URLmarkup % {'pasteurl':pasteurl}
- icon = helper.render_icon(gtk.STOCK_PASTE, gtk.ICON_SIZE_DIALOG)
-
- cb = gtk.clipboard_get('CLIPBOARD')
- cb.clear()
- cb.set_text(pasteurl)
-
- # Open a browser window
- if self.settings['open_browser']:
- webbrowser.open(pasteurl)
-
- # Show a bubble
- if self.settings['show_notification']:
- n = pynotify.Notification(summary, message)
- n.set_icon_from_pixbuf(icon)
- n.show()
-
-class PastebinitExtension(nautilus.MenuProvider):
- def __init__(self):
- log ("Intializing nautilus-pastebin extension...")
-
- def get_file_items(self, window, files):
- if len(files)!=1:
- return
- filename = files[0]
-
- if filename.get_uri_scheme() != 'file' or filename.is_directory():
- return
-
- items = []
- #Called when the user selects a file in Nautilus.
- item = nautilus.MenuItem("NautilusPython::pastebin_item",
- _("Pastebin"),
- _("Send this file to a pastebin"))
- item.set_property('icon', "nautilus-pastebin")
- item.connect("activate", self.menu_activate_cb, files)
- items.append(item)
- return items
-
- def menu_activate_cb(self, menu, files):
- if len(files) != 1:
- return
- filename = files[0]
-
- settings = Settings(get_presets())
- settings.validate()
- pasteconf = settings.get_pastebin_configuration()
-
- if not pasteconf.set_format_by_mimetype(filename.get_mime_type()):
- n= pynotify.Notification(_("Unable to send the file"), _("The selected file cannot be pasted."))
- helper = gtk.Button()
- icon = helper.render_icon(gtk.STOCK_DIALOG_ERROR, gtk.ICON_SIZE_DIALOG)
- n.set_icon_from_pixbuf(icon)
- n.show()
- return
-
- pastefile = urllib.unquote(filename.get_uri()[7:])
- if not pasteconf.set_content(pastefile):
- return
-
- thread = PastebinThread(settings.get_settings(), pasteconf)
- thread.start()
- while (thread.isAlive()):
- time.sleep(0.09)
- while gtk.events_pending():
- gtk.main_iteration()
-
diff -Nru nautilus-pastebin-0.4.1/setup.py nautilus-pastebin-0.5.0/setup.py
--- nautilus-pastebin-0.4.1/setup.py 2010-01-25 17:42:44.000000000 +0100
+++ nautilus-pastebin-0.5.0/setup.py 2010-06-17 15:35:17.000000000 +0200
@@ -47,8 +47,8 @@
]
pkg_scripts = [
- 'scripts/nautilus-pastebin.py',
- 'scripts/nautilus-pastebin-configurator.py'
+ 'nautilus-pastebin.py',
+ 'nautilus-pastebin-configurator.py'
]
pkg_short_dsc = "Nautilus extension to send files to a pastebin"
@@ -56,7 +56,7 @@
pkg_long_dsc = """nautilus-pastebin is a Nautilus extension written in Python, which allows users to upload text-only files to a pastebin service just by right-clicking on them. Users can also add their favorite service just by creatine new presets."""
setup(name='nautilus-pastebin',
- version='0.4.1',
+ version='0.5.0',
platforms=['all'],
author='Alessio Treglia',
author_email='quadrispro@ubuntu.com',