Permalink
Browse files

Incorporating dup_fix patch from pylibgal3

  • Loading branch information...
1 parent fbf0e20 commit 412e5c64b9f779635ab98e0e1a693d2fe4d8d4d6 Jay Deiman committed Jul 26, 2013
Showing with 11 additions and 2 deletions.
  1. +8 −0 3.0/client/Python/pylibgal3/libg3/G3Items.py
  2. +3 −2 3.0/client/Python/pylibgal3/libg3/Gallery3.py
@@ -52,6 +52,14 @@ def __str__(self):
pass
return self.name
+ def __repr__(self):
+ try:
+ return '%s : %s : %s' % (self.__dict__.get('id') ,
+ self.__dict__.get('type') , self.__dict__.get('name'))
+ except:
+ pass
+ return type(self)
+
def __getattr__(self , name):
"""
A bit of magic to make the retrieval of member objects lazy
@@ -164,7 +164,8 @@ def addAlbum(self , parent , albumName , title , description=''):
newObjUrl = self._getUrlFromResp(resp)
item = getItemFromResp(self.getRespFromUrl(newObjUrl) , self , parent)
parent._members.append(newObjUrl)
- parent.members.append(item)
+ # This appears to cause a race
+ #parent.members.append(item)
return item
def addImage(self , parent , image , title='' , description='' , name=''):
@@ -213,7 +214,7 @@ def addImage(self , parent , image , title='' , description='' , name=''):
newObjUrl = self._getUrlFromResp(resp)
item = getItemFromResp(self.getRespFromUrl(newObjUrl) , self , parent)
parent._members.append(newObjUrl)
- parent.members.append(item)
+ #parent.members.append(item)
return item
def addMovie(self , parent , movie , title='' , description='' , name=''):

0 comments on commit 412e5c6

Please sign in to comment.