Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 112550 | Differences between
and this patch

Collapse All | Expand All

(-)flickrapi.py.ORIG (-1 / +1 lines)
Lines 1-4 Link Here
1
#!/usr/bin/python
1
#!python
2
#
2
#
3
# Flickr API implementation
3
# Flickr API implementation
4
#
4
#
(-)flickrfs.conf (+18 lines)
Line 0 Link Here
1
[USER]
2
3
# for out-of-band auth inside a web browser
4
browserName  : /usr/bin/firefox
5
6
7
#-------------------------------------------------------------------
8
9
# It is not necessary to change these. They just identifies this as
10
# this application as flickrfs so that flickr.com can track the 
11
# usage by different api's
12
13
# API key
14
flickrAPIKey : f8aa9917a9ae5e44a87cae657924f42d
15
16
# shared "secret"
17
flickrSecret : 3fbf7144be7eca28
18
(-)flickrfs.py.ORIG (-1 / +8 lines)
Lines 1-3 Link Here
1
#!python
1
#===============================================================================
2
#===============================================================================
2
#  flickrfs - Virtual Filesystem for Flickr
3
#  flickrfs - Virtual Filesystem for Flickr
3
#  Copyright (c) 2005,2006 Manish Rai Jain  <manishrjain@gmail.com>
4
#  Copyright (c) 2005,2006 Manish Rai Jain  <manishrjain@gmail.com>
Lines 23-29 Link Here
23
import threading
24
import threading
24
import random, commands
25
import random, commands
25
from urllib2 import URLError
26
from urllib2 import URLError
26
from transactions import TransFlickr
27
from transactions import TransFlickr, read_config
27
import inodes
28
import inodes
28
29
29
#Some global definitions and functions
30
#Some global definitions and functions
Lines 1075-1080 Link Here
1075
1076
1076
1077
1077
if __name__ == '__main__':
1078
if __name__ == '__main__':
1079
1080
  config = read_config()
1081
  flickrAPIKey = config.get('USER', 'flickrAPIKey')
1082
  flickrSecret = config.get('USER', 'flickrSecret')
1083
  browserName  = config.get('USER', 'browserName')
1084
1078
  try:
1085
  try:
1079
    server = Flickrfs()
1086
    server = Flickrfs()
1080
    server.multithreaded = 1;
1087
    server.multithreaded = 1;
(-)transactions.py.ORIG (-5 / +24 lines)
Lines 22-30 Link Here
22
import os
22
import os
23
import time
23
import time
24
24
25
# flickr auth information
25
# Import ConfigParser
26
flickrAPIKey = "f8aa9917a9ae5e44a87cae657924f42d"  # API key
26
from ConfigParser import ConfigParser
27
flickrSecret = "3fbf7144be7eca28"  # shared "secret"
27
28
def read_config(config_file = '/etc/flickrfs/flickrfs.conf'):
29
  defaults = {
30
    'flickrAPIKey'    : "f8aa9917a9ae5e44a87cae657924f42d",  # API key
31
    'flickrSecret'    : "3fbf7144be7eca28",                  # shared "secret"
32
    'browserName'     : "/usr/bin/firefox",}                 # for out-of-band auth inside a web browser
33
34
  config = ConfigParser(defaults)
35
  config.add_section('USER')
36
37
  if os.access(config_file, os.R_OK):
38
    config.read(config_file)
39
40
  return config
28
41
29
# Utility functions
42
# Utility functions
30
def kwdict(**kw): return kw
43
def kwdict(**kw): return kw
Lines 38-44 Link Here
38
  def __init__(self, logg, browserName):
51
  def __init__(self, logg, browserName):
39
    global log
52
    global log
40
    log = logg
53
    log = logg
41
    self.fapi = FlickrAPI(flickrAPIKey, flickrSecret)
54
55
    config = read_config()
56
    self.flickrAPIKey = config.get('USER', 'flickrAPIKey')
57
    self.flickrSecret = config.get('USER', 'flickrSecret')
58
    self.browserName  = config.get('USER', 'browserName')
59
60
    self.fapi = FlickrAPI(self.flickrAPIKey, self.flickrSecret)
42
    self.user_id = ""
61
    self.user_id = ""
43
    # proceed with auth
62
    # proceed with auth
44
    # TODO use auth.checkToken function if available, 
63
    # TODO use auth.checkToken function if available, 
Lines 302-308 Link Here
302
    return (bw['max'], bw['used'])
321
    return (bw['max'], bw['used'])
303
322
304
  def getUserId(self):
323
  def getUserId(self):
305
    rsp = self.fapi.auth_checkToken(api_key=flickrAPIKey, 
324
    rsp = self.fapi.auth_checkToken(api_key=self.flickrAPIKey, 
306
                                    auth_token=self.authtoken)
325
                                    auth_token=self.authtoken)
307
    if not rsp:
326
    if not rsp:
308
      log.error("Unable to get userid:" + rsp.errormsg)
327
      log.error("Unable to get userid:" + rsp.errormsg)
(-)setup.py (+20 lines)
Line 0 Link Here
1
#!/usr/bin/env python
2
3
import sys
4
5
from distutils.core import setup
6
7
# this affects the names of all the directories we do stuff with
8
sys.path.insert(0, './')
9
10
setup(name          = 'flickrfs',
11
      version       = '1.3.9',
12
      description   = 'A virtual filesystem that provides easy access to flickr',
13
      author        = 'Manish Rai Jain',
14
      author_email  = 'manishrjain@gmail.com',
15
      url           = 'http://flickrfs.sourceforge.net/',
16
      scripts       = ['flickrfs'],
17
      py_modules    = ['flickrapi', 'inodes', 'transactions'],
18
      data_files    = [('/etc/flickrfs', ['flickrfs.conf'])],
19
      license       = 'GPL',
20
      )

Return to bug 112550