~ubuntu-branches/debian/sid/postr/sid

« back to all changes in this revision

Viewing changes to src/util.py

  • Committer: Package Import Robot
  • Author(s): Alexander Alemayhu
  • Date: 2014-07-06 10:50:07 UTC
  • mto: This revision was merged to the branch mainline in revision 15.
  • Revision ID: package-import@ubuntu.com-20140706105007-rhbk6td6g8q997ul
Tags: upstream-0.13.1
ImportĀ upstreamĀ versionĀ 0.13.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
# St, Fifth Floor, Boston, MA 02110-1301 USA
17
17
 
18
18
import gtk, os
19
 
 
 
19
import bsddb3
20
20
 
21
21
def greek(size):
22
22
    """Take a quantity (like 1873627) and display it in a human-readable rounded
71
71
    """Lookup the buddyicon from the data in @data using @flickr and resize it
72
72
    to @size pixels."""
73
73
    from twisted.web.client import getPage
74
 
    import bsddb3
75
74
 
76
75
    global __buddy_cache
77
76
    if __buddy_cache is None:
98
97
        return load_thumb(page, size)
99
98
    
100
99
    if int(data.get("iconfarm")) > 0:
101
 
        url = "http://farm%s.static.flickr.com/%s/buddyicons/%s.jpg" % (data.get("iconfarm"), data.get("iconserver"), data.get("nsid"))
 
100
        url = "https://farm%s.static.flickr.com/%s/buddyicons/%s.jpg" % (data.get("iconfarm"), data.get("iconserver"), data.get("nsid"))
102
101
    else:
103
 
        url = "http://www.flickr.com/images/buddyicon.jpg"
 
102
        url = "https://www.flickr.com/images/buddyicon.jpg"
104
103
 
105
104
    if __buddy_cache.has_key(url):
106
105
        from twisted.internet import defer