Subversion Repositories SmartDukaan

Rev

Rev 5291 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 5291 Rev 5401
Line 22... Line 22...
22
        return watchlist
22
        return watchlist
23
    
23
    
24
    def save(self, entity):
24
    def save(self, entity):
25
        try:
25
        try:
26
            f = open(self.watchlistFilePath, 'r')
26
            f = open(self.watchlistFilePath, 'r')
27
            jsonStr = f.read() 
27
            jsonStr = f.read()
-
 
28
            try:
28
            watchlist = json.loads(jsonStr)
29
                watchlist = json.loads(jsonStr)
-
 
30
            except ValueError as e:
-
 
31
                print e
-
 
32
                watchlist = []
29
            f.close()
33
            f.close()
30
        except TypeError as e:
34
        except TypeError as e:
31
            print 'TypeError: ', e
35
            print 'TypeError: ', e
32
            watchlist = []
36
            watchlist = []
33
        
37