~ubuntu-branches/ubuntu/utopic/postr/utopic

« back to all changes in this revision

Viewing changes to debian/patches/05-use-https-where-needed-for-flickr.patch

  • Committer: Package Import Robot
  • Author(s): Alexander Alemayhu
  • Date: 2014-07-06 10:50:07 UTC
  • mfrom: (1.1.8) (12.1.3 sid)
  • Revision ID: package-import@ubuntu.com-20140706105007-oe2fuzx7w11mt8p8
Tags: 0.13.1-1
* New upstream release version 0.13.1
* debian/patches:
  - 05-use-https-where-needed-for-flickr.patch removed, upstream added our
    patch to their release :)
  - 02-fix-glade-path.patch removed, this patch is not needed anymore.

* Upload sponsored by Petter Reinholdtsen.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
Author: Alexander Alemayhu<alexander@bitraf.no>
2
 
Description: Replace http with https for the flickr urls.
3
 
Forwarded: no
4
 
 
5
 
--- a/src/SetCombo.py
6
 
+++ b/src/SetCombo.py
7
 
@@ -82,7 +82,7 @@ class SetCombo(gtk.ComboBox):
8
 
                            0, photoset.get("id"),
9
 
                            1, photoset.find("title").text)
10
 
 
11
 
-            url = "http://static.flickr.com/%s/%s_%s%s.jpg" % (photoset.get("server"), photoset.get("primary"), photoset.get("secret"), "_s")
12
 
+            url = "https://static.flickr.com/%s/%s_%s%s.jpg" % (photoset.get("server"), photoset.get("primary"), photoset.get("secret"), "_s")
13
 
             getPage (url).addCallback(self.__got_set_thumb, it).addErrback(self.twisted_error)
14
 
 
15
 
     def update(self):
16
 
--- a/src/flickrest.py
17
 
+++ b/src/flickrest.py
18
 
@@ -47,7 +47,7 @@ class FlickrError(Exception):
19
 
  SIZE_LARGE) = range (0, 5)
20
 
 
21
 
 class Flickr:
22
 
-    endpoint = "http://api.flickr.com/services/rest/?"
23
 
+    endpoint = "https://api.flickr.com/services/rest/?"
24
 
     
25
 
     def __init__(self, api_key, secret, perms="read"):
26
 
         self.__methods = {}
27
 
@@ -73,7 +73,7 @@ class Flickr:
28
 
     def set_proxy(self, proxy):
29
 
         # Handle proxies which are not URLs
30
 
         if proxy and "://" not in proxy:
31
 
-            proxy = "http://" + proxy
32
 
+            proxy = "https://" + proxy
33
 
         self.proxy = proxy
34
 
     
35
 
     def __repr__(self):
36
 
@@ -208,7 +208,7 @@ class Flickr:
37
 
             }
38
 
 
39
 
         self.logger.info("Calling upload")
40
 
-        return client.upload("http://api.flickr.com/services/upload/",
41
 
+        return client.upload("https://api.flickr.com/services/upload/",
42
 
                              proxy=self.proxy, method="POST",
43
 
                              headers=headers, postdata=form,
44
 
                              progress_tracker=progress_tracker).addCallback(self.__cb, "upload")
45
 
@@ -245,7 +245,7 @@ class Flickr:
46
 
             keys = { 'perms': self.perms,
47
 
                      'frob': frob }
48
 
             self.__sign(keys)
49
 
-            url = "http://flickr.com/services/auth/?api_key=%(api_key)s&perms=%(perms)s&frob=%(frob)s&api_sig=%(api_sig)s" % keys
50
 
+            url = "https://flickr.com/services/auth/?api_key=%(api_key)s&perms=%(perms)s&frob=%(frob)s&api_sig=%(api_sig)s" % keys
51
 
             return {'url': url, 'frob': frob}
52
 
         return self.auth_getFrob().addCallback(gotFrob)
53
 
 
54
 
@@ -299,4 +299,4 @@ class Flickr:
55
 
         elif size == SIZE_LARGE:
56
 
             suffix = "_b"
57
 
 
58
 
-        return "http://static.flickr.com/%s/%s_%s%s.jpg" % (photo.get("server"), photo.get("id"), photo.get("secret"), suffix)
59
 
+        return "https://static.flickr.com/%s/%s_%s%s.jpg" % (photo.get("server"), photo.get("id"), photo.get("secret"), suffix)
60
 
--- a/src/postr.py
61
 
+++ b/src/postr.py
62
 
@@ -223,11 +223,11 @@ class Postr(UniqueApp):
63
 
                 user = client.get_string("/system/http_proxy/authentication_user")
64
 
                 password = client.get_string("/system/http_proxy/authentication_password")
65
 
                 if user and user != "":
66
 
-                    url = "http://%s:%s@%s:%d" % (user, password, host, port)
67
 
+                    url = "https://%s:%s@%s:%d" % (user, password, host, port)
68
 
                 else:
69
 
-                    url = "http://%s:%d" % (host, port)
70
 
+                    url = "https://%s:%d" % (host, port)
71
 
             else:
72
 
-                url = "http://%s:%d" % (host, port)
73
 
+                url = "https://%s:%d" % (host, port)
74
 
 
75
 
             self.flickr.set_proxy(url)
76
 
         else:
77
 
--- a/src/util.py
78
 
+++ b/src/util.py
79
 
@@ -98,9 +98,9 @@ def get_buddyicon(flickr, data, size=48)
80
 
         return load_thumb(page, size)
81
 
     
82
 
     if int(data.get("iconfarm")) > 0:
83
 
-        url = "http://farm%s.static.flickr.com/%s/buddyicons/%s.jpg" % (data.get("iconfarm"), data.get("iconserver"), data.get("nsid"))
84
 
+        url = "https://farm%s.static.flickr.com/%s/buddyicons/%s.jpg" % (data.get("iconfarm"), data.get("iconserver"), data.get("nsid"))
85
 
     else:
86
 
-        url = "http://www.flickr.com/images/buddyicon.jpg"
87
 
+        url = "https://www.flickr.com/images/buddyicon.jpg"
88
 
 
89
 
     if __buddy_cache.has_key(url):
90
 
         from twisted.internet import defer