Changeset 5977
- Timestamp:
- 09/06/10 16:05:17 (1 year ago)
- Files:
-
- trunk/dabo/biz/RemoteBizobj.py (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/dabo/biz/RemoteBizobj.py
r5047 r5977 11 11 12 12 13 cacheDir = os.path.join(os.getcwd(), "cache")14 15 def _createCacheDir():16 if not os.path.exists(cacheDir):17 os.makedirs(cacheDir)18 19 20 13 21 14 class RemoteBizobj(dBizobj): 15 cacheDir = None 16 22 17 def _beforeInit(self): 23 18 return super(RemoteBizobj, self)._beforeInit() … … 29 24 self.defineConnection() 30 25 super(RemoteBizobj, self)._afterInit() 26 27 28 @classmethod 29 def _createCacheDir(cls, pth=None): 30 if cls.cacheDir is not None: 31 return 32 if pth is None: 33 pth = os.getcwd() 34 cls.cacheDir = os.path.join(pth, "cache") 35 if not os.path.exists(cls.cacheDir): 36 os.makedirs(cls.cacheDir) 31 37 32 38 … … 44 50 45 51 @classmethod 46 def load(cls, hashval, ds ):52 def load(cls, hashval, ds, pth): 47 53 biz = cls() 48 54 biz.DataSource = ds 49 55 biz.hashval = hashval 50 56 51 _createCacheDir()52 pth = os.path.join(c acheDir, hashval)57 cls._createCacheDir(pth) 58 pth = os.path.join(cls.cacheDir, hashval) 53 59 if os.path.exists(pth): 54 60 f = file(pth) … … 88 94 is needed. 89 95 """ 90 _createCacheDir()91 pth = os.path.join( cacheDir, hashval)96 self._createCacheDir() 97 pth = os.path.join(self.cacheDir, hashval) 92 98 f = file(pth, "w") 93 99 pd = {}
