abnd90 / py-cloudapp Goto Github PK
View Code? Open in Web Editor NEWA drag drop uploader to cloudapp (PyQt)
Home Page: abhinandh.com
License: GNU General Public License v3.0
A drag drop uploader to cloudapp (PyQt)
Home Page: abhinandh.com
License: GNU General Public License v3.0
Since I don't know anything about python nor Gnome Shell-extensions, I don't know if it's possible. But maybe you do, so I'd like to ask if it is possible to make it an extension. Because that is, I think, more usefull than a permanent black box.
I want to suggest that the droptarget automatically slides when hovered (maybe only when something can be dropped).
Edit: Sorry, didn't see libnotify-message...
This currently chokes horribly on unicode domains, one of which I use. I've done a quick hack job to make domains that are only unicode use the punycode encoding that ships with Python, but my testing is extremely limited. That's why this is an issue, not a pull request.
The git patch is below.
From 0d802d3fe71b4127c5786c4259a85c653cc14968 Mon Sep 17 00:00:00 2001
From: Paddy Foran <[email protected]>
Date: Mon, 21 May 2012 16:43:51 -0400
Subject: [PATCH] Translated unicode domains using the idna punycode codec.
---
cloudhandle.py | 8 ++++++++
trayicon.py | 14 ++++++++++++--
2 files changed, 20 insertions(+), 2 deletions(-)
diff --git a/cloudhandle.py b/cloudhandle.py
index 1a5346b..ba4426a 100755
--- a/cloudhandle.py
+++ b/cloudhandle.py
@@ -9,6 +9,8 @@ import urlparse
from preferences import PreferencesDialog
+from encodings import idna
+
class CloudHandle(object):
fileList = []
@@ -53,6 +55,12 @@ class CloudHandle(object):
self.fileList.pop()
self.signals.gotFileList.emit(self.fileList)
if self.pdialog.settings['auto_clipboard']:
+ value = item['url'].split("/")
+ domain = value[2].split(".")
+ domain[0] = idna.ToASCII(domain[0])
+ domain = ".".join(domain)
+ value[2] = domain
+ item['url'] = "/".join(value)
self.signals.loadClipboard.emit(item['url'])
if self.pdialog.settings['notifications']:
if item['item_type'] == 'bookmark':
diff --git a/trayicon.py b/trayicon.py
index 4b4b992..a0ba9fa 100755
--- a/trayicon.py
+++ b/trayicon.py
@@ -8,6 +8,7 @@ from PyQt4.QtCore import QString, QThread, QFileInfo, QUrl, QObject, pyqtSignal,
from cloudhandle import CloudHandle
import icons_rc
+from encodings import idna
class TrayIcon(QSystemTrayIcon):
@@ -68,9 +69,18 @@ class TrayIcon(QSystemTrayIcon):
#PyQt converts all Strings to QStrings, converting back.
l = []
for item in fileList:
- m = {}
+ m = {}
for key in item:
- m[str(key)] = str(item[key])
+ value = item[key]
+ key = str(key)
+ if key == "url" or key == "content_url":
+ value = value.split("/")
+ domain = value[2].split(".")
+ domain[0] = idna.ToASCII(domain[0])
+ domain = ".".join(domain)
+ value[2] = domain
+ value = "/".join(value)
+ m[key] = str(value)
l.append(m)
self.fileList = l
--
1.7.5.4
Title says it all.
I'm using Ubuntu 12.10.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.