├── debian ├── compat ├── install ├── source │ └── format ├── links ├── mintupload.links ├── rules ├── control ├── copyright └── changelog ├── etc ├── linuxmint │ ├── mintUpload │ │ └── services │ │ │ └── README │ └── mintUpload.conf └── xdg │ └── autostart │ └── mintupload.desktop ├── test ├── usr ├── bin │ └── mintupload-manager ├── lib │ └── linuxmint │ │ └── mintupload │ │ ├── launch-file-uploader.py │ │ ├── file-uploader.py │ │ ├── mintupload.py │ │ ├── upload-manager.py │ │ └── mintupload_core.py └── share │ ├── linuxmint │ └── mintupload │ │ ├── mintupload.readme │ │ ├── sample.service │ │ ├── mintupload.ui │ │ └── manager_window.ui │ ├── icons │ └── hicolor │ │ └── scalable │ │ └── apps │ │ ├── mintupload-tray-symbolic.svg │ │ └── mintupload-tray.svg │ └── applications │ ├── mintupload.desktop │ └── kde4 │ └── mintupload.desktop ├── .gitignore ├── makepot ├── generate_desktop_files ├── mintupload.pot └── COPYING /debian/compat: -------------------------------------------------------------------------------- 1 | 9 2 | -------------------------------------------------------------------------------- /debian/install: -------------------------------------------------------------------------------- 1 | etc 2 | usr 3 | -------------------------------------------------------------------------------- /debian/source/format: -------------------------------------------------------------------------------- 1 | 3.0 (native) 2 | -------------------------------------------------------------------------------- /debian/links: -------------------------------------------------------------------------------- 1 | /usr/lib/linuxmint/mintupload/mintupload.py /usr/bin/mintupload 2 | -------------------------------------------------------------------------------- /etc/linuxmint/mintUpload/services/README: -------------------------------------------------------------------------------- 1 | Add you services in this directory. 2 | -------------------------------------------------------------------------------- /debian/mintupload.links: -------------------------------------------------------------------------------- 1 | usr/lib/linuxmint/mintupload/mintupload.py usr/bin/mintupload -------------------------------------------------------------------------------- /test: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | sudo rm -rf /usr/lib/linuxmint/mintupload 4 | sudo cp -R usr / 5 | sudo cp -R etc / 6 | mintupload-manager 7 | -------------------------------------------------------------------------------- /usr/bin/mintupload-manager: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | /usr/lib/linuxmint/mintupload/upload-manager.py & 4 | /usr/lib/linuxmint/mintupload/file-uploader.py & 5 | 6 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /debian 2 | !/debian/source 3 | !/debian/changelog 4 | !/debian/compat 5 | !/debian/control 6 | !/debian/copyright 7 | !/debian/install 8 | !/debian/links 9 | !/debian/mintupload.links 10 | !/debian/rules 11 | -------------------------------------------------------------------------------- /usr/lib/linuxmint/mintupload/launch-file-uploader.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python3 2 | 3 | import os 4 | from mintupload_core import * 5 | 6 | services = read_services() 7 | if len(services) > 0: 8 | os.system("/usr/lib/linuxmint/mintupload/file-uploader.py &") 9 | -------------------------------------------------------------------------------- /etc/xdg/autostart/mintupload.desktop: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Encoding=UTF-8 3 | Name=mintUpload 4 | Comment=Linux Mint Upload Manager 5 | Icon=mintupload 6 | Exec=/usr/lib/linuxmint/mintupload/launch-file-uploader.py 7 | Terminal=false 8 | Type=Application 9 | Categories= 10 | -------------------------------------------------------------------------------- /usr/share/linuxmint/mintupload/mintupload.readme: -------------------------------------------------------------------------------- 1 | Success: 2 | -------- 3 | 4 | This file was uploaded to test your settings. 5 | 6 | Your upload service was successfully configured. Files you upload will be placed in this directory. 7 | 8 | Feel free to delete this file. 9 | 10 | -------------------------------------------------------------------------------- /makepot: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | xgettext --language=Python --keyword=_ --output=mintupload.pot usr/lib/linuxmint/mintupload/mintupload.py usr/lib/linuxmint/mintupload/mintupload_core.py usr/lib/linuxmint/mintupload/file-uploader.py usr/lib/linuxmint/mintupload/upload-manager.py generate_desktop_files 4 | -------------------------------------------------------------------------------- /debian/rules: -------------------------------------------------------------------------------- 1 | #!/usr/bin/make -f 2 | 3 | DEB_VERSION := $(shell dpkg-parsechangelog | egrep '^Version:' | cut -f 2 -d ' ') 4 | 5 | %: 6 | dh ${@} 7 | 8 | # Inject version number in the code 9 | override_dh_installdeb: 10 | dh_installdeb 11 | for pkg in $$(dh_listpackages -i); do \ 12 | find debian/$$pkg -type f -exec sed -i -e s/__DEB_VERSION__/$(DEB_VERSION)/g {} +; \ 13 | done 14 | -------------------------------------------------------------------------------- /etc/linuxmint/mintUpload.conf: -------------------------------------------------------------------------------- 1 | [defaults] 2 | type=MINT 3 | host=hostname.com 4 | user= 5 | path= 6 | pass= 7 | format=%Y%m%d%H%M%S 8 | 9 | [paths] 10 | system=/etc/linuxmint/mintUpload/services/ 11 | user=/.linuxmint/mintUpload/services/ 12 | 13 | [filesize] 14 | factor=1000 15 | accuracy=1 16 | binary_units=False 17 | 18 | [notification] 19 | enable=True 20 | min_filesize=0 21 | when_focused=False 22 | 23 | [clipboard] 24 | autocopy=False 25 | when_unfocused=False 26 | 27 | [autoupload] 28 | autoselect=False 29 | -------------------------------------------------------------------------------- /debian/control: -------------------------------------------------------------------------------- 1 | Source: mintupload 2 | Section: admin 3 | Priority: optional 4 | Maintainer: Linux Mint 5 | Build-Depends: debhelper (>= 9) 6 | Standards-Version: 3.9.5 7 | 8 | Package: mintupload 9 | Architecture: all 10 | Depends: python3, 11 | python3-paramiko (>= 1.7.4), 12 | python3-gi, 13 | python3-pexpect, 14 | python3-configobj, 15 | libnotify-bin, 16 | gir1.2-glib-2.0, 17 | gir1.2-gtk-3.0, 18 | gir1.2-notify-0.7, 19 | gir1.2-xapp-1.0 20 | ${misc:Depends} 21 | Description: Uploads files on the Internet 22 | mintUpload allow you to upload files on the Internet. 23 | This makes it easier to share or send big files which 24 | would not fit in an email. 25 | -------------------------------------------------------------------------------- /usr/share/linuxmint/mintupload/sample.service: -------------------------------------------------------------------------------- 1 | # type: Type of upload service, one of Mint, ftp, sftp, scp 2 | # default = Mint 3 | type=ftp 4 | 5 | # host: Hostname or IP address 6 | # default = hostname.com 7 | host=hostname.com 8 | 9 | # port: Remote port to connect to 10 | # default depends on service type: 11 | # Mint/ftp is 21, otherwise 22 12 | port=21 13 | 14 | # format: Timestamp format (strftime) 15 | # default = %Y%m%d%H%M%S 16 | format=%Y%m%d%H%M%S 17 | 18 | # user: Username 19 | # defaults to the system user 20 | user=username 21 | 22 | # pass: Password 23 | # default effect depends on service type 24 | # ftp will use the null string 25 | # ssh/sftp will try private keys from ~/.ssh 26 | # scp will connect password-less 27 | pass=password 28 | 29 | # path: Directory to upload to 30 | # will be replaced with the current timestamp, as in format 31 | # default = . 32 | path=. 33 | 34 | -------------------------------------------------------------------------------- /generate_desktop_files: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python3 2 | 3 | DOMAIN = "mintupload" 4 | PATH = "/usr/share/linuxmint/locale" 5 | 6 | import os 7 | import gettext 8 | from mintcommon import additionalfiles 9 | 10 | os.environ['LANGUAGE'] = "en_US.UTF-8" 11 | gettext.install(DOMAIN, PATH) 12 | 13 | prefix = "[Desktop Entry]\n" 14 | 15 | suffix = """Exec=mintupload-manager 16 | Icon=mintupload 17 | Terminal=false 18 | Type=Application 19 | Encoding=UTF-8 20 | Categories=Application;System;Settings 21 | StartupNotify=false 22 | NotShowIn=KDE; 23 | """ 24 | 25 | additionalfiles.generate(DOMAIN, PATH, "usr/share/applications/mintupload.desktop", prefix, _("Upload Manager"), _("Define upload services"), suffix) 26 | 27 | prefix = "[Desktop Entry]\n" 28 | 29 | suffix = """Exec=mintupload-manager 30 | Icon=mintupload 31 | Terminal=false 32 | Type=Application 33 | Encoding=UTF-8 34 | Categories=Qt;KDE;Settings; 35 | X-KDE-StartupNotify=false 36 | OnlyShowIn=KDE; 37 | """ 38 | 39 | additionalfiles.generate(DOMAIN, PATH, "usr/share/applications/kde4/mintupload.desktop", prefix, _("Upload Manager"), _("Define upload services"), suffix, genericName=_("Define upload services")) 40 | -------------------------------------------------------------------------------- /debian/copyright: -------------------------------------------------------------------------------- 1 | Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ 2 | Upstream-Name: mintupload 3 | Upstream-Contact: Clement Lefebvre 4 | Source: https://github.com/linuxmint/mintupload 5 | 6 | Files: * 7 | Copyright: 2007-2014 The mintUpload team (pem34-mintupload@srcf.ucam.org) 8 | 2007-2014 Clement Lefebvre (root@linuxmint.com) 9 | 2007-2014 Philip Morrell (mintupload.emorrp1@mamber.net) 10 | 2007-2014 Manuel Sandoval (manuel@slashvar.com) 11 | 2007-2014 Dennis Schwertal (s@digitalkultur.net) 12 | License: GPL-3+ 13 | This program is free software: you can redistribute it and/or modify 14 | it under the terms of the GNU General Public License as published by 15 | the Free Software Foundation, either version 3 of the License, or (at 16 | your option) any later version. 17 | . 18 | This program is distributed in the hope that it will be useful, but 19 | WITHOUT ANY WARRANTY; without even the implied warranty of 20 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 21 | General Public License for more details. 22 | . 23 | You should have received a copy of the GNU General Public License 24 | along with this program. If not, see . 25 | . 26 | On Debian systems, the complete text of the GNU General 27 | Public License version 3 can be found in "/usr/share/common-licenses/GPL-3". 28 | -------------------------------------------------------------------------------- /usr/share/icons/hicolor/scalable/apps/mintupload-tray-symbolic.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 18 | 20 | 40 | 43 | 48 | 58 | 68 | 78 | 79 | 80 | -------------------------------------------------------------------------------- /usr/lib/linuxmint/mintupload/file-uploader.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python3 2 | 3 | import os 4 | import sys 5 | import gettext 6 | import time 7 | import threading 8 | import urllib.request, urllib.parse, urllib.error 9 | import shlex 10 | 11 | import gi 12 | gi.require_version("Gtk", "3.0") 13 | gi.require_version("XApp", "1.0") 14 | from gi.repository import Gtk, Gdk, GLib, XApp 15 | from mintupload_core import * 16 | 17 | # i18n 18 | gettext.install("mintupload", "/usr/share/linuxmint/locale") 19 | 20 | # Name of the icon used by the indicator 21 | SYSTRAY_ICON = "mintupload-tray-symbolic" 22 | 23 | class MainClass: 24 | 25 | def __init__(self): 26 | self.drop_zones = {} 27 | self.services = None 28 | 29 | self.build_services_menu() 30 | # Refresh list of services in the menu every 2 seconds 31 | GLib.timeout_add_seconds(2, self.reload_services) 32 | 33 | self.status_icon = XApp.StatusIcon() 34 | self.status_icon.set_name("mintupload") 35 | self.status_icon.set_icon_name(SYSTRAY_ICON) 36 | self.status_icon.set_tooltip_text(_("Upload services")) 37 | self.status_icon.set_primary_menu(self.menu) 38 | self.status_icon.set_secondary_menu(self.menu) 39 | 40 | def reload_services(self): 41 | has_changed = read_services() != self.services 42 | 43 | if has_changed and not self.menu.is_visible(): 44 | self.build_services_menu() 45 | 46 | return True 47 | 48 | def build_services_menu(self): 49 | self.services = read_services() 50 | self.menu = Gtk.Menu() 51 | services_menuitem = Gtk.MenuItem() 52 | title = Gtk.Label() 53 | title.set_text("" + _("Services:") + "") 54 | title.set_xalign(0) 55 | title.set_use_markup(True) 56 | services_menuitem.add(title) 57 | services_menuitem.set_sensitive(False) 58 | self.menu.append(services_menuitem) 59 | 60 | for service in self.services: 61 | service_menuitem = Gtk.MenuItem(label=" " + service['name']) 62 | service_menuitem.connect("activate", self.create_drop_zone, service) 63 | self.menu.append(service_menuitem) 64 | 65 | self.menu.append(Gtk.SeparatorMenuItem()) 66 | 67 | upload_manager_menuitem = Gtk.MenuItem(label=_("Upload manager...")) 68 | upload_manager_menuitem.connect('activate', self.launch_manager) 69 | self.menu.append(upload_manager_menuitem) 70 | 71 | self.menu.append(Gtk.SeparatorMenuItem()) 72 | 73 | menu_item = Gtk.MenuItem(label=_("Quit")) 74 | menu_item.connect('activate', self.quit_cb) 75 | self.menu.append(menu_item) 76 | self.menu.show_all() 77 | 78 | def launch_manager(self, widget): 79 | os.system("/usr/lib/linuxmint/mintupload/upload-manager.py &") 80 | 81 | def create_drop_zone(self, widget, service): 82 | if service['name'] not in list(self.drop_zones.keys()): 83 | drop_zone = DropZone(service, self.drop_zones) 84 | self.drop_zones[service['name']] = drop_zone 85 | else: 86 | self.drop_zones[service['name']].show() 87 | 88 | def quit_cb(self, widget): 89 | Gtk.main_quit() 90 | sys.exit(0) 91 | 92 | class DropZone: 93 | 94 | DROPZONE_CSS = b''' 95 | .dropzone { 96 | border-width: 3px; 97 | border-style: dashed; 98 | border-radius: 1em; 99 | } 100 | .dropzone:drop(active) { 101 | border-style: solid; 102 | } 103 | ''' 104 | 105 | def __init__(self, service, drop_zones): 106 | self.service = service 107 | self.drop_zones = drop_zones 108 | self.w = Gtk.Window() 109 | 110 | TARGET_TYPE_TEXT = 80 111 | 112 | self.w.set_icon_name(SYSTRAY_ICON) 113 | self.w.set_title(self.service['name']) 114 | self.w.set_keep_above(True) 115 | self.w.set_skip_pager_hint(True) 116 | self.w.set_skip_taskbar_hint(True) 117 | self.w.stick() 118 | 119 | self.label = Gtk.Label(margin=10) 120 | self.label.set_text(_("Drag & Drop here to upload to %s") % self.service['name']) 121 | self.label.set_line_wrap(True) 122 | self.label.set_use_markup(True) 123 | self.label.set_width_chars(20) 124 | 125 | # add dashed border around label 126 | css_provider = Gtk.CssProvider() 127 | css_provider.load_from_data(self.DROPZONE_CSS) 128 | self.box = Gtk.Box(margin=10) 129 | style_ctx = self.box.get_style_context() 130 | style_ctx.add_class("dropzone") 131 | style_ctx.add_provider(css_provider, Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION) 132 | 133 | self.box.drag_dest_set( 134 | Gtk.DestDefaults.ALL, 135 | [Gtk.TargetEntry.new("text/uri-list", 0, TARGET_TYPE_TEXT)], 136 | Gdk.DragAction.MOVE | Gdk.DragAction.COPY 137 | ) 138 | 139 | self.box.connect('drag-drop', self.drop_cb) 140 | self.box.connect('drag-data-received', self.drop_data_received_cb) 141 | self.box.connect('destroy', self.destroy_cb) 142 | 143 | self.box.set_center_widget(self.label) 144 | self.w.add(self.box) 145 | 146 | self.w.set_default_size(300, 100) 147 | self.w.show_all() 148 | 149 | if Gdk.Screen.get_default().is_composited(): 150 | self.w.set_opacity(0.7) 151 | 152 | def show(self): 153 | self.w.show_all() 154 | self.w.present() 155 | 156 | def drop_cb(self, wid, context, x, y, time): 157 | context.finish(True, False, time) 158 | return True 159 | 160 | def drop_data_received_cb(self, widget, context, x, y, selection, targetType, time): 161 | data = selection.get_data().decode() 162 | filenames = [] 163 | files = data.split('\n') 164 | 165 | for f in files: 166 | if not f: 167 | continue 168 | f = urllib.request.url2pathname(f) 169 | f = f.strip('\r') 170 | f = f.replace("file://", "") 171 | f = f.replace("'", r"'\''") 172 | f = "'" + f + "'" 173 | filenames.append(f) 174 | filenames_ = " ".join(filenames) 175 | os.system(f"mintupload {shlex.quote(self.service['name'])} {filenames_} &") 176 | 177 | def destroy_cb(self, wid): 178 | del self.drop_zones[self.service['name']] 179 | 180 | MainClass() 181 | Gtk.main() 182 | -------------------------------------------------------------------------------- /usr/share/applications/mintupload.desktop: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Name=Upload Manager 3 | Name[af]=Oplaai Bestuurder 4 | Name[am]=የመጫኛ አስተዳዳሪ 5 | Name[ar]=مدير التحميل 6 | Name[ast]=Alministrador de xubes 7 | Name[az]=Yükləmə Yönətməni 8 | Name[be]=Кіраўнік зацягванняў 9 | Name[bg]=Управление на качванията 10 | Name[bn]=আপলোড ম্যানেজার 11 | Name[bs]=Upravljanje dodavanjima 12 | Name[ca]=Gestor de pujades 13 | Name[ca@valencia]=Administrador de pujades 14 | Name[cs]=Správa odesílání (upload) 15 | Name[csb]=Menadżera sélaniô 16 | Name[cy]=Rheolwr Llwytho i Fyny 17 | Name[da]=Overførselshåndtering 18 | Name[de]=Hochladeverwaltung 19 | Name[el]=Διαχειριστής Αποστολής Αρχείων 20 | Name[eo]=Alŝutmastrumilo 21 | Name[es]=Gestor de subidas 22 | Name[et]=Üleslaadimishaldur 23 | Name[eu]=Karga-kudeatzailea 24 | Name[fa]=مدیر ارسال 25 | Name[fi]=Lähetystenhallinta 26 | Name[fo]=Uppsendinga Leiðari 27 | Name[fr]=Gestionnaire de téléversement 28 | Name[fr_CA]=Gestionnaire de téléversement 29 | Name[frp]=Trablèta de chargement amont 30 | Name[ga]=Bainisteoir uasluchtaithe 31 | Name[gd]=Manaidsear nan luchdaidhean suas 32 | Name[gl]=Xestor de envíos 33 | Name[gv]=Reireyder laadey heose 34 | Name[he]=מנהל העלאות 35 | Name[hi]=अपलोड प्रबंधक 36 | Name[hr]=Upravitelj slanja datoteka 37 | Name[hu]=Feltöltéskezelő 38 | Name[ia]=Gestor de cargamento 39 | Name[id]=Manajer upload 40 | Name[is]=Sendingastjóri 41 | Name[ja]=アップロードマネージャ 42 | Name[jv]=Penglola upload 43 | Name[ka]=ატვირთვის მენეჯერი 44 | Name[kab]=Amsefrak n usali 45 | Name[kk]=Құю менеджері 46 | Name[km]=កម្មវិធីគ្រប់គ្រងការផ្ទុកឡើង 47 | Name[ko]=업로드 매니저 48 | Name[ku]=Rêvebirê Barkirinê 49 | Name[lo]=ການຈັດການ ອັບໂຫລດ 50 | Name[lt]=Įkėlimo tvarkytuvė 51 | Name[lv]=Augšupielāžu pārvaldnieks 52 | Name[mk]=Менаџер за поставување датотеки 53 | Name[ml]=അപ്‌ലോഡ്‌ മാനേജര്‍ 54 | Name[mr]=अपलोड प्रबंधक 55 | Name[ms]=Pengurus Muatnaik 56 | Name[nb]=Opplastingsveiviser 57 | Name[nds]=Uploadmanager 58 | Name[ne]=अप्लोड म्यानेजर 59 | Name[nl]=Uploadbeheer 60 | Name[nn]=Opplastingsrettleiar 61 | Name[oc]=Gestionari de mandadisses 62 | Name[pa]=ਅੱਪਲੋਡ ਮੈਨੇਜਰ 63 | Name[pap]=Atministrado di upload 64 | Name[pl]=Menedżer wysyłania 65 | Name[pt]=Gestor de envios 66 | Name[pt_BR]=Gerenciador de Envio de Arquivos 67 | Name[ro]=Administrator încărcare 68 | Name[ru]=Менеджер загрузчика файлов 69 | Name[si]=ලිපිගොනු යැවීම කලමනාකරනය 70 | Name[sk]=Správca Prenosu Súborov 71 | Name[sl]=Upravljalnik pošiljanja 72 | Name[so]=Agaasimaha daabulidda 73 | Name[sq]=Menaxhuesi i Ngarkimeve 74 | Name[sr]=Управник отпремања 75 | Name[sr@latin]=Menadžer otpremanja 76 | Name[sv]=Uppladdningshanterare 77 | Name[ta]=பதிவேற்ற நிர்வாகி 78 | Name[te]=ఎక్కింపు నిర్వాహకం 79 | Name[tg]=Мудири боркунӣ 80 | Name[th]=โปรแกรมจัดการการอัปโหลด 81 | Name[tr]=Yükleme Yöneticisi 82 | Name[uk]=Менеджер завантажень 83 | Name[ur]=اپلوڈ منتظم 84 | Name[uz]=Файлларни юбориш менежери 85 | Name[vi]=Trình Quản lý Tải lên 86 | Name[zh_CN]=上传管理器 87 | Name[zh_HK]=上傳管理員 88 | Name[zh_TW]=上傳管理員 89 | Comment=Define upload services 90 | Comment[af]=Definieer oplaai dienste 91 | Comment[am]=መግለጽ የመጫኛ አገልግሎቶች 92 | Comment[ar]=تعريف خدمات التحميل 93 | Comment[ast]=Definir serviciu de xubida 94 | Comment[az]=Yükləmə qulluqlarını tanımlayın 95 | Comment[be]=Вызначыць службы зацягванняў 96 | Comment[bg]=Задаване на сървъри 97 | Comment[bn]=আপলোড সেবাসমূহের বর্ণনা দিন 98 | Comment[bs]=Definiranje servisa za dodavanje 99 | Comment[ca]=Definiu els serveis de pujada 100 | Comment[ca@valencia]=Definix servicis de pujada 101 | Comment[cs]=Definovat odesílací služby 102 | Comment[csb]=Definiujë ùsłëżnotë sélaniô 103 | Comment[cy]=Dififnio gwasanaethau llwytho 104 | Comment[da]=Sæt overførselstjenester op 105 | Comment[de]=Bestimme Dienste zum Hochladen 106 | Comment[el]=Καθορίστε τις υπηρεσίες αποστολής 107 | Comment[eo]=Difini alŝutservojn 108 | Comment[es]=Defina los servicios de subida 109 | Comment[et]=Määra üleslaadimisteenused 110 | Comment[eu]=Zehaztu karga-zerbitzuak 111 | Comment[fa]=سرویسهای ارسال را مشخص کن 112 | Comment[fi]=Määritä lähetyspalvelut 113 | Comment[fil]=I-define ang serbisyo sa pag-upload 114 | Comment[fo]=Skilmarka uppsendinga tænastur 115 | Comment[fr]=Définir les services de téléversement 116 | Comment[fr_CA]=Définir les services de téléversement 117 | Comment[frp]=Dèfinissâds los sèrviços de charrèyâjo amont de fichiérs 118 | Comment[ga]=Sainmhínígh seirbhísí uasluchtaithe 119 | Comment[gd]=Sònraich seirbheisean luchdaidh suas 120 | Comment[gl]=Definir servizos de envío 121 | Comment[gv]=Reih yn shirveeish laadey heose 122 | Comment[he]=הגדרת שירותי העלאה 123 | Comment[hi]=अपलोड सेवाएँ परिभाषित करें 124 | Comment[hr]=Odredite uslugu slanja 125 | Comment[hu]=Feltöltőszolgáltatások megadása 126 | Comment[ia]=Definir le servicios de cargamento 127 | Comment[id]=Definisikan layanan unggah 128 | Comment[is]=Skilgreindu sendingaþjónustur 129 | Comment[it]=Definisci i servizi di upload 130 | Comment[ja]=アップロードサービスを定義します 131 | Comment[jv]=Definisi nglayani ngunggahake 132 | Comment[kab]=Sbadu imeẓla n usali 133 | Comment[kk]=Файл құю қызметтерін белгілеу 134 | Comment[km]=កំណត់សេវាកម្មផ្ទុកឡើង 135 | Comment[ko]=업로드 서비스 추가 136 | Comment[lt]=Nustatyti įkėlimo paslaugas 137 | Comment[lv]=Kontrolē augšupielāžu pakalpojumus 138 | Comment[mk]=Дефинирај сервис за поставување 139 | Comment[ml]=അപ്‌ലോഡ്‌ സെര്‍വിസുകളെ നിര്‍വചിക്കുക 140 | Comment[mr]=उपलोड सेवा निर्धारित करा 141 | Comment[ms]=Tentukan servis muatnaik 142 | Comment[nb]=Definer opplastingstjenester 143 | Comment[nds]=Bestimme Dienste zum Hochladen 144 | Comment[ne]=अप्लोअद सेरिभाइसहरु निर्धारण गर्नुहोस्। 145 | Comment[nl]=Uploaddiensten benoemen 146 | Comment[nn]=Definer opplastingstenester 147 | Comment[oc]=Definissètz los servicis de mandadís de fichièrs 148 | Comment[pap]=Definí e servisionan pa upload 149 | Comment[pl]=Określ usługi wysyłania 150 | Comment[pt]=Definir serviço de envios 151 | Comment[pt_BR]=Definir serviços de envio 152 | Comment[ro]=Definiți serviciile de încărcare 153 | Comment[ru]=Назначить службы загрузки 154 | Comment[si]=ඉහලට යැවීමේ සේවා අතුලත් කරන්න 155 | Comment[sk]=Definovať služby prenosu 156 | Comment[sl]=Določi storitve pošiljanja 157 | Comment[so]=Qeex khidmadaha daabulidda 158 | Comment[sq]=Përkufizo shërbimet e ngarkimit 159 | Comment[sr]=Одредите услуге отпремања 160 | Comment[sr@latin]=Odredite servise za otpremanje 161 | Comment[sv]=Definera uppladdningstjänster 162 | Comment[ta]=பதிவேற்ற சேவைகளை வரையறுக்க 163 | Comment[te]=ఎక్కింపు సేవలను నిర్వచించు 164 | Comment[tg]=Интихоби хидмати боркунӣ 165 | Comment[th]=กำหนดบริการอัปโหลด 166 | Comment[tl]=I-define ang serbisyo sa pag-upload 167 | Comment[tr]=Yükleme hizmetlerini tanımlayın 168 | Comment[uk]=Визначити служби завантаження 169 | Comment[uz]=Юбориш учун хизматларни аниқланг 170 | Comment[vi]=Chỉ định dịch vụ tải lên 171 | Comment[zh_CN]=定义上传服务 172 | Comment[zh_HK]=定義上傳服務 173 | Comment[zh_TW]=定義上傳服務 174 | Exec=mintupload-manager 175 | Icon=mintupload 176 | Terminal=false 177 | Type=Application 178 | Encoding=UTF-8 179 | Categories=Application;System;Settings 180 | StartupNotify=false 181 | NotShowIn=KDE; 182 | -------------------------------------------------------------------------------- /usr/share/linuxmint/mintupload/mintupload.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | False 7 | False 8 | True 9 | center 10 | True 11 | 12 | 13 | True 14 | False 15 | 10 16 | 6 17 | vertical 18 | 19 | 20 | True 21 | False 22 | 6 23 | horizontal 24 | 25 | 26 | True 27 | False 28 | gtk-dialog-question 29 | 6 30 | 31 | 32 | False 33 | True 34 | 0 35 | 36 | 37 | 38 | 39 | True 40 | False 41 | 0 42 | Do you want to cancel this upload? 43 | 44 | 45 | True 46 | True 47 | 1 48 | 49 | 50 | 51 | 52 | False 53 | True 54 | 0 55 | 56 | 57 | 58 | 59 | True 60 | False 61 | spread 62 | horizontal 63 | 64 | 65 | button 66 | True 67 | True 68 | True 69 | 70 | 71 | False 72 | False 73 | 0 74 | 75 | 76 | 77 | 78 | button 79 | True 80 | True 81 | True 82 | 83 | 84 | False 85 | False 86 | 1 87 | 88 | 89 | 90 | 91 | False 92 | True 93 | 1 94 | 95 | 96 | 97 | 98 | 99 | 100 | True 101 | False 102 | file_uploader 103 | center 104 | 100 105 | 20 106 | dialog 107 | False 108 | 109 | 110 | True 111 | False 112 | 10 113 | 6 114 | vertical 115 | 116 | 117 | True 118 | False 119 | 0 120 | 0 121 | 122 | 123 | False 124 | True 125 | 0 126 | 127 | 128 | 129 | 130 | True 131 | False 132 | 3 133 | horizontal 134 | 135 | 136 | True 137 | False 138 | 139 | 140 | True 141 | True 142 | 0 143 | 144 | 145 | 146 | 147 | True 148 | True 149 | True 150 | 151 | 152 | True 153 | False 154 | gtk-cancel 155 | 156 | 157 | 158 | 159 | False 160 | False 161 | 1 162 | 163 | 164 | 165 | 166 | False 167 | True 168 | 1 169 | 170 | 171 | 172 | 173 | True 174 | False 175 | 0 176 | 0 177 | 178 | 179 | False 180 | True 181 | 2 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | FTP 195 | 196 | 197 | SFTP 198 | 199 | 200 | SCP 201 | 202 | 203 | 204 | 205 | -------------------------------------------------------------------------------- /mintupload.pot: -------------------------------------------------------------------------------- 1 | # SOME DESCRIPTIVE TITLE. 2 | # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER 3 | # This file is distributed under the same license as the PACKAGE package. 4 | # FIRST AUTHOR , YEAR. 5 | # 6 | #, fuzzy 7 | msgid "" 8 | msgstr "" 9 | "Project-Id-Version: PACKAGE VERSION\n" 10 | "Report-Msgid-Bugs-To: \n" 11 | "POT-Creation-Date: 2018-05-07 12:31+0100\n" 12 | "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 13 | "Last-Translator: FULL NAME \n" 14 | "Language-Team: LANGUAGE \n" 15 | "Language: \n" 16 | "MIME-Version: 1.0\n" 17 | "Content-Type: text/plain; charset=CHARSET\n" 18 | "Content-Transfer-Encoding: 8bit\n" 19 | "Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n" 20 | 21 | #: usr/lib/linuxmint/mintupload/mintupload.py:28 22 | #: usr/lib/linuxmint/mintupload/upload-manager.py:28 23 | #: usr/lib/linuxmint/mintupload/upload-manager.py:82 24 | #: usr/lib/linuxmint/mintupload/upload-manager.py:117 generate_desktop_files:27 25 | #: generate_desktop_files:41 26 | msgid "Upload Manager" 27 | msgstr "" 28 | 29 | #: usr/lib/linuxmint/mintupload/mintupload.py:43 30 | #: usr/lib/linuxmint/mintupload/mintupload.py:138 31 | #, python-format 32 | msgid "%(percentage)s of %(number)d files - Uploading to %(service)s" 33 | msgstr "" 34 | 35 | #: usr/lib/linuxmint/mintupload/mintupload.py:45 36 | #: usr/lib/linuxmint/mintupload/mintupload.py:141 37 | #, python-format 38 | msgid "%(percentage)s of 1 file - Uploading to %(service)s" 39 | msgstr "" 40 | 41 | #: usr/lib/linuxmint/mintupload/mintupload.py:81 42 | #, python-format 43 | msgid "The upload to '%(service)s' was cancelled" 44 | msgstr "" 45 | 46 | #: usr/lib/linuxmint/mintupload/mintupload.py:93 47 | #, python-format 48 | msgid "Upload to '%s' failed: " 49 | msgstr "" 50 | 51 | #: usr/lib/linuxmint/mintupload/mintupload.py:99 52 | #, python-format 53 | msgid "Successfully uploaded %(number)d files to '%(service)s'" 54 | msgstr "" 55 | 56 | #: usr/lib/linuxmint/mintupload/mintupload.py:101 57 | #, python-format 58 | msgid "Successfully uploaded 1 file to '%(service)s'" 59 | msgstr "" 60 | 61 | #: usr/lib/linuxmint/mintupload/mintupload.py:112 62 | msgid "Do you want to cancel this upload?" 63 | msgstr "" 64 | 65 | #: usr/lib/linuxmint/mintupload/mintupload.py:113 66 | msgid "Cancel" 67 | msgstr "" 68 | 69 | #: usr/lib/linuxmint/mintupload/mintupload.py:114 70 | msgid "Run in the background" 71 | msgstr "" 72 | 73 | #: usr/lib/linuxmint/mintupload/mintupload.py:117 74 | msgid "Cancel upload?" 75 | msgstr "" 76 | 77 | #: usr/lib/linuxmint/mintupload/mintupload.py:137 78 | #, python-format 79 | msgid "Uploading %(number)d files to %(service)s" 80 | msgstr "" 81 | 82 | #: usr/lib/linuxmint/mintupload/mintupload.py:140 83 | #, python-format 84 | msgid "Uploading 1 file to %(service)s" 85 | msgstr "" 86 | 87 | #: usr/lib/linuxmint/mintupload/mintupload.py:159 88 | #, python-format 89 | msgid "" 90 | "%(size_so_far)s of %(total_size)s - %(time_remaining)s left (%(speed)s/sec)" 91 | msgstr "" 92 | 93 | #: usr/lib/linuxmint/mintupload/mintupload.py:161 94 | #, python-format 95 | msgid "%(size_so_far)s of %(total_size)s" 96 | msgstr "" 97 | 98 | #: usr/lib/linuxmint/mintupload/mintupload.py:188 99 | #: usr/lib/linuxmint/mintupload/mintupload_core.py:93 100 | #: usr/lib/linuxmint/mintupload/mintupload_core.py:95 101 | msgid "B" 102 | msgstr "" 103 | 104 | #: usr/lib/linuxmint/mintupload/mintupload.py:190 105 | #: usr/lib/linuxmint/mintupload/mintupload_core.py:95 106 | msgid "KB" 107 | msgstr "" 108 | 109 | #: usr/lib/linuxmint/mintupload/mintupload.py:192 110 | #: usr/lib/linuxmint/mintupload/mintupload_core.py:95 111 | msgid "MB" 112 | msgstr "" 113 | 114 | #: usr/lib/linuxmint/mintupload/mintupload.py:194 115 | #: usr/lib/linuxmint/mintupload/mintupload_core.py:95 116 | msgid "GB" 117 | msgstr "" 118 | 119 | #: usr/lib/linuxmint/mintupload/mintupload.py:201 120 | #, python-format 121 | msgid "%d hour" 122 | msgid_plural "%d hours" 123 | msgstr[0] "" 124 | msgstr[1] "" 125 | 126 | #: usr/lib/linuxmint/mintupload/mintupload.py:202 127 | #: usr/lib/linuxmint/mintupload/mintupload.py:204 128 | #, python-format 129 | msgid "%d minute" 130 | msgid_plural "%d minutes" 131 | msgstr[0] "" 132 | msgstr[1] "" 133 | 134 | #: usr/lib/linuxmint/mintupload/mintupload.py:205 135 | #: usr/lib/linuxmint/mintupload/mintupload.py:207 136 | #, python-format 137 | msgid "%d second" 138 | msgid_plural "%d seconds" 139 | msgstr[0] "" 140 | msgstr[1] "" 141 | 142 | #: usr/lib/linuxmint/mintupload/mintupload.py:236 143 | #, python-format 144 | msgid "Unknown service: %s" 145 | msgstr "" 146 | 147 | #: usr/lib/linuxmint/mintupload/mintupload_core.py:93 148 | msgid "KiB" 149 | msgstr "" 150 | 151 | #: usr/lib/linuxmint/mintupload/mintupload_core.py:93 152 | msgid "MiB" 153 | msgstr "" 154 | 155 | #: usr/lib/linuxmint/mintupload/mintupload_core.py:93 156 | msgid "GiB" 157 | msgstr "" 158 | 159 | #: usr/lib/linuxmint/mintupload/mintupload_core.py:135 160 | msgid "File larger than service's maximum" 161 | msgstr "" 162 | 163 | #: usr/lib/linuxmint/mintupload/mintupload_core.py:145 164 | msgid "Could not get available space" 165 | msgstr "" 166 | 167 | #: usr/lib/linuxmint/mintupload/mintupload_core.py:148 168 | msgid "File larger than service's available space" 169 | msgstr "" 170 | 171 | #: usr/lib/linuxmint/mintupload/mintupload_core.py:173 172 | #: usr/lib/linuxmint/mintupload/mintupload_core.py:315 173 | msgid "File uploaded successfully." 174 | msgstr "" 175 | 176 | #: usr/lib/linuxmint/mintupload/mintupload_core.py:191 177 | #: usr/lib/linuxmint/mintupload/mintupload_core.py:267 178 | msgid "connection successfully established" 179 | msgstr "" 180 | 181 | #: usr/lib/linuxmint/mintupload/mintupload_core.py:202 182 | #: usr/lib/linuxmint/mintupload/mintupload_core.py:233 183 | msgid "Uploading the file..." 184 | msgstr "" 185 | 186 | #: usr/lib/linuxmint/mintupload/mintupload_core.py:275 187 | msgid "This service requires a password." 188 | msgstr "" 189 | 190 | #: usr/lib/linuxmint/mintupload/mintupload_core.py:308 191 | msgid "URL:" 192 | msgstr "" 193 | 194 | #: usr/lib/linuxmint/mintupload/mintupload_core.py:348 195 | #: usr/lib/linuxmint/mintupload/mintupload_core.py:352 196 | #, python-format 197 | msgid "%(1)s is not set in the config file found under %(2)s or %(3)s" 198 | msgstr "" 199 | 200 | #: usr/lib/linuxmint/mintupload/file-uploader.py:27 201 | #: usr/lib/linuxmint/mintupload/file-uploader.py:30 202 | #: usr/lib/linuxmint/mintupload/upload-manager.py:35 203 | msgid "Upload services" 204 | msgstr "" 205 | 206 | #: usr/lib/linuxmint/mintupload/file-uploader.py:50 207 | msgid "Services:" 208 | msgstr "" 209 | 210 | #: usr/lib/linuxmint/mintupload/file-uploader.py:64 211 | msgid "Upload manager..." 212 | msgstr "" 213 | 214 | #: usr/lib/linuxmint/mintupload/file-uploader.py:73 215 | msgid "Quit" 216 | msgstr "" 217 | 218 | #: usr/lib/linuxmint/mintupload/file-uploader.py:126 219 | #, python-format 220 | msgid "Drag & Drop here to upload to %s" 221 | msgstr "" 222 | 223 | #: usr/lib/linuxmint/mintupload/upload-manager.py:53 224 | msgid "_File" 225 | msgstr "" 226 | 227 | #: usr/lib/linuxmint/mintupload/upload-manager.py:58 228 | msgid "Close" 229 | msgstr "" 230 | 231 | #: usr/lib/linuxmint/mintupload/upload-manager.py:62 232 | msgid "_Help" 233 | msgstr "" 234 | 235 | #: usr/lib/linuxmint/mintupload/upload-manager.py:67 236 | #: usr/lib/linuxmint/mintupload/upload-manager.py:78 237 | msgid "About" 238 | msgstr "" 239 | 240 | #: usr/lib/linuxmint/mintupload/upload-manager.py:120 241 | msgid "Please enter a name for the new upload service:" 242 | msgstr "" 243 | 244 | #: usr/lib/linuxmint/mintupload/upload-manager.py:124 245 | msgid "Service name:" 246 | msgstr "" 247 | 248 | #: usr/lib/linuxmint/mintupload/upload-manager.py:127 249 | msgid "Try to avoid spaces and special characters..." 250 | msgstr "" 251 | 252 | #: usr/lib/linuxmint/mintupload/upload-manager.py:204 253 | #, python-format 254 | msgid "%s Properties" 255 | msgstr "" 256 | 257 | #: usr/lib/linuxmint/mintupload/upload-manager.py:207 258 | msgid "Check connection" 259 | msgstr "" 260 | 261 | #: usr/lib/linuxmint/mintupload/upload-manager.py:212 262 | msgid "Type:" 263 | msgstr "" 264 | 265 | #: usr/lib/linuxmint/mintupload/upload-manager.py:213 266 | msgid "Host:" 267 | msgstr "" 268 | 269 | #: usr/lib/linuxmint/mintupload/upload-manager.py:214 270 | msgid "Port:" 271 | msgstr "" 272 | 273 | #: usr/lib/linuxmint/mintupload/upload-manager.py:215 274 | msgid "User:" 275 | msgstr "" 276 | 277 | #: usr/lib/linuxmint/mintupload/upload-manager.py:216 278 | msgid "Password:" 279 | msgstr "" 280 | 281 | #: usr/lib/linuxmint/mintupload/upload-manager.py:217 282 | msgid "Timestamp:" 283 | msgstr "" 284 | 285 | #: usr/lib/linuxmint/mintupload/upload-manager.py:218 286 | msgid "Path:" 287 | msgstr "" 288 | 289 | #: usr/lib/linuxmint/mintupload/upload-manager.py:220 290 | #: usr/lib/linuxmint/mintupload/upload-manager.py:221 291 | msgid "Hostname or IP address, default: " 292 | msgstr "" 293 | 294 | #: usr/lib/linuxmint/mintupload/upload-manager.py:224 295 | #: usr/lib/linuxmint/mintupload/upload-manager.py:225 296 | msgid "Remote port, default is 21 for FTP, 22 for SFTP and SCP" 297 | msgstr "" 298 | 299 | #: usr/lib/linuxmint/mintupload/upload-manager.py:228 300 | #: usr/lib/linuxmint/mintupload/upload-manager.py:229 301 | msgid "Username, defaults to your local username" 302 | msgstr "" 303 | 304 | #: usr/lib/linuxmint/mintupload/upload-manager.py:232 305 | #: usr/lib/linuxmint/mintupload/upload-manager.py:233 306 | msgid "" 307 | "Password, by default: password-less SCP connection, null-string FTP " 308 | "connection, ~/.ssh keys used for SFTP connections" 309 | msgstr "" 310 | 311 | #: usr/lib/linuxmint/mintupload/upload-manager.py:236 312 | #: usr/lib/linuxmint/mintupload/upload-manager.py:237 313 | msgid "Timestamp format (strftime). By default:" 314 | msgstr "" 315 | 316 | #: usr/lib/linuxmint/mintupload/upload-manager.py:240 317 | #: usr/lib/linuxmint/mintupload/upload-manager.py:241 318 | msgid "" 319 | "Directory to upload to. is replaced with the current timestamp, " 320 | "following the timestamp format given. By default: ." 321 | msgstr "" 322 | 323 | #: usr/lib/linuxmint/mintupload/upload-manager.py:314 324 | msgid "Could not save configuration change" 325 | msgstr "" 326 | 327 | #: generate_desktop_files:27 generate_desktop_files:41 328 | msgid "Define upload services" 329 | msgstr "" 330 | -------------------------------------------------------------------------------- /usr/lib/linuxmint/mintupload/mintupload.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python3 2 | 3 | import sys 4 | import os 5 | import time 6 | import traceback 7 | import gettext 8 | import shlex 9 | 10 | try: 11 | import gi 12 | gi.require_version("Gtk", "3.0") 13 | gi.require_version('XApp', '1.0') 14 | from gi.repository import Gtk, Gdk, XApp 15 | except: 16 | print("You do not have all the dependencies!") 17 | sys.exit(1) 18 | 19 | from mintupload_core import * 20 | 21 | Gdk.threads_init() 22 | __version__ = VERSION 23 | # i18n 24 | gettext.install("mintupload", "/usr/share/linuxmint/locale") 25 | 26 | # Location of the UI file 27 | UI_FILE = "/usr/share/linuxmint/mintupload/mintupload.ui" 28 | 29 | 30 | def notify(message, timeout=3000): 31 | os.system("notify-send \"" + _("Upload Manager") + "\" \"" + message + "\" -t " + str(timeout)) 32 | 33 | 34 | class GtkUploader(MintUploader): 35 | 36 | '''Wrapper for the gtk management of MintUploader''' 37 | 38 | def __init__(self, service, files): 39 | MintUploader.__init__(self, service, files) 40 | Gdk.threads_enter() 41 | try: 42 | self.builder = Gtk.Builder() 43 | self.builder.add_from_file(UI_FILE) 44 | self.window = self.builder.get_object("main_window") 45 | 46 | if len(filenames) > 1: 47 | title = _("%(percentage)s of %(number)d files - Uploading to %(service)s") % {'percentage': '0%', 'number': len(filenames), 'service': "\"" + service['name'] + "\""} 48 | else: 49 | title = _("%(percentage)s of 1 file - Uploading to %(service)s") % {'percentage': '0%', 'service': "\"" + service['name'] + "\""} 50 | 51 | self.window.set_title(title) 52 | self.window.set_icon_name(ICON) 53 | 54 | self.progressbar = self.builder.get_object("progressbar") 55 | 56 | self.window.connect("destroy", self.close_window) 57 | self.window.connect("delete_event", self.close_window) 58 | self.builder.get_object("cancel_button").connect("clicked", self.cancel) 59 | finally: 60 | Gdk.threads_leave() 61 | 62 | def run(self): 63 | 64 | Gdk.threads_enter() 65 | try: 66 | self.progressbar.show() 67 | finally: 68 | Gdk.threads_leave() 69 | 70 | # Calculate total size 71 | self.num_files_left = len(self.files) 72 | self.total_size = 0 73 | self.size_so_far = 0 74 | self.size_of_finished_files_so_far = 0 75 | self.percentage = 0 76 | self.cancel_required = False 77 | self.start_time = time.time() 78 | 79 | try: 80 | for f in self.files: 81 | self.total_size += os.path.getsize(f) 82 | 83 | for f in self.files: 84 | if self.cancel_required: 85 | notify(_("The upload to '%(service)s' was cancelled") % {'service': service['name']}) 86 | Gtk.main_quit() 87 | sys.exit(0) 88 | else: 89 | # Upload 1 file 90 | filename = os.path.split(f)[1] 91 | self.upload(f) 92 | 93 | self.num_files_left -= 1 94 | self.size_of_finished_files_so_far += os.path.getsize(f) 95 | 96 | except Exception as e: 97 | notify((_("Upload to '%s' failed: ") % service['name']) + str(e)) 98 | traceback.print_exc() 99 | Gtk.main_quit() 100 | sys.exit(0) 101 | 102 | if len(self.files) > 1: 103 | notify(_("Successfully uploaded %(number)d files to '%(service)s'") % {'number': len(self.files), 'service': service['name']}) 104 | else: 105 | notify(_("Successfully uploaded 1 file to '%(service)s'") % {'service': service['name']}) 106 | 107 | Gtk.main_quit() 108 | sys.exit(0) 109 | 110 | def close_window(self, widget=None, event=None): 111 | if self.cancel_required: 112 | self.window.hide() 113 | else: 114 | self.builder_cancel = self.builder.get_object("close_dialog") 115 | self.builder_cancel.get_object("close_dialog").set_icon_name(ICON) 116 | self.builder_cancel.get_object("label_cancel").set_text(_("Do you want to cancel this upload?")) 117 | self.builder_cancel.get_object("cancel_button").set_label(_("Cancel")) 118 | self.builder_cancel.get_object("continue_button").set_label(_("Run in the background")) 119 | self.builder_cancel.get_object("cancel_button").connect("clicked", self.hide_window, True) 120 | self.builder_cancel.get_object("continue_button").connect("clicked", self.hide_window, False) 121 | self.builder_cancel.get_object("close_dialog").set_title(_("Cancel upload?")) 122 | self.builder_cancel.get_object("close_dialog").show() 123 | return True 124 | 125 | def hide_window(self, widget, cancel): 126 | self.builder_cancel.get_object("close_dialog").hide() 127 | if cancel: 128 | self.cancel(widget) 129 | self.window.hide() 130 | 131 | def cancel(self, widget): 132 | self.cancel_required = True 133 | self.builder.get_object("cancel_button").set_sensitive(False) 134 | 135 | def progress(self, message, color=None): 136 | pass 137 | 138 | def pct(self, so_far, total=None): 139 | percentage = str(int(self.percentage * 100)) + "%" 140 | if self.num_files_left > 1: 141 | message = _("Uploading %(number)d files to %(service)s") % {'number': self.num_files_left, 'service': "\"" + service['name'] + "\""} 142 | title = _("%(percentage)s of %(number)d files - Uploading to %(service)s") % {'percentage': percentage, 'number': self.num_files_left, 'service': "\"" + service['name'] + "\""} 143 | else: 144 | message = _("Uploading 1 file to %(service)s") % {'service': "\"" + service['name'] + "\""} 145 | title = _("%(percentage)s of 1 file - Uploading to %(service)s") % {'percentage': percentage, 'service': "\"" + service['name'] + "\""} 146 | 147 | self.percentage = float(self.size_so_far) / float(self.total_size) 148 | Gdk.threads_enter() 149 | try: 150 | XApp.set_window_progress(self.window, int(self.percentage * 100)) 151 | self.progressbar.set_fraction(self.percentage) 152 | self.progressbar.set_text(str(int(self.percentage * 100)) + "%") 153 | self.builder.get_object("upload_label").set_text(message) 154 | self.window.set_title(title) 155 | finally: 156 | Gdk.threads_leave() 157 | pass 158 | 159 | def common_callback(self): 160 | self.pct(self.size_so_far, self.total_size) 161 | self.calculate_time() 162 | 163 | if self.speed > 0 and self.time_remaining > 0: 164 | message = _("%(size_so_far)s of %(total_size)s - %(time_remaining)s left (%(speed)s/sec)") % {'size_so_far': self.size_to_string(self.size_so_far, 1), 'total_size': self.size_to_string(self.total_size, 1), 'time_remaining': self.time_to_string(self.time_remaining), 'speed': self.size_to_string(self.speed, 1)} 165 | else: 166 | message = _("%(size_so_far)s of %(total_size)s") % {'size_so_far': self.size_to_string(self.size_so_far, 1), 'total_size': self.size_to_string(self.total_size, 1)} 167 | 168 | Gdk.threads_enter() 169 | try: 170 | self.builder.get_object("label_details").set_text(message) 171 | finally: 172 | Gdk.threads_leave() 173 | return 174 | 175 | def my_ftp_callback(self, buffer): 176 | self.size_so_far += len(buffer) - 1 177 | self.common_callback() 178 | return 179 | 180 | def my_sftp_callback(self, so_far, total=None): 181 | self.size_so_far = self.size_of_finished_files_so_far + so_far 182 | self.common_callback() 183 | return 184 | 185 | def success(self): 186 | pass 187 | 188 | def size_to_string(self, size, decimals): 189 | size = float(size) 190 | kilo = float(1024) 191 | mega = float(1024 * 1024) 192 | giga = float(1024 * 1024 * 1024) 193 | strSize = str(size) + _("B") 194 | if size >= kilo: 195 | strSize = str(round(size / kilo, decimals)) + _("KB") 196 | if size >= mega: 197 | strSize = str(round(size / mega, decimals)) + _("MB") 198 | if size >= giga: 199 | strSize = str(round(size / giga, decimals)) + _("GB") 200 | return strSize 201 | 202 | def time_to_string(self, time): 203 | hours, remainder = divmod(time, 3600) 204 | minutes, seconds = divmod(remainder, 60) 205 | if time > 3600: 206 | str = gettext.ngettext("%d hour", "%d hours", hours) % hours 207 | str += ", " + gettext.ngettext("%d minute", "%d minutes", minutes) % minutes 208 | elif time > 60: 209 | str = gettext.ngettext("%d minute", "%d minutes", minutes) % minutes 210 | str += ", " + gettext.ngettext("%d second", "%d seconds", seconds) % seconds 211 | else: 212 | str = gettext.ngettext("%d second", "%d seconds", seconds) % seconds 213 | return str 214 | 215 | def calculate_time(self): 216 | self.size_remaining = self.total_size - self.size_so_far 217 | time_spent = time.time() - self.start_time 218 | if time_spent > 0: 219 | self.speed = float(self.size_so_far) / float(time_spent) 220 | else: 221 | self.speed = 0 222 | if self.speed > 0: 223 | self.time_remaining = float(self.size_remaining) / float(self.speed) 224 | else: 225 | self.time_remaining = 0 226 | 227 | if __name__ == "__main__": 228 | if len(sys.argv) < 3: 229 | print("""Usage: mintupload service file [more files]""") 230 | exit(0) 231 | 232 | service_name = sys.argv[1] 233 | service = None 234 | known_services = read_services() 235 | for known_service in known_services: 236 | if known_service['name'] == service_name: 237 | service = known_service 238 | 239 | if service is None: 240 | print("Unknown service: " + service_name) 241 | os.system(f"notify-send 'Unknown service:' {shlex.quote(service_name)}") 242 | else: 243 | filenames = sys.argv[2:] 244 | 245 | uploader = GtkUploader(service, filenames) 246 | uploader.start() 247 | Gtk.main() 248 | -------------------------------------------------------------------------------- /usr/share/applications/kde4/mintupload.desktop: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Name=Upload Manager 3 | Name[af]=Oplaai Bestuurder 4 | Name[am]=የመጫኛ አስተዳዳሪ 5 | Name[ar]=مدير التحميل 6 | Name[ast]=Alministrador de xubes 7 | Name[az]=Yükləmə Yönətməni 8 | Name[be]=Кіраўнік зацягванняў 9 | Name[bg]=Управление на качванията 10 | Name[bn]=আপলোড ম্যানেজার 11 | Name[bs]=Upravljanje dodavanjima 12 | Name[ca]=Gestor de pujades 13 | Name[ca@valencia]=Administrador de pujades 14 | Name[cs]=Správa odesílání (upload) 15 | Name[csb]=Menadżera sélaniô 16 | Name[cy]=Rheolwr Llwytho i Fyny 17 | Name[da]=Overførselshåndtering 18 | Name[de]=Hochladeverwaltung 19 | Name[el]=Διαχειριστής Αποστολής Αρχείων 20 | Name[eo]=Alŝutmastrumilo 21 | Name[es]=Gestor de subidas 22 | Name[et]=Üleslaadimishaldur 23 | Name[eu]=Karga-kudeatzailea 24 | Name[fa]=مدیر ارسال 25 | Name[fi]=Lähetystenhallinta 26 | Name[fo]=Uppsendinga Leiðari 27 | Name[fr]=Gestionnaire de téléversement 28 | Name[fr_CA]=Gestionnaire de téléversement 29 | Name[frp]=Trablèta de chargement amont 30 | Name[ga]=Bainisteoir uasluchtaithe 31 | Name[gd]=Manaidsear nan luchdaidhean suas 32 | Name[gl]=Xestor de envíos 33 | Name[gv]=Reireyder laadey heose 34 | Name[he]=מנהל העלאות 35 | Name[hi]=अपलोड प्रबंधक 36 | Name[hr]=Upravitelj slanja datoteka 37 | Name[hu]=Feltöltéskezelő 38 | Name[ia]=Gestor de cargamento 39 | Name[id]=Manajer upload 40 | Name[is]=Sendingastjóri 41 | Name[ja]=アップロードマネージャ 42 | Name[jv]=Penglola upload 43 | Name[ka]=ატვირთვის მენეჯერი 44 | Name[kab]=Amsefrak n usali 45 | Name[kk]=Құю менеджері 46 | Name[km]=កម្មវិធីគ្រប់គ្រងការផ្ទុកឡើង 47 | Name[ko]=업로드 매니저 48 | Name[ku]=Rêvebirê Barkirinê 49 | Name[lo]=ການຈັດການ ອັບໂຫລດ 50 | Name[lt]=Įkėlimo tvarkytuvė 51 | Name[lv]=Augšupielāžu pārvaldnieks 52 | Name[mk]=Менаџер за поставување датотеки 53 | Name[ml]=അപ്‌ലോഡ്‌ മാനേജര്‍ 54 | Name[mr]=अपलोड प्रबंधक 55 | Name[ms]=Pengurus Muatnaik 56 | Name[nb]=Opplastingsveiviser 57 | Name[nds]=Uploadmanager 58 | Name[ne]=अप्लोड म्यानेजर 59 | Name[nl]=Uploadbeheer 60 | Name[nn]=Opplastingsrettleiar 61 | Name[oc]=Gestionari de mandadisses 62 | Name[pa]=ਅੱਪਲੋਡ ਮੈਨੇਜਰ 63 | Name[pap]=Atministrado di upload 64 | Name[pl]=Menedżer wysyłania 65 | Name[pt]=Gestor de envios 66 | Name[pt_BR]=Gerenciador de Envio de Arquivos 67 | Name[ro]=Administrator încărcare 68 | Name[ru]=Менеджер загрузчика файлов 69 | Name[si]=ලිපිගොනු යැවීම කලමනාකරනය 70 | Name[sk]=Správca Prenosu Súborov 71 | Name[sl]=Upravljalnik pošiljanja 72 | Name[so]=Agaasimaha daabulidda 73 | Name[sq]=Menaxhuesi i Ngarkimeve 74 | Name[sr]=Управник отпремања 75 | Name[sr@latin]=Menadžer otpremanja 76 | Name[sv]=Uppladdningshanterare 77 | Name[ta]=பதிவேற்ற நிர்வாகி 78 | Name[te]=ఎక్కింపు నిర్వాహకం 79 | Name[tg]=Мудири боркунӣ 80 | Name[th]=โปรแกรมจัดการการอัปโหลด 81 | Name[tr]=Yükleme Yöneticisi 82 | Name[uk]=Менеджер завантажень 83 | Name[ur]=اپلوڈ منتظم 84 | Name[uz]=Файлларни юбориш менежери 85 | Name[vi]=Trình Quản lý Tải lên 86 | Name[zh_CN]=上传管理器 87 | Name[zh_HK]=上傳管理員 88 | Name[zh_TW]=上傳管理員 89 | Comment=Define upload services 90 | Comment[af]=Definieer oplaai dienste 91 | Comment[am]=መግለጽ የመጫኛ አገልግሎቶች 92 | Comment[ar]=تعريف خدمات التحميل 93 | Comment[ast]=Definir serviciu de xubida 94 | Comment[az]=Yükləmə qulluqlarını tanımlayın 95 | Comment[be]=Вызначыць службы зацягванняў 96 | Comment[bg]=Задаване на сървъри 97 | Comment[bn]=আপলোড সেবাসমূহের বর্ণনা দিন 98 | Comment[bs]=Definiranje servisa za dodavanje 99 | Comment[ca]=Definiu els serveis de pujada 100 | Comment[ca@valencia]=Definix servicis de pujada 101 | Comment[cs]=Definovat odesílací služby 102 | Comment[csb]=Definiujë ùsłëżnotë sélaniô 103 | Comment[cy]=Dififnio gwasanaethau llwytho 104 | Comment[da]=Sæt overførselstjenester op 105 | Comment[de]=Bestimme Dienste zum Hochladen 106 | Comment[el]=Καθορίστε τις υπηρεσίες αποστολής 107 | Comment[eo]=Difini alŝutservojn 108 | Comment[es]=Defina los servicios de subida 109 | Comment[et]=Määra üleslaadimisteenused 110 | Comment[eu]=Zehaztu karga-zerbitzuak 111 | Comment[fa]=سرویسهای ارسال را مشخص کن 112 | Comment[fi]=Määritä lähetyspalvelut 113 | Comment[fil]=I-define ang serbisyo sa pag-upload 114 | Comment[fo]=Skilmarka uppsendinga tænastur 115 | Comment[fr]=Définir les services de téléversement 116 | Comment[fr_CA]=Définir les services de téléversement 117 | Comment[frp]=Dèfinissâds los sèrviços de charrèyâjo amont de fichiérs 118 | Comment[ga]=Sainmhínígh seirbhísí uasluchtaithe 119 | Comment[gd]=Sònraich seirbheisean luchdaidh suas 120 | Comment[gl]=Definir servizos de envío 121 | Comment[gv]=Reih yn shirveeish laadey heose 122 | Comment[he]=הגדרת שירותי העלאה 123 | Comment[hi]=अपलोड सेवाएँ परिभाषित करें 124 | Comment[hr]=Odredite uslugu slanja 125 | Comment[hu]=Feltöltőszolgáltatások megadása 126 | Comment[ia]=Definir le servicios de cargamento 127 | Comment[id]=Definisikan layanan unggah 128 | Comment[is]=Skilgreindu sendingaþjónustur 129 | Comment[it]=Definisci i servizi di upload 130 | Comment[ja]=アップロードサービスを定義します 131 | Comment[jv]=Definisi nglayani ngunggahake 132 | Comment[kab]=Sbadu imeẓla n usali 133 | Comment[kk]=Файл құю қызметтерін белгілеу 134 | Comment[km]=កំណត់សេវាកម្មផ្ទុកឡើង 135 | Comment[ko]=업로드 서비스 추가 136 | Comment[lt]=Nustatyti įkėlimo paslaugas 137 | Comment[lv]=Kontrolē augšupielāžu pakalpojumus 138 | Comment[mk]=Дефинирај сервис за поставување 139 | Comment[ml]=അപ്‌ലോഡ്‌ സെര്‍വിസുകളെ നിര്‍വചിക്കുക 140 | Comment[mr]=उपलोड सेवा निर्धारित करा 141 | Comment[ms]=Tentukan servis muatnaik 142 | Comment[nb]=Definer opplastingstjenester 143 | Comment[nds]=Bestimme Dienste zum Hochladen 144 | Comment[ne]=अप्लोअद सेरिभाइसहरु निर्धारण गर्नुहोस्। 145 | Comment[nl]=Uploaddiensten benoemen 146 | Comment[nn]=Definer opplastingstenester 147 | Comment[oc]=Definissètz los servicis de mandadís de fichièrs 148 | Comment[pap]=Definí e servisionan pa upload 149 | Comment[pl]=Określ usługi wysyłania 150 | Comment[pt]=Definir serviço de envios 151 | Comment[pt_BR]=Definir serviços de envio 152 | Comment[ro]=Definiți serviciile de încărcare 153 | Comment[ru]=Назначить службы загрузки 154 | Comment[si]=ඉහලට යැවීමේ සේවා අතුලත් කරන්න 155 | Comment[sk]=Definovať služby prenosu 156 | Comment[sl]=Določi storitve pošiljanja 157 | Comment[so]=Qeex khidmadaha daabulidda 158 | Comment[sq]=Përkufizo shërbimet e ngarkimit 159 | Comment[sr]=Одредите услуге отпремања 160 | Comment[sr@latin]=Odredite servise za otpremanje 161 | Comment[sv]=Definera uppladdningstjänster 162 | Comment[ta]=பதிவேற்ற சேவைகளை வரையறுக்க 163 | Comment[te]=ఎక్కింపు సేవలను నిర్వచించు 164 | Comment[tg]=Интихоби хидмати боркунӣ 165 | Comment[th]=กำหนดบริการอัปโหลด 166 | Comment[tl]=I-define ang serbisyo sa pag-upload 167 | Comment[tr]=Yükleme hizmetlerini tanımlayın 168 | Comment[uk]=Визначити служби завантаження 169 | Comment[uz]=Юбориш учун хизматларни аниқланг 170 | Comment[vi]=Chỉ định dịch vụ tải lên 171 | Comment[zh_CN]=定义上传服务 172 | Comment[zh_HK]=定義上傳服務 173 | Comment[zh_TW]=定義上傳服務 174 | GenericName=Define upload services 175 | GenericName[af]=Definieer oplaai dienste 176 | GenericName[am]=መግለጽ የመጫኛ አገልግሎቶች 177 | GenericName[ar]=تعريف خدمات التحميل 178 | GenericName[ast]=Definir serviciu de xubida 179 | GenericName[az]=Yükləmə qulluqlarını tanımlayın 180 | GenericName[be]=Вызначыць службы зацягванняў 181 | GenericName[bg]=Задаване на сървъри 182 | GenericName[bn]=আপলোড সেবাসমূহের বর্ণনা দিন 183 | GenericName[bs]=Definiranje servisa za dodavanje 184 | GenericName[ca]=Definiu els serveis de pujada 185 | GenericName[ca@valencia]=Definix servicis de pujada 186 | GenericName[cs]=Definovat odesílací služby 187 | GenericName[csb]=Definiujë ùsłëżnotë sélaniô 188 | GenericName[cy]=Dififnio gwasanaethau llwytho 189 | GenericName[da]=Sæt overførselstjenester op 190 | GenericName[de]=Bestimme Dienste zum Hochladen 191 | GenericName[el]=Καθορίστε τις υπηρεσίες αποστολής 192 | GenericName[eo]=Difini alŝutservojn 193 | GenericName[es]=Defina los servicios de subida 194 | GenericName[et]=Määra üleslaadimisteenused 195 | GenericName[eu]=Zehaztu karga-zerbitzuak 196 | GenericName[fa]=سرویسهای ارسال را مشخص کن 197 | GenericName[fi]=Määritä lähetyspalvelut 198 | GenericName[fil]=I-define ang serbisyo sa pag-upload 199 | GenericName[fo]=Skilmarka uppsendinga tænastur 200 | GenericName[fr]=Définir les services de téléversement 201 | GenericName[fr_CA]=Définir les services de téléversement 202 | GenericName[frp]=Dèfinissâds los sèrviços de charrèyâjo amont de fichiérs 203 | GenericName[ga]=Sainmhínígh seirbhísí uasluchtaithe 204 | GenericName[gd]=Sònraich seirbheisean luchdaidh suas 205 | GenericName[gl]=Definir servizos de envío 206 | GenericName[gv]=Reih yn shirveeish laadey heose 207 | GenericName[he]=הגדרת שירותי העלאה 208 | GenericName[hi]=अपलोड सेवाएँ परिभाषित करें 209 | GenericName[hr]=Odredite uslugu slanja 210 | GenericName[hu]=Feltöltőszolgáltatások megadása 211 | GenericName[ia]=Definir le servicios de cargamento 212 | GenericName[id]=Definisikan layanan unggah 213 | GenericName[is]=Skilgreindu sendingaþjónustur 214 | GenericName[it]=Definisci i servizi di upload 215 | GenericName[ja]=アップロードサービスを定義します 216 | GenericName[jv]=Definisi nglayani ngunggahake 217 | GenericName[kab]=Sbadu imeẓla n usali 218 | GenericName[kk]=Файл құю қызметтерін белгілеу 219 | GenericName[km]=កំណត់សេវាកម្មផ្ទុកឡើង 220 | GenericName[ko]=업로드 서비스 추가 221 | GenericName[lt]=Nustatyti įkėlimo paslaugas 222 | GenericName[lv]=Kontrolē augšupielāžu pakalpojumus 223 | GenericName[mk]=Дефинирај сервис за поставување 224 | GenericName[ml]=അപ്‌ലോഡ്‌ സെര്‍വിസുകളെ നിര്‍വചിക്കുക 225 | GenericName[mr]=उपलोड सेवा निर्धारित करा 226 | GenericName[ms]=Tentukan servis muatnaik 227 | GenericName[nb]=Definer opplastingstjenester 228 | GenericName[nds]=Bestimme Dienste zum Hochladen 229 | GenericName[ne]=अप्लोअद सेरिभाइसहरु निर्धारण गर्नुहोस्। 230 | GenericName[nl]=Uploaddiensten benoemen 231 | GenericName[nn]=Definer opplastingstenester 232 | GenericName[oc]=Definissètz los servicis de mandadís de fichièrs 233 | GenericName[pap]=Definí e servisionan pa upload 234 | GenericName[pl]=Określ usługi wysyłania 235 | GenericName[pt]=Definir serviço de envios 236 | GenericName[pt_BR]=Definir serviços de envio 237 | GenericName[ro]=Definiți serviciile de încărcare 238 | GenericName[ru]=Назначить службы загрузки 239 | GenericName[si]=ඉහලට යැවීමේ සේවා අතුලත් කරන්න 240 | GenericName[sk]=Definovať služby prenosu 241 | GenericName[sl]=Določi storitve pošiljanja 242 | GenericName[so]=Qeex khidmadaha daabulidda 243 | GenericName[sq]=Përkufizo shërbimet e ngarkimit 244 | GenericName[sr]=Одредите услуге отпремања 245 | GenericName[sr@latin]=Odredite servise za otpremanje 246 | GenericName[sv]=Definera uppladdningstjänster 247 | GenericName[ta]=பதிவேற்ற சேவைகளை வரையறுக்க 248 | GenericName[te]=ఎక్కింపు సేవలను నిర్వచించు 249 | GenericName[tg]=Интихоби хидмати боркунӣ 250 | GenericName[th]=กำหนดบริการอัปโหลด 251 | GenericName[tl]=I-define ang serbisyo sa pag-upload 252 | GenericName[tr]=Yükleme hizmetlerini tanımlayın 253 | GenericName[uk]=Визначити служби завантаження 254 | GenericName[uz]=Юбориш учун хизматларни аниқланг 255 | GenericName[vi]=Chỉ định dịch vụ tải lên 256 | GenericName[zh_CN]=定义上传服务 257 | GenericName[zh_HK]=定義上傳服務 258 | GenericName[zh_TW]=定義上傳服務 259 | Exec=mintupload-manager 260 | Icon=mintupload 261 | Terminal=false 262 | Type=Application 263 | Encoding=UTF-8 264 | Categories=Qt;KDE;Settings; 265 | X-KDE-StartupNotify=false 266 | OnlyShowIn=KDE; 267 | -------------------------------------------------------------------------------- /usr/lib/linuxmint/mintupload/upload-manager.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python3 2 | 3 | import os 4 | import gettext 5 | import string 6 | import shlex 7 | 8 | import gi 9 | gi.require_version("Gtk", "3.0") 10 | from gi.repository import Gtk, Gio 11 | 12 | from mintupload_core import * 13 | 14 | # i18n 15 | gettext.install("mintupload", "/usr/share/linuxmint/locale") 16 | 17 | # Location of the ui file 18 | UI_FILE = "/usr/share/linuxmint/mintupload/manager_window.ui" 19 | 20 | class MyApplication(Gtk.Application): 21 | # Main initialization routine 22 | def __init__(self, application_id, flags): 23 | Gtk.Application.__init__(self, application_id=application_id, flags=flags) 24 | self.connect("activate", self.activate) 25 | 26 | def activate(self, application): 27 | windows = self.get_windows() 28 | if (len(windows) > 0): 29 | window = windows[0] 30 | window.present() 31 | window.show() 32 | else: 33 | window = ManagerWindow(self) 34 | self.add_window(window.window) 35 | window.window.show() 36 | 37 | class ManagerWindow: 38 | 39 | def __init__(self, application): 40 | self.application = application 41 | self.builder = Gtk.Builder() 42 | self.builder.add_from_file(UI_FILE) 43 | 44 | self.window = self.builder.get_object("manager_window") 45 | self.window.set_title(_("Upload Manager")) 46 | self.window.set_icon_name(ICON) 47 | 48 | treeview_services = self.builder.get_object("treeview_services") 49 | 50 | # the treeview 51 | column1 = Gtk.TreeViewColumn(_("Upload services"), Gtk.CellRendererText(), text=0) 52 | column1.set_sort_column_id(0) 53 | column1.set_resizable(True) 54 | 55 | treeview_services.append_column(column1) 56 | treeview_services.set_headers_clickable(True) 57 | treeview_services.set_reorderable(False) 58 | treeview_services.show() 59 | 60 | self.reload_services(treeview_services) 61 | 62 | self.builder.get_object("toolbutton_add").connect("clicked", self.add_service, treeview_services) 63 | self.builder.get_object("toolbutton_edit").connect("clicked", self.edit_service_from_button, treeview_services) 64 | self.builder.get_object("toolbutton_remove").connect("clicked", self.remove_service, treeview_services) 65 | 66 | treeview_services.connect("row_activated", self.edit_service_from_tree, treeview_services) 67 | 68 | fileMenu = Gtk.MenuItem.new_with_mnemonic(_("_File")) 69 | fileSubmenu = Gtk.Menu() 70 | fileMenu.set_submenu(fileSubmenu) 71 | closeMenuItem = Gtk.ImageMenuItem.new_from_stock(Gtk.STOCK_CLOSE) 72 | closeMenuItem.set_label(_("Close")) 73 | closeMenuItem.connect("activate", Gtk.main_quit) 74 | fileSubmenu.append(closeMenuItem) 75 | 76 | helpMenu = Gtk.MenuItem.new_with_mnemonic(_("_Help")) 77 | helpSubmenu = Gtk.Menu() 78 | helpMenu.set_submenu(helpSubmenu) 79 | aboutMenuItem = Gtk.ImageMenuItem.new_from_stock(Gtk.STOCK_ABOUT) 80 | aboutMenuItem.set_label(_("About")) 81 | aboutMenuItem.connect("activate", self.open_about) 82 | helpSubmenu.append(aboutMenuItem) 83 | 84 | self.builder.get_object("menubar1").append(fileMenu) 85 | self.builder.get_object("menubar1").append(helpMenu) 86 | self.builder.get_object("manager_window").show_all() 87 | 88 | def open_about(self, widget): 89 | dlg = Gtk.AboutDialog() 90 | dlg.set_transient_for(self.window) 91 | dlg.set_title(_("About") + " - mintupload") 92 | dlg.set_version("__DEB_VERSION__") 93 | dlg.set_program_name("mintupload") 94 | dlg.set_comments(_("Upload Manager")) 95 | 96 | try: 97 | h = open('/usr/share/common-licenses/GPL', 'r') 98 | s = h.readlines() 99 | gpl = "" 100 | for line in s: 101 | gpl += line 102 | h.close() 103 | dlg.set_license(gpl) 104 | except Exception as detail: 105 | print(detail) 106 | 107 | dlg.set_authors([ 108 | "Clement Lefebvre ", 109 | "Philip Morrell ", 110 | "Manuel Sandoval ", 111 | "Dennis Schwertel " 112 | ]) 113 | dlg.set_icon_name(ICON) 114 | dlg.set_logo_icon_name(ICON) 115 | 116 | def close(w, res): 117 | if res == Gtk.ResponseType.DELETE_EVENT: 118 | w.destroy() 119 | 120 | dlg.connect("response", close) 121 | dlg.show() 122 | 123 | def response_to_dialog(self, entry, dialog, response): 124 | dialog.response(response) 125 | 126 | def add_service(self, widget, treeview_services): 127 | dialog = Gtk.MessageDialog(None, Gtk.DialogFlags.MODAL | Gtk.DialogFlags.DESTROY_WITH_PARENT, Gtk.MessageType.QUESTION, Gtk.ButtonsType.OK_CANCEL, None) 128 | dialog.set_transient_for(self.window) 129 | dialog.set_title(_("Upload Manager")) 130 | dialog.set_icon_name(ICON) 131 | dialog.set_border_width(6) 132 | dialog.set_markup(_("Please enter a name for the new upload service:")) 133 | entry = Gtk.Entry() 134 | entry.connect("changed", self.check_service_name, dialog) 135 | hbox = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL) 136 | label = Gtk.Label(_("Service name:")) 137 | hbox.pack_start(label, False, 5, 5) 138 | hbox.pack_end(entry, True, True, 0) 139 | dialog.format_secondary_markup(_("Try to avoid spaces and special characters...")) 140 | dialog.vbox.pack_end(hbox, True, True, 0) 141 | dialog.show_all() 142 | response = dialog.run() 143 | 144 | if response == Gtk.ResponseType.OK: 145 | sname = entry.get_text() 146 | 147 | dialog.destroy() 148 | 149 | if response == Gtk.ResponseType.OK: 150 | service = Service('/usr/share/linuxmint/mintupload/sample.service') 151 | if os.path.exists(config_paths['user'] + sname): 152 | sname += " 2" 153 | while os.path.exists(config_paths['user'] + sname): 154 | next = int(sname[-1:]) + 1 155 | sname = sname[:-1] + str(next) 156 | service.filename = config_paths['user'] + sname 157 | service.write() 158 | self.services.append(service) 159 | model = treeview_services.get_model() 160 | iter = model.insert_before(None, None) 161 | model.set_value(iter, 0, sname) 162 | self.edit_service(treeview_services, model.get_path(iter)) 163 | 164 | def check_service_name(self, entry, dialog): 165 | text = entry.get_text() 166 | valid = True 167 | if text == "": 168 | valid = False 169 | if " " in text: 170 | valid = False 171 | invalidChars = set(string.punctuation.replace("_", "")) 172 | if any(char in invalidChars for char in text): 173 | valid = False 174 | dialog.get_widget_for_response(Gtk.ResponseType.OK).set_sensitive(valid) 175 | 176 | def remove_service(self, widget, treeview_services): 177 | (model, iter) = treeview_services.get_selection().get_selected() 178 | self.services = read_services() 179 | 180 | if iter != None: 181 | service = model.get_value(iter, 0) 182 | for s in self.services: 183 | if s['name'] == service: 184 | s.remove() 185 | self.services.remove(s) 186 | model.remove(iter) 187 | 188 | def reload_services(self, treeview_services): 189 | model = Gtk.TreeStore(str) 190 | model.set_sort_column_id(0, Gtk.SortType.ASCENDING) 191 | treeview_services.set_model(model) 192 | 193 | self.services = read_services() 194 | for service in self.services: 195 | iter = model.insert_before(None, None) 196 | model.set_value(iter, 0, service['name']) 197 | del model 198 | 199 | def edit_service_from_tree(self, widget, path, column, treeview_services): 200 | self.edit_service(treeview_services, path) 201 | 202 | def edit_service_from_button(self, widget, treeview_services): 203 | selection = treeview_services.get_selection() 204 | (model, iter) = selection.get_selected() 205 | if iter is not None: 206 | self.edit_service(treeview_services, model.get_path(iter)) 207 | 208 | def edit_service(self, treeview_services, path): 209 | model = treeview_services.get_model() 210 | iter = model.get_iter(path) 211 | sname = model.get_value(iter, 0) 212 | file = config_paths['user'] + sname 213 | 214 | dialog_edit_service = self.builder.get_object("dialog_edit_service") 215 | dialog_edit_service.set_transient_for(self.window) 216 | dialog_edit_service.set_title(_("%s Properties") % sname) 217 | dialog_edit_service.set_icon_name(ICON) 218 | 219 | self.builder.get_object("button_verify").set_label(_("Check connection")) 220 | self.builder.get_object("button_verify").connect("clicked", self.check_connection, file) 221 | self.builder.get_object("button_cancel").connect("clicked", self.close_window, self.builder.get_object("dialog_edit_service")) 222 | 223 | #i18n 224 | self.builder.get_object("lbl_type").set_label(_("Type:")) 225 | self.builder.get_object("lbl_hostname").set_label(_("Host:")) 226 | self.builder.get_object("lbl_port").set_label(_("Port:")) 227 | self.builder.get_object("lbl_username").set_label(_("User:")) 228 | self.builder.get_object("lbl_password").set_label(_("Password:")) 229 | self.builder.get_object("lbl_timestamp").set_label(_("Timestamp:")) 230 | self.builder.get_object("lbl_path").set_label(_("Path:")) 231 | 232 | self.builder.get_object("lbl_hostname").set_tooltip_text(_("Hostname or IP address, default: ") + defaults['host']) 233 | self.builder.get_object("txt_host").set_tooltip_text(_("Hostname or IP address, default: ") + defaults['host']) 234 | self.builder.get_object("txt_host").connect("focus-out-event", self.change, file) 235 | 236 | self.builder.get_object("lbl_port").set_tooltip_text(_("Remote port, default is 21 for FTP, 22 for SFTP and SCP")) 237 | self.builder.get_object("txt_port").set_tooltip_text(_("Remote port, default is 21 for FTP, 22 for SFTP and SCP")) 238 | self.builder.get_object("txt_port").connect("focus-out-event", self.change, file) 239 | 240 | self.builder.get_object("lbl_username").set_tooltip_text(_("Username, defaults to your local username")) 241 | self.builder.get_object("txt_user").set_tooltip_text(_("Username, defaults to your local username")) 242 | self.builder.get_object("txt_user").connect("focus-out-event", self.change, file) 243 | 244 | self.builder.get_object("lbl_password").set_tooltip_text(_("Password, by default: password-less SCP connection, null-string FTP connection, ~/.ssh keys used for SFTP connections")) 245 | self.builder.get_object("txt_pass").set_tooltip_text(_("Password, by default: password-less SCP connection, null-string FTP connection, ~/.ssh keys used for SFTP connections")) 246 | self.builder.get_object("txt_pass").connect("focus-out-event", self.change, file) 247 | 248 | self.builder.get_object("lbl_timestamp").set_tooltip_text(_("Timestamp format (strftime). By default:") + defaults['format']) 249 | self.builder.get_object("txt_format").set_tooltip_text(_("Timestamp format (strftime). By default:") + defaults['format']) 250 | self.builder.get_object("txt_format").connect("focus-out-event", self.change, file) 251 | 252 | self.builder.get_object("lbl_path").set_tooltip_text(_("Directory to upload to. is replaced with the current timestamp, following the timestamp format given. By default: .")) 253 | self.builder.get_object("txt_path").set_tooltip_text(_("Directory to upload to. is replaced with the current timestamp, following the timestamp format given. By default: .")) 254 | self.builder.get_object("txt_path").connect("focus-out-event", self.change, file) 255 | 256 | try: 257 | config = Service(file) 258 | try: 259 | model = self.builder.get_object("combo_type").get_model() 260 | iter = model.get_iter_first() 261 | 262 | while (iter != None and model.get_value(iter, 0).lower() != config['type'].lower()): 263 | iter = model.iter_next(iter) 264 | 265 | self.builder.get_object("combo_type").set_active_iter(iter) 266 | self.builder.get_object("combo_type").connect("changed", self.change, None, file) 267 | except: 268 | pass 269 | try: 270 | self.builder.get_object("txt_host").set_text(config['host']) 271 | except: 272 | self.builder.get_object("txt_host").set_text("") 273 | try: 274 | self.builder.get_object("txt_port").set_text(str(config['port'])) 275 | except: 276 | self.builder.get_object("txt_port").set_text("") 277 | try: 278 | self.builder.get_object("txt_user").set_text(config['user']) 279 | except: 280 | self.builder.get_object("txt_user").set_text("") 281 | try: 282 | self.builder.get_object("txt_pass").set_text(config['pass']) 283 | except: 284 | self.builder.get_object("txt_pass").set_text("") 285 | try: 286 | self.builder.get_object("txt_format").set_text(config['format']) 287 | except: 288 | self.builder.get_object("txt_format").set_text("") 289 | try: 290 | self.builder.get_object("txt_path").set_text(config['path']) 291 | except: 292 | self.builder.get_object("txt_path").set_text("") 293 | except Exception as detail: 294 | print(detail) 295 | 296 | dialog_edit_service.run() 297 | dialog_edit_service.hide() 298 | 299 | def check_connection(self, widget, file): 300 | service = Service(file) 301 | os.system(f"mintupload {shlex.quote(service['name'])} /usr/share/linuxmint/mintupload/mintupload.readme &") 302 | 303 | def get_port_for_service(self, type): 304 | num = "21" if type in ("Mint", "FTP") else "22" 305 | 306 | self.builder.get_object("txt_port").set_text(num) 307 | return num 308 | 309 | def change(self, widget, event, file): 310 | try: 311 | wname = Gtk.Buildable.get_name(widget) 312 | 313 | if wname == "combo_type": 314 | model = widget.get_model() 315 | iter = widget.get_active_iter() 316 | config = {'type': model.get_value(iter, 0).lower(), 317 | 'port': self.get_port_for_service(model.get_value(iter, 0))} 318 | else: 319 | config = {wname[4:]: widget.get_text()} 320 | 321 | s = Service(file) 322 | s.merge(config) 323 | s.write() 324 | except Exception as e: 325 | try: 326 | raise CustomError(_("Could not save configuration change"), e) 327 | except: 328 | pass 329 | 330 | def close_window(self, widget, window): 331 | window.hide() 332 | 333 | if __name__ == "__main__": 334 | application = MyApplication("com.linuxmint.mintupload", Gio.ApplicationFlags.FLAGS_NONE) 335 | application.run() 336 | -------------------------------------------------------------------------------- /usr/lib/linuxmint/mintupload/mintupload_core.py: -------------------------------------------------------------------------------- 1 | # mintUpload 2 | # Clement Lefebvre 3 | # 4 | # This program is free software; you can redistribute it and/or 5 | # modify it under the terms of the GNU General Public License 6 | # as published by the Free Software Foundation; Version 3 7 | # of the License. 8 | 9 | 10 | import os 11 | import sys 12 | import urllib.request, urllib.parse, urllib.error 13 | import ftplib 14 | import datetime 15 | import gettext 16 | import paramiko 17 | import pexpect 18 | import threading 19 | import gi 20 | import shlex 21 | 22 | gi.require_version('Notify', '0.7') 23 | from gi.repository import Notify 24 | 25 | from configobj import ConfigObj 26 | 27 | USER_HOME = os.path.expanduser('~') 28 | 29 | VERSION = "3.7.4" 30 | __version__ = VERSION 31 | 32 | # i18n 33 | gettext.install("mintupload", "/usr/share/linuxmint/locale") 34 | 35 | ICON = "mintupload" 36 | CONFIGFILE_GLOBAL = '/etc/linuxmint/mintUpload.conf' 37 | CONFIGFILE_USER = USER_HOME + '/.linuxmint/mintUpload.conf' 38 | 39 | 40 | class CustomError(Exception): 41 | 42 | '''All custom defined errors''' 43 | 44 | observers = [] 45 | 46 | def __init__(self, summary, err=None): 47 | self.type = self.__class__.__name__ 48 | self.summary = summary 49 | 50 | self.detail = '' if not err else repr(err) 51 | 52 | for observer in self.observers: 53 | observer.error(self) 54 | 55 | @classmethod 56 | def add_observer(cls, observer): 57 | cls.observers.append(observer) 58 | 59 | 60 | class CliErrorObserver: 61 | 62 | '''All custom defined errors, using stderr''' 63 | 64 | def error(self, err): 65 | sys.stderr.write(os.linesep + err.type + ': ' + err.summary) 66 | 67 | if err.detail: 68 | sys.stderr.write(os.linesep + '\tDetail: ' + err.detail) 69 | 70 | sys.stderr.write(os.linesep * 2) 71 | 72 | CustomError.add_observer(CliErrorObserver()) 73 | 74 | 75 | class ConnectionError(CustomError): 76 | 77 | '''Raised when an error has occured with an external connection''' 78 | pass 79 | 80 | 81 | class FilesizeError(CustomError): 82 | 83 | '''Raised when the file is too large or too small''' 84 | pass 85 | 86 | 87 | def get_size_str(size, acc=None, factor=None): 88 | '''Converts integer filesize in bytes to textual repr''' 89 | 90 | if not factor: 91 | factor = int(config['filesize']['factor']) 92 | if not acc: 93 | acc = int(config['filesize']['accuracy']) 94 | if config['filesize']['binary_units'] == "True": 95 | thresholds = [_("B"), _("KiB"), _("MiB"), _("GiB")] 96 | else: 97 | thresholds = [_("B"), _("KB"), _("MB"), _("GB")] 98 | size = float(size) 99 | for i in reversed(list(range(1, len(thresholds)))): 100 | if size >= factor**i: 101 | rounded = round(size / factor**i, acc) 102 | return str(rounded) + thresholds[i] 103 | return str(int(size)) + thresholds[0] 104 | 105 | 106 | class MintNotifier: 107 | 108 | '''Enables integration with external notifiers''' 109 | 110 | def __init__(self): 111 | Notify.init("mintUpload") 112 | 113 | def notify(self, detail): 114 | Notify.Notification("mintUpload", detail, ICON).show() 115 | 116 | 117 | class MintSpaceChecker(threading.Thread): 118 | 119 | '''Checks that the filesize is ok''' 120 | 121 | def __init__(self, service, filesize): 122 | threading.Thread.__init__(self) 123 | self.service = service 124 | self.filesize = filesize 125 | 126 | def run(self): 127 | try: 128 | self.check() 129 | return True 130 | except FilesizeError: 131 | return False 132 | 133 | def check(self): 134 | # Get the maximum allowed self.filesize on the service 135 | if "maxsize" in self.service: 136 | if self.filesize > self.service["maxsize"]: 137 | raise FilesizeError(_("File larger than service's maximum")) 138 | 139 | # Get the available space left on the service 140 | if "space" in self.service: 141 | try: 142 | spaceInfo = urllib.request.urlopen(self.service["space"]).read() 143 | spaceInfo = spaceInfo.split("/") 144 | self.available = int(spaceInfo[0]) 145 | self.total = int(spaceInfo[1]) 146 | except Exception as e: 147 | raise ConnectionError(_("Could not get available space"), e) 148 | 149 | if self.filesize > self.available: 150 | raise FilesizeError(_("File larger than service's available space")) 151 | 152 | 153 | class MintUploader(threading.Thread): 154 | 155 | '''Uploads the file to the selected service''' 156 | 157 | def __init__(self, service, files): 158 | threading.Thread.__init__(self) 159 | service = service.for_upload() 160 | self.service = service 161 | self.focused = True 162 | self.files = files 163 | 164 | # Switch to required connect function, depending on service 165 | self.uploader = { 166 | 'MINT': self._ftp, # For backwards compatiblity 167 | 'FTP': self._ftp, 168 | 'SFTP': self._sftp, 169 | 'SCP': self._scp}[self.service['type']] 170 | 171 | def run(self): 172 | for f in self.files: 173 | self.upload(f) 174 | 175 | self.progress(_("File uploaded successfully.")) 176 | 177 | def upload(self, file): 178 | self.name = os.path.basename(file) 179 | self.filesize = os.path.getsize(file) 180 | self.uploader(file) 181 | self.success() 182 | 183 | def _ftp(self, file): 184 | '''Connection process for FTP services''' 185 | 186 | if 'port' not in self.service: 187 | self.service['port'] = 21 188 | try: 189 | # Attempting to connect 190 | ftp = ftplib.FTP() 191 | ftp.connect(self.service['host'], self.service['port']) 192 | ftp.login(self.service['user'], self.service['pass']) 193 | self.progress(self.service['type'] + " " + _("connection successfully established")) 194 | 195 | # Create full path 196 | for dir in self.service['path'].split(os.sep): 197 | try: 198 | ftp.mkd(dir) 199 | except: 200 | pass 201 | ftp.cwd(dir) 202 | 203 | f = open(file, "rb") 204 | self.progress(_("Uploading the file...")) 205 | self.pct(0) 206 | self.so_far = 0 207 | ftp.storbinary('STOR ' + self.name, f, 1024, callback=self.my_ftp_callback) 208 | 209 | finally: 210 | # Close any open connections 211 | try: 212 | f.close() 213 | except: 214 | pass 215 | 216 | try: 217 | ftp.quit() 218 | except: 219 | pass 220 | 221 | def _sftp(self, file): 222 | '''Connection process for SFTP services''' 223 | if 'port' not in self.service: 224 | self.service['port'] = 22 225 | try: 226 | ssh = paramiko.SSHClient() 227 | ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy()) 228 | key_filename = os.path.expanduser("~/.ssh/id_rsa") 229 | if os.path.exists(key_filename): 230 | ssh.connect(self.service['host'], username=self.service['user'], password=self.service['pass'], port=self.service['port'], key_filename=key_filename) 231 | else: 232 | ssh.connect(self.service['host'], username=self.service['user'], password=self.service['pass'], port=self.service['port']) 233 | 234 | sftp = ssh.open_sftp() 235 | self.progress(_("Uploading the file...")) 236 | self.pct(0) 237 | sftp.put(file, self.service['path'] + self.name, self.my_sftp_callback) 238 | 239 | finally: 240 | # Close any open connections 241 | try: 242 | sftp.close() 243 | except: 244 | pass 245 | 246 | try: 247 | ssh.close() 248 | except: 249 | pass 250 | 251 | def _scp(self, file): 252 | '''Connection process for SCP services''' 253 | if 'port' not in self.service: 254 | self.service['port'] = 22 255 | 256 | try: 257 | # Attempting to connect 258 | self.service['file'] = file 259 | scp = pexpect.spawn("scp", ["-P", "%(port)i" % self.service, 260 | "%(file)s" % self.service, 261 | "%(user)s@%(host)s:%(path)s" % self.service]) 262 | 263 | # If password is not defined, or is the empty string, use password-less scp 264 | if self.service['pass']: 265 | scp.expect('.*password:*') 266 | scp.sendline(self.service['pass']) 267 | self.progress("hihihi") 268 | self.progress(self.service['type'] + " " + _("connection successfully established")) 269 | 270 | scp.timeout = None 271 | self.pct(0) 272 | received = scp.expect(['.*100\%.*', '.*password:.*', pexpect.EOF]) 273 | if received == 1: 274 | scp.sendline(' ') 275 | raise ConnectionError(_("This service requires a password.")) 276 | 277 | finally: 278 | # Close any open connections 279 | try: 280 | scp.close() 281 | except: 282 | pass 283 | 284 | def progress(self, message): 285 | print(message) 286 | 287 | def pct(self, so_far, total=None): 288 | if not total: 289 | total = self.filesize 290 | 291 | if total: 292 | pct = float(so_far) / total 293 | else: 294 | pct = 1.0 295 | 296 | pct = int(pct * 100) 297 | sys.stdout.write("\r " + str(pct) + "% [" + (pct / 2) * "=" + ">" + (50 - (pct / 2)) * " " + "] " + get_size_str(so_far) + " ") 298 | sys.stdout.flush() 299 | return pct 300 | 301 | def success(self): 302 | self.pct(self.filesize) 303 | sys.stdout.write("\n") 304 | # Print URL 305 | if 'url' in self.service: 306 | url = self.service['url'].replace('', self.name) 307 | self.url = url.replace(' ', '%20') 308 | self.progress(_("URL:") + " " + self.url) 309 | 310 | n = config['notification'] 311 | # If nofications are enabled AND the file is minimal x byte in size... 312 | if n['enable'] == "True" and self.filesize >= int(n['min_filesize']): 313 | # If when_focused is true OR window has no focus 314 | if n['when_focused'] == "True" or not self.focused: 315 | MintNotifier().notify(_("File uploaded successfully.")) 316 | 317 | def my_ftp_callback(self, buffer): 318 | self.so_far = self.so_far + len(buffer) - 1 319 | self.pct(self.so_far) 320 | return 321 | 322 | def my_sftp_callback(self, so_far, total=None): 323 | return self.pct(so_far, total) 324 | 325 | 326 | def read_services(): 327 | '''Get all defined services''' 328 | 329 | services = [] 330 | for loc, path in config_paths.items(): 331 | os.system("mkdir -p " + path) 332 | for file in os.listdir(path): 333 | try: 334 | s = Service(path + file) 335 | except: 336 | pass 337 | else: 338 | s['loc'] = loc 339 | services.append(s) 340 | return services 341 | 342 | 343 | config = ConfigObj(CONFIGFILE_GLOBAL) 344 | if os.path.exists(CONFIGFILE_USER): 345 | config.merge(ConfigObj(CONFIGFILE_USER)) 346 | 347 | if 'paths' not in config: 348 | print(_("%(1)s is not set in the config file found under %(2)s or %(3)s") % {'1': 'paths', '2': CONFIGFILE_GLOBAL, '3': CONFIGFILE_USER}) 349 | sys.exit(1) 350 | 351 | if 'defaults' not in config: 352 | print(_("%(1)s is not set in the config file found under %(2)s or %(3)s") % {'1': 'defaults', '2': CONFIGFILE_GLOBAL, '3': CONFIGFILE_USER}) 353 | sys.exit(1) 354 | 355 | config_paths = config['paths'] 356 | config_paths['user'] = config_paths['user'].replace('', USER_HOME) 357 | 358 | defaults = config['defaults'] 359 | defaults['user'] = defaults['user'].replace('', os.environ['USER']) 360 | 361 | 362 | class Service(ConfigObj): 363 | 364 | '''Object representing an upload service''' 365 | 366 | def __init__(self, *args): 367 | ConfigObj.__init__(self, *args) 368 | self._fix() 369 | 370 | def merge(self, *args): 371 | ConfigObj.merge(self, *args) 372 | self._fix() 373 | 374 | def remove(self): 375 | os.system(f"rm {shlex.quote(self.filename)}") 376 | 377 | def move(self, newname, force=False): 378 | if force or not os.path.exists(newname): 379 | os.system(f"mv {shlex.quote(self.filename)} {shlex.quote(newname)}") 380 | self.filename = newname 381 | 382 | def copy(self, newname, force=False): 383 | if force or not os.path.exists(newname): 384 | oldname = self.filename 385 | self.filename = newname 386 | self.write() 387 | self.filename = oldname 388 | 389 | def _fix(self): 390 | '''Format values correctly''' 391 | 392 | for k, v in self.items(): 393 | if v: 394 | if type(v) is list: 395 | self[k] = ','.join(v) 396 | else: 397 | self.pop(k) 398 | 399 | if self.filename: 400 | self['name'] = os.path.basename(self.filename) 401 | 402 | if 'type' in self: 403 | self['type'] = self['type'].upper() 404 | 405 | if 'host' in self: 406 | h = self['host'] 407 | if h.find(':') >= 0: 408 | h = h.split(':') 409 | self['host'] = h[0] 410 | self['port'] = h[1] 411 | 412 | ints = ['port', 'maxsize', 'persistence'] 413 | for k in ints: 414 | if k in self: 415 | self[k] = int(self[k]) 416 | 417 | def for_upload(self): 418 | '''Prepare a service for uploading''' 419 | 420 | s = defaults 421 | s.merge(self) 422 | 423 | timestamp = datetime.datetime.utcnow().strftime(s['format']) 424 | s['path'] = s['path'].replace('', timestamp) 425 | 426 | # Replace placeholders in url 427 | if 'url' in s: 428 | url_replace = { 429 | '': timestamp, 430 | '': s['path'] 431 | } 432 | url = s['url'] 433 | for k, v in url_replace.items(): 434 | url = url.replace(k, v) 435 | # Must be done after other replaces to function correctly 436 | url = url.replace(' ', '%20') 437 | s['url'] = url 438 | 439 | # Ensure trailing '/', after url replace 440 | if s['path']: 441 | s['path'] = os.path.normpath(s['path']) 442 | else: 443 | s['path'] = os.curdir 444 | s['path'] += os.sep 445 | 446 | return s 447 | 448 | 449 | def _my_storbinary(self, cmd, fp, blocksize=8192, callback=None): 450 | '''Store a file in binary mode.''' 451 | 452 | self.voidcmd('TYPE I') 453 | conn = self.transfercmd(cmd) 454 | while True: 455 | buf = fp.read(blocksize) 456 | 457 | if not buf: 458 | break 459 | 460 | conn.sendall(buf) 461 | 462 | if callback: 463 | callback(buf) 464 | 465 | conn.close() 466 | return self.voidresp() 467 | 468 | 469 | def _my_storlines(self, cmd, fp, callback=None): 470 | '''Store a file in line mode.''' 471 | 472 | self.voidcmd('TYPE A') 473 | conn = self.transfercmd(cmd) 474 | while 1: 475 | buf = fp.readline() 476 | if not buf: 477 | break 478 | if buf[-2:] != CRLF: # CRLF is defined in ftplib. This code is valid 479 | if buf[-1] in CRLF: # after being patched into that context. See below 480 | buf = buf[:-1] 481 | buf = buf + CRLF 482 | conn.sendall(buf) 483 | if callback: 484 | callback(buf) 485 | conn.close() 486 | return self.voidresp() 487 | 488 | # Use the patched versions 489 | ftplib.FTP.storbinary = _my_storbinary 490 | ftplib.FTP.storlines = _my_storlines 491 | -------------------------------------------------------------------------------- /usr/share/linuxmint/mintupload/manager_window.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | False 7 | center 8 | 440 9 | 307 10 | 11 | 12 | 13 | 14 | 15 | True 16 | False 17 | queue 18 | vertical 19 | 20 | 21 | True 22 | False 23 | 24 | 25 | False 26 | True 27 | 0 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | True 36 | False 37 | vertical 38 | 39 | 40 | True 41 | True 42 | in 43 | 44 | 45 | True 46 | False 47 | 48 | 49 | True 50 | True 51 | True 52 | False 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | True 63 | True 64 | 1 65 | 66 | 67 | 68 | 69 | True 70 | False 71 | icons 72 | False 73 | 1 74 | 75 | 76 | True 77 | False 78 | center 79 | True 80 | 81 | 82 | True 83 | False 84 | 85 | 86 | True 87 | True 88 | False 89 | Add 90 | 91 | 92 | True 93 | False 94 | xsi-list-add-symbolic 95 | 96 | 97 | 98 | 99 | False 100 | True 101 | 0 102 | 103 | 104 | 105 | 106 | True 107 | True 108 | False 109 | Remove 110 | 111 | 112 | True 113 | False 114 | xsi-list-remove-symbolic 115 | 116 | 117 | 118 | 119 | False 120 | True 121 | 1 122 | 123 | 124 | 125 | 126 | True 127 | True 128 | False 129 | Edit 130 | 131 | 132 | True 133 | False 134 | xsi-document-edit-symbolic 135 | 136 | 137 | 138 | 139 | False 140 | True 141 | 2 142 | 143 | 144 | 145 | 146 | 147 | 148 | True 149 | True 150 | 151 | 152 | 155 | 156 | 157 | False 158 | True 159 | 1 160 | 161 | 162 | 163 | 164 | True 165 | True 166 | 4 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | FTP 180 | 181 | 182 | SFTP 183 | 184 | 185 | SCP 186 | 187 | 188 | 189 | 190 | False 191 | 6 192 | True 193 | center 194 | dialog 195 | True 196 | 197 | 198 | 199 | 200 | 201 | True 202 | False 203 | vertical 204 | 12 205 | 206 | 207 | True 208 | False 209 | end 210 | 211 | 212 | Check connection 213 | True 214 | True 215 | True 216 | 217 | 218 | False 219 | False 220 | 0 221 | 222 | 223 | 224 | 225 | gtk-ok 226 | True 227 | True 228 | True 229 | True 230 | 231 | 232 | False 233 | False 234 | 1 235 | 236 | 237 | 238 | 239 | False 240 | True 241 | end 242 | 0 243 | 244 | 245 | 246 | 247 | True 248 | False 249 | True 250 | 6 251 | 6 252 | 253 | 254 | True 255 | False 256 | Host: 257 | 0 258 | 259 | 260 | 0 261 | 0 262 | 263 | 264 | 265 | 266 | True 267 | True 268 | True 269 | True 270 | 271 | True 272 | 273 | 274 | 1 275 | 0 276 | 277 | 278 | 279 | 280 | True 281 | False 282 | Port: 283 | 0 284 | 285 | 286 | 2 287 | 0 288 | 289 | 290 | 291 | 292 | 50 293 | True 294 | True 295 | True 296 | 297 | True 298 | 299 | 300 | 3 301 | 0 302 | 303 | 304 | 305 | 306 | True 307 | False 308 | Type: 309 | 0 310 | 311 | 312 | 0 313 | 1 314 | 315 | 316 | 317 | 318 | True 319 | False 320 | model1 321 | 322 | 323 | 324 | 0 325 | 326 | 327 | 328 | 329 | 1 330 | 1 331 | 3 332 | 333 | 334 | 335 | 336 | True 337 | False 338 | User: 339 | 0 340 | 341 | 342 | 0 343 | 2 344 | 345 | 346 | 347 | 348 | True 349 | True 350 | 351 | True 352 | 353 | 354 | 1 355 | 2 356 | 3 357 | 358 | 359 | 360 | 361 | True 362 | False 363 | Password: 364 | 0 365 | 366 | 367 | 0 368 | 3 369 | 370 | 371 | 372 | 373 | True 374 | True 375 | False 376 | 377 | True 378 | 379 | 380 | 1 381 | 3 382 | 3 383 | 384 | 385 | 386 | 387 | True 388 | False 389 | Path: 390 | 0 391 | 392 | 393 | 0 394 | 4 395 | 396 | 397 | 398 | 399 | True 400 | True 401 | 402 | True 403 | 404 | 405 | 1 406 | 4 407 | 3 408 | 409 | 410 | 411 | 412 | True 413 | False 414 | Timestamp: 415 | 0 416 | 417 | 418 | 0 419 | 5 420 | 421 | 422 | 423 | 424 | True 425 | True 426 | 427 | True 428 | 429 | 430 | 1 431 | 5 432 | 3 433 | 434 | 435 | 436 | 437 | True 438 | True 439 | 0 440 | 441 | 442 | 443 | 444 | 445 | 446 | -------------------------------------------------------------------------------- /debian/changelog: -------------------------------------------------------------------------------- 1 | mintupload (4.2.3) zena; urgency=medium 2 | 3 | * Switch to XApp symbolic icons 4 | * Switch to XSI 5 | 6 | -- Clement Lefebvre Thu, 20 Nov 2025 14:58:37 +0000 7 | 8 | mintupload (4.2.2) xia; urgency=medium 9 | 10 | * Fix regression in 4.2.1 11 | 12 | -- Clement Lefebvre Mon, 25 Nov 2024 14:45:45 +0000 13 | 14 | mintupload (4.2.1) wilma; urgency=medium 15 | 16 | [ Vasanth R ] 17 | * fix: Patch for command injection vulnerability (#42) (#43) 18 | 19 | -- Clement Lefebvre Tue, 11 Jun 2024 13:47:57 +0100 20 | 21 | mintupload (4.2.0) uma; urgency=medium 22 | 23 | * Make the manager window a singleton 24 | 25 | -- Clement Lefebvre Wed, 26 May 2021 11:27:20 +0100 26 | 27 | mintupload (4.1.9) ulyssa; urgency=medium 28 | 29 | [ okaestne ] 30 | * remove some Gtk warnings 31 | * add .gitignore 32 | * Add COPYING 33 | * Dropzone UI rework 34 | * fix opacity of dropzone window, less opaque though 35 | * shrink the dropzone window a bit 36 | * dropzone: remove custom drag-active border color 37 | * [UI] dropzone: set solid border-style when active 38 | 39 | [ Clement Lefebvre ] 40 | * Improve the look of the manager UI 41 | 42 | -- Clement Lefebvre Mon, 30 Nov 2020 15:16:31 +0000 43 | 44 | mintupload (4.1.8) ulyana; urgency=medium 45 | 46 | * l10n: Generate files 47 | 48 | -- Clement Lefebvre Thu, 14 May 2020 08:38:10 +0100 49 | 50 | mintupload (4.1.7) ulyana; urgency=medium 51 | 52 | [ Michael Webster ] 53 | * all: Use python3. 54 | 55 | -- Clement Lefebvre Fri, 03 Apr 2020 12:07:38 +0100 56 | 57 | mintupload (4.1.6) tricia; urgency=medium 58 | 59 | * Switch tray to symbolic 60 | 61 | -- Clement Lefebvre Tue, 19 Nov 2019 14:24:50 +0000 62 | 63 | mintupload (4.1.5) tricia; urgency=medium 64 | 65 | * Add support for XAppStatusIcon 66 | * StatusIcon: Use new set_menu functions 67 | 68 | -- Clement Lefebvre Wed, 13 Nov 2019 11:57:07 +0100 69 | 70 | mintupload (4.1.4) tina; urgency=medium 71 | 72 | * About dialog: Fix the path for mintcommon's version.py 73 | * Fix generate_desktop_files 74 | * Inject the app version during the build 75 | 76 | -- Clement Lefebvre Sun, 30 Jun 2019 15:53:18 +0200 77 | 78 | mintupload (4.1.3) tessa; urgency=medium 79 | 80 | * Add support for window progress 81 | 82 | -- Clement Lefebvre Thu, 29 Nov 2018 15:07:01 +0000 83 | 84 | mintupload (4.1.2) tara; urgency=medium 85 | 86 | [ NikoKrause ] 87 | * fix ngettext not catching the translations (#37) 88 | 89 | [ Clement Lefebvre ] 90 | * l10n: Update files 91 | 92 | -- Clement Lefebvre Mon, 07 May 2018 12:31:42 +0100 93 | 94 | mintupload (4.1.1) sylvia; urgency=medium 95 | 96 | [ monsta ] 97 | * fix runtime dependencies 98 | * remove unused import 99 | * remove unused gi.require_version 100 | 101 | [ JosephMcc ] 102 | * Don't special case the systray icon in Mate (#34) 103 | 104 | [ NikoKrause ] 105 | * Translation: fetch time string with ngettext (#35) 106 | 107 | [ Clement Lefebvre ] 108 | * l10n: Update additional files 109 | 110 | -- Clement Lefebvre Fri, 27 Oct 2017 13:17:18 +0100 111 | 112 | mintupload (4.1.0) sonya; urgency=medium 113 | 114 | [ JosephMcc ] 115 | * Use a themable icon for the application and tray icon 116 | 117 | [ Clement Lefebvre ] 118 | * l10n: Update POT file 119 | * l10n: Generate desktop files 120 | 121 | -- Clement Lefebvre Sun, 07 May 2017 13:04:00 +0100 122 | 123 | mintupload (4.0.9) serena; urgency=medium 124 | 125 | * Use 22px PNG in indicator 126 | 127 | -- Clement Lefebvre Tue, 24 Jan 2017 15:30:50 +0000 128 | 129 | mintupload (4.0.8) sarah; urgency=medium 130 | 131 | * SFTP: Connect via SSH using key_filename if appropriate 132 | * Switch from StatusIcon to Indicator 133 | 134 | -- Clement Lefebvre Tue, 16 Aug 2016 16:55:43 +0200 135 | 136 | mintupload (4.0.7) sarah; urgency=medium 137 | 138 | * Manager: Fixed edit window getting destroyed when closing it from its window frame 139 | 140 | -- Clement Lefebvre Mon, 13 Jun 2016 13:40:45 +0100 141 | 142 | mintupload (4.0.6) sarah; urgency=medium 143 | 144 | * Fixed exec path and icon in XDG autostart 145 | * Fixed debian/links 146 | 147 | -- Clement Lefebvre Mon, 06 Jun 2016 11:10:04 +0100 148 | 149 | mintupload (4.0.5) sarah; urgency=medium 150 | 151 | [ Daniel Alley ] 152 | * Gtk3 conversion 153 | * Fixed duplicate object IDs causing GtkBuilder name conflicts 154 | * JosephM's Gtk3 fixes 155 | * Fix mistake made by the pygi-convert.sh script 156 | * Removed unused UI configuration code 157 | * Replaced deprecated widgets 158 | * Added horizontal/vertical expansion to the hostname text box 159 | * Added primary-toolbar stle class to the manager toolbar 160 | * Fixed threading issue in file-uploader.py 161 | * Converted name from camelCase to lowercase, moved icons and ui files from /usr/lib to /usr/share, recreated pot and desktop files accordingly 162 | * Refactoring names 163 | * Turned NotifyThread into daemon thead 164 | * Minor refactoring 165 | * Remove separate threading code in favor of built-in GLib funcitonality, un-broke menu positioning for Gtk 3.18 166 | * Fixed issue with service manager menu hiding while it was open 167 | * Only rebuild the menu if it needs to 168 | * Fixed quit menu item on file-uploader.py 169 | * Fixed issue where services would not be removed properly 170 | * Fixed Gtk warning - Dialog without 'set_transient_for' 171 | * Fixed Drop Zones 172 | * Fixed editing services failure 173 | * Minor refactoring 174 | * Fixed Gtk's breakage of saving settings 175 | * Fix warnings 176 | * Removed vestigial UI xml 177 | * Makepot 178 | * Fixed closing the About Dialog 179 | * Added border width to add service dialog 180 | * Add back compatibility for Mint 17 181 | 182 | -- Clement Lefebvre Fri, 13 May 2016 10:10:09 +0100 183 | 184 | mintupload (4.0.4) sarah; urgency=medium 185 | 186 | * Updated generated files 187 | 188 | -- Clement Lefebvre Fri, 22 Apr 2016 12:20:06 +0100 189 | 190 | mintupload (4.0.3) sarah; urgency=medium 191 | 192 | [ Daniel Alley ] 193 | * PEP8 formatting 194 | * minor refactoring (mostly naming consistency) 195 | * remove dh_python from the build process 196 | * removed dead code 197 | * left a comment to explain mysterious code 198 | * rearranged imports 199 | * refactoring for better encapsulation 200 | 201 | -- Clement Lefebvre Fri, 19 Feb 2016 12:21:10 +0000 202 | 203 | mintupload (4.0.2) rosa; urgency=medium 204 | 205 | [ monsta ] 206 | * Don't crash with glib >= 2.41 207 | * removed unused import 208 | 209 | [ Brian Millham ] 210 | * Fixes both spaces in filename problems and allows DSA authentication. 211 | 212 | [ Clement Lefebvre ] 213 | * Specify python version in shebangs, and updated desktop file 214 | * Changed default hostname from mint-space.com to hostname.com 215 | * Add service: Don't allow special chars or spaces in service name 216 | * Updated desktop files 217 | 218 | -- Clement Lefebvre Fri, 06 Nov 2015 18:10:22 +0000 219 | 220 | mintupload (4.0.1) rebecca; urgency=medium 221 | 222 | * Updated Debian files 223 | 224 | -- Clement Lefebvre Fri, 17 Oct 2014 10:59:20 +0200 225 | 226 | mintupload (3.9.9) qiana; urgency=low 227 | 228 | * [d25779e] Add trailing semicolon 229 | * [78e2207] Update translations 230 | 231 | -- Frédéric Gaudet Mon, 26 May 2014 13:42:08 +0200 232 | 233 | mintupload (3.9.8) qiana; urgency=low 234 | 235 | * [e3a2188] KDE desktop file generation 236 | * [d1e354f] GNOME based desktop file hidden in KDE 237 | * [b60e258] New KDE4 desktop file 238 | 239 | -- Frédéric Gaudet Mon, 26 May 2014 11:50:40 +0200 240 | 241 | mintupload (3.9.7) qiana; urgency=medium 242 | 243 | * Updated desktop file 244 | 245 | -- Clement Lefebvre Wed, 07 May 2014 21:43:56 +0100 246 | 247 | mintupload (3.9.6) qiana; urgency=medium 248 | 249 | * Updated desktop file 250 | 251 | -- Clement Lefebvre Sun, 04 May 2014 15:24:24 +0100 252 | 253 | mintupload (3.9.5) qiana; urgency=medium 254 | 255 | * Multiple fixes from Monsta 256 | 257 | -- Clement Lefebvre Mon, 07 Apr 2014 14:35:50 +0100 258 | 259 | mintupload (3.9.4) petra; urgency=low 260 | 261 | * Fix desktop file 262 | 263 | -- Frédéric Gaudet Fri, 08 Nov 2013 10:03:37 +0100 264 | 265 | mintupload (3.9.3) petra; urgency=low 266 | 267 | * Fixed pixelated alt-tab icon 268 | 269 | -- Clement Lefebvre Thu, 07 Nov 2013 10:14:05 +0000 270 | 271 | mintupload (3.9.2) petra; urgency=low 272 | 273 | * Fixed pixelated alt-tab icon 274 | 275 | -- Clement Lefebvre Wed, 30 Oct 2013 10:37:03 +0000 276 | 277 | mintupload (3.9.1) petra; urgency=low 278 | 279 | * Changed icon 280 | * Use a separated icon for systray 281 | 282 | -- Clement Lefebvre Sat, 19 Oct 2013 21:21:32 +0100 283 | 284 | mintupload (3.9.0) olivia; urgency=low 285 | 286 | * Replaced "funny characters" with "special characters" in the UI 287 | 288 | -- Clement Lefebvre Fri, 30 Aug 2013 16:36:22 +0100 289 | 290 | mintupload (3.8.9) olivia; urgency=low 291 | 292 | * Olivia 293 | 294 | -- Clement Lefebvre Tue, 12 Mar 2013 15:41:43 +0000 295 | 296 | mintupload (3.8.8) maya; urgency=low 297 | 298 | * Maya 299 | 300 | -- Clement Lefebvre Thu, 22 Mar 2012 13:49:00 +0000 301 | 302 | mintupload (3.8.7) lisa; urgency=low 303 | 304 | * Removed onlyShowIn clause in XDG autostart 305 | 306 | -- Clement Lefebvre Fri, 03 Feb 2012 18:18:06 +0000 307 | 308 | mintupload (3.8.6) lisa; urgency=low 309 | 310 | * In Gnome use the colored icon 311 | 312 | -- Clement Lefebvre Sat, 29 Oct 2011 11:39:00 +0000 313 | 314 | mintupload (3.8.5) lisa; urgency=low 315 | 316 | * Use $USER instead of $LOGNAME to ensure compatibility with Ubuntu 11.10 317 | 318 | -- Clement Lefebvre Fri, 07 Oct 2011 11:46:00 +0000 319 | 320 | mintupload (3.8.4) julia; urgency=low 321 | 322 | * Drag and drop compatibility with KDE 323 | * Changed icon to suit KDE. 324 | 325 | -- Clement Lefebvre Thu, 17 Feb 2011 13:45:00 +0000 326 | 327 | mintupload (3.8.3) julia; urgency=low 328 | 329 | * Added dependency on libnotify-bin 330 | 331 | -- Clement Lefebvre Thu, 30 Sep 2010 10:44:00 +0000 332 | 333 | mintupload (3.8.2) julia; urgency=low 334 | 335 | * Monochrome tray icon (using icon name "up") 336 | 337 | -- Clement Lefebvre Wed, 29 Sep 2010 10:11:00 +0000 338 | 339 | mintupload (3.8.1) julia; urgency=low 340 | 341 | * Fixed gettext issue 342 | 343 | -- Clement Lefebvre Wed, 22 Sep 2010 17:56:00 +0000 344 | 345 | mintupload (3.8.0) julia; urgency=low 346 | 347 | * Check connection 348 | * UI improvements 349 | * Cancel on-going upload 350 | * Overall progress, speed and ETA 351 | 352 | -- Clement Lefebvre Wed, 22 Sep 2010 16:56:00 +0000 353 | 354 | mintupload (3.7.9) julia; urgency=low 355 | 356 | * Only the manager is in the menu now, the systray icon is launched by XDG. 357 | 358 | -- Clement Lefebvre Tue, 21 Sep 2010 11:38:00 +0000 359 | 360 | mintupload (3.7.8) isadora; urgency=low 361 | 362 | * Updated desktop file 363 | 364 | -- Clement Lefebvre Fri, 14 May 2010 10:55:00 +0000 365 | 366 | mintupload (3.7.7) isadora; urgency=low 367 | 368 | * Doesn't hang when closed anymore (replaced calls to pyinotify with in-house loop) 369 | 370 | -- Clement Lefebvre Thu, 13 May 2010 10:46:00 +0000 371 | 372 | mintupload (3.7.6) isadora; urgency=low 373 | 374 | * Added /etc/linuxmint/mintUpload/services dir by default 375 | 376 | -- Clement Lefebvre Mon, 12 Apr 2010 10:47:00 +0000 377 | 378 | mintupload (3.7.5) helena; urgency=low 379 | 380 | * New GUI, functional for Mint 8. 381 | * Lost support for url, will have to be added again. 382 | 383 | -- Clement Lefebvre Tue, 3 Nov 2009 17:51:00 +0000 384 | 385 | mintupload (3.7.4) helena; urgency=low 386 | 387 | * more detailed error messages in terminal 388 | * multiuploads are now single-threaded 389 | * fixed multiupload url reporting 390 | * removing backwards compatible messages 391 | * misc fixes 392 | 393 | -- Philip Morrell Thu, 10 Sep 2009 12:33:03 +0100 394 | 395 | mintupload (3.7.3) helena; urgency=low 396 | 397 | * fixing gettext bug preventing startup 398 | * fixing version number usage 399 | * fixing erroneous wTree usage in Core (notifications) 400 | 401 | -- Philip Morrell Tue, 04 Aug 2009 20:52:29 +0100 402 | 403 | mintupload (3.7.2) helena; urgency=low 404 | 405 | * fully implemented generic-branding 406 | * making edit window use instant-apply (HIG) 407 | * fixing autoselect bug 408 | 409 | -- Philip Morrell Thu, 30 Jul 2009 10:45:15 +0100 410 | 411 | mintupload (3.7.1) jaunty; urgency=low 412 | 413 | * adding file > Open menu item 414 | * adding file menu keyboard shortcuts 415 | * adding toolbar tooltips 416 | * fixing about box 417 | * fixing edit_services problem 418 | * fixing host tooltip 419 | * conforming to gnome HIGs more closely 420 | 421 | -- Philip Morrell Fri, 24 Jul 2009 13:49:22 +0100 422 | 423 | mintupload (3.7) jaunty; urgency=low 424 | 425 | * multiple file upload with drag and drop 426 | * adding Menu launcher 427 | * simplified adding/copying/renaming a new service 428 | * sftp now uses progress bar 429 | * service autoselect on launch 430 | * removed branding 431 | * removed dependency on mintsystem 432 | 433 | -- Philip Morrell Thu, 23 Jul 2009 19:30:55 +0100 434 | 435 | mintupload (3.6.1) jaunty; urgency=low 436 | 437 | * fixes spaces in filename affecting url output 438 | * upload button now i18ned #399302 439 | * progressbar not needed after 100%, so replaced with url if defined 440 | * fixes autoselection when only one service is defined 441 | * fixes removal of services with spaces in name 442 | * gladefile cleaning 443 | 444 | -- Philip Morrell Mon, 20 Jul 2009 15:33:19 +0100 445 | 446 | mintupload (3.6) jaunty; urgency=low 447 | 448 | * autocopy of url to clipboard - kinkerl 449 | * integration with jaunty's notification system - kinkerl 450 | * much improved error handling - kinkerl 451 | * large amount of code cleanup, hence better stability 452 | 453 | -- Philip Morrell Wed, 15 Jul 2009 16:45:42 +0100 454 | 455 | mintupload (3.5.2) jaunty; urgency=low 456 | 457 | * small bugfixes 458 | * general code cleanup by kinkerl 459 | * no longer packaged with git database 460 | 461 | -- Philip Morrell Mon, 13 Jul 2009 17:12:26 +0100 462 | 463 | mintupload (3.5.1) jaunty; urgency=low 464 | 465 | * bugfix release: 466 | * scp can use custom port 467 | * enabling text beside icons 468 | * no longer assumes url is defined 469 | * enables upload button for minimum service config 470 | 471 | -- Philip Morrell Fri, 26 Jun 2009 11:46:43 +0100 472 | 473 | mintupload (3.5) jaunty; urgency=low 474 | 475 | * Spaces in URLs are now encoded for correct auto-linking e.g. IRC 476 | * Allows customisation of e.g. filesize output, defaults 477 | * CLI usage hints by kinkerl 478 | * More verbose output when run from terminal, including progressbar 479 | * Removed clem's v3.1 scp fix in favour of a comment 480 | * Better error handling 481 | * Sufficient abstraction for writing multiple UIs (CLI/QT etc.) 482 | 483 | -- Philip Morrell Thu, 21 May 2009 18:20:45 +0100 484 | 485 | mintupload (3.3.4) gloria; urgency=low 486 | 487 | * merlwiz's text beside icons bugfix #399705 488 | 489 | -- Philip Morrell Mon, 20 Jul 2009 20:38:47 +0100 490 | 491 | mintupload (3.3.3) gloria; urgency=low 492 | 493 | * Updated translations 494 | 495 | -- Clement Lefebvre Tue, 19 May 2009 19:53:00 +0000 496 | 497 | mintupload (3.3.2) gloria; urgency=low 498 | 499 | * Updated translations 500 | 501 | -- Clement Lefebvre Sun, 17 May 2009 22:46:00 +0000 502 | 503 | mintupload (3.3.1) gloria; urgency=low 504 | 505 | * Added translations 506 | 507 | -- Clement Lefebvre Sun, 17 May 2009 22:12:00 +0000 508 | 509 | mintupload (3.3) gloria; urgency=low 510 | 511 | * Localized hardcoded string line #291 512 | 513 | -- Clement Lefebvre Wed, 6 May 2009 15:59:00 +0000 514 | 515 | mintupload (3.2) gloria; urgency=low 516 | 517 | * Localized hardcoded messages when SCP fails to find password/key 518 | * Moved space char out of localization for successful connection messages 519 | 520 | -- Clement Lefebvre Wed, 6 May 2009 15:27:00 +0000 521 | 522 | mintupload (3.1) gloria; urgency=low 523 | 524 | * Fix for passwordless SCP profiles 525 | 526 | -- Clement Lefebvre Wed, 22 Apr 2009 18:24:00 +0000 527 | 528 | mintupload (3.0.4) gloria; urgency=low 529 | 530 | * Fix for selected services containing underscores. 531 | 532 | -- Clement Lefebvre Mon, 13 Apr 2009 21:25:00 +0000 533 | 534 | mintupload (3.0.3) gloria; urgency=low 535 | 536 | * About dialog use "mint-apt-version" 537 | * Added Dennis Schwertel to credits 538 | * Changed main combo to normal combobox widget as opposed to comboboxentry widget 539 | 540 | -- Clement Lefebvre Sat, 11 Apr 2009 9:36:00 +0000 541 | 542 | mintupload (3.0.2) gloria; urgency=low 543 | 544 | * Many little improvements suggested by Philip Morrell. 545 | 546 | -- Clement Lefebvre Sat, 11 Apr 2009 9:36:00 +0000 547 | 548 | mintupload (3.0.1) gloria; urgency=low 549 | 550 | * New GUI to edit services 551 | * About dialog use APT to know version number 552 | 553 | -- Clement Lefebvre Fri, 10 Apr 2009 18:38:00 +0000 554 | 555 | mintupload (2.1.5) gloria; urgency=low 556 | 557 | * Removed copy button 558 | * Made Mint-Space related fields only appear when mint service is selected 559 | * Changed GUI style from Mint-Style to Gnome 560 | * Made progress information only appear when upload starts. 561 | * Made url info only appear when upload finished for a mint service. 562 | * Made window resize automatically. 563 | 564 | -- Clement Lefebvre Fri, 10 Apr 2009 13:09:00 +0000 565 | 566 | mintupload (2.1.4) gloria; urgency=low 567 | 568 | * Added /usr/bin/mintupload 569 | 570 | -- Clement Lefebvre Fri, 10 Apr 2009 11:40:00 +0000 571 | 572 | mintupload (2.1.3) felicia; urgency=low 573 | 574 | * addition of a port config option by kinkerl 575 | * all config lines are now optional, with sensible defaults 576 | * config lines fully documented in /etc/linuxmint/mintUpload/services/Default 577 | * ssh can use private keys from ~/.ssh 578 | * bugfixes 579 | 580 | -- Philip Morrell Thu, 02 Apr 2009 01:43:34 +0100 581 | 582 | mintupload (2.1.2) felicia; urgency=low 583 | 584 | * allow non-mint services to set all config options by kinkerl 585 | * ignore hidden and backup files in services directories by kinkerl 586 | * allow placeholder in path by kinkerl 587 | * addition of a timestamp format config option 588 | * makes parent directories in path as needed (not scp) 589 | * general code cleanup and optimisations 590 | * important fix for error reporting bug introduced in v2.1.1 591 | 592 | -- Philip Morrell Tue, 31 Mar 2009 03:12:00 +0000 593 | 594 | mintupload (2.1.1) felicia; urgency=low 595 | 596 | * upgraded python-pexpect and python-paramiko to full dependencies 597 | * trailing '/' in path now optional 598 | * scp bugfixes by jayemdaet 599 | * misc bugfixes 600 | 601 | -- Philip Morrell Mon, 16 Mar 2009 13:41:00 +0000 602 | 603 | mintupload (2.1) felicia; urgency=low 604 | 605 | * scp Support added by jayemdaet 606 | * ssh/sftp Support added 607 | * more natural handling of multiple transfer protocols 608 | 609 | -- Philip Morrell Fri, 27 Feb 2009 13:13:00 +0000 610 | 611 | mintupload (2.0.2) felicia; urgency=low 612 | 613 | * New translations 614 | 615 | -- Clement Lefebvre Sat, 6 Dec 2008 00:24:00 +0000 616 | 617 | mintupload (2.0.1) elyssa; urgency=low 618 | 619 | * If an error occurs, the cause of the error is now shown in the statusbar 620 | * Services files are now read from ~/.linuxmint/mintUpload/services as well as /etc/linuxmint/mintUpload/services 621 | * Added translations for ca cs da de ja lt nl pt_BR ro sk ko 622 | 623 | -- Clement Lefebvre Mon, 13 Oct 2008 20:30:00 +0000 624 | 625 | mintupload (2.0) elyssa; urgency=low 626 | 627 | * FTP Support added 628 | 629 | -- Clement Lefebvre Sun, 5 Oct 2008 19:49:00 +0000 630 | 631 | mintupload (1.4) elyssa; urgency=low 632 | 633 | * Window is now centered 634 | * Better GUI 635 | * i18n 636 | * email feature replaced by copy to buffer feature 637 | 638 | -- Clement Lefebvre Tue, 11 Mar 2008 16:15:00 +0000 639 | 640 | mintupload (1.3) celena; urgency=low 641 | 642 | * Removed dependency on nautilus-actions 643 | 644 | -- clem Wed, 26 Dec 2007 14:00:00 +0000 645 | 646 | mintupload (1.2) celena; urgency=low 647 | 648 | * Fine-tuned for compatibility with mint-space 649 | * Better error reporting in CLI mode 650 | 651 | -- clem Mon, 20 Aug 2007 16:56:00 +0000 652 | 653 | mintupload (1.1) cassandra; urgency=low 654 | 655 | * Added an email button to compose a mail with thunderbird 656 | * Added persistence information 657 | * Closing the window now closes the process 658 | * Better layout in the GUI 659 | 660 | -- clem Thu, 2 Aug 2007 23:24:00 +0000 661 | 662 | mintupload (1.0) cassandra; urgency=low 663 | 664 | * Initial release 665 | 666 | -- clem Thu, 2 Aug 2007 18:32:00 +0000 667 | 668 | -------------------------------------------------------------------------------- /usr/share/icons/hicolor/scalable/apps/mintupload-tray.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 20 | 40 | 42 | 44 | 48 | 52 | 53 | 55 | 59 | 63 | 64 | 66 | 70 | 74 | 75 | 77 | 81 | 85 | 86 | 88 | 92 | 96 | 97 | 99 | 103 | 107 | 108 | 110 | 114 | 118 | 119 | 121 | 125 | 129 | 130 | 138 | 142 | 146 | 147 | 149 | 153 | 157 | 158 | 166 | 169 | 172 | 173 | 180 | 183 | 184 | 192 | 200 | 209 | 217 | 225 | 233 | 242 | 251 | 259 | 268 | 278 | 287 | 289 | 293 | 297 | 298 | 308 | 317 | 326 | 329 | 332 | 333 | 342 | 344 | 349 | 350 | 353 | 356 | 357 | 366 | 375 | 377 | 382 | 383 | 391 | 400 | 402 | 406 | 410 | 411 | 413 | 418 | 419 | 428 | 437 | 446 | 453 | 457 | 461 | 465 | 469 | 473 | 477 | 481 | 485 | 489 | 493 | 494 | 502 | 504 | 508 | 512 | 513 | 521 | 529 | 533 | 537 | 538 | 547 | 556 | 565 | 574 | 583 | 593 | 603 | 612 | 622 | 632 | 642 | 643 | 645 | 646 | 648 | image/svg+xml 649 | 651 | 652 | 653 | 654 | 663 | 704 | 707 | 710 | 715 | 720 | 731 | 736 | 741 | 748 | 753 | 758 | 762 | 767 | 772 | 773 | 774 | 775 | 776 | -------------------------------------------------------------------------------- /COPYING: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | 635 | Copyright (C) 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | Copyright (C) 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | --------------------------------------------------------------------------------