GithubHelp home page GithubHelp logo

py-cloudapp's People

Contributors

abnd90 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

py-cloudapp's Issues

Chokes on Unicode

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

Gnome Shell extension

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.