~kees/ubuntu-accomplishments-system/validation-service-path-fix

« back to all changes in this revision

Viewing changes to libaccomplishments/__init__.py

  • Committer: Jono Bacon
  • Date: 2012-03-05 23:42:02 UTC
  • Revision ID: jono@ubuntu.com-20120305234202-76a7amz5yft72lb2
Re-factored the validation service based on the new module import in the accomplishment scripts.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
import os
2
 
 
3
 
class Accomplishments():
4
 
    def __init__(self):
5
 
        print "getting auth data"
6
 
 
7
 
    def getExtraInformation(self, app, info):
8
 
        trophypath = os.environ['ACCOMTROPHYPATH']
9
 
 
10
 
        a = os.path.split(trophypath)
11
 
        b = os.path.split(a[0])
12
 
        print b[0]
13
 
 
14
 
        extrapath = b[0] + "/" + ".extrainformation/"
15
 
 
16
 
        f = open(extrapath + info)
17
 
 
18
 
        data = f.read()
19
 
 
20
 
        final = [{info : data.rstrip('\n')}]
21
 
        print 
22
 
 
23
 
        return final