Permalink
Browse files

Added thumb info storage. Moved more libs to localLibs.

  • Loading branch information...
1 parent 52026fe commit 34bc715231fe06d977e1719e6e54a4e9a4a4a370 @weijia committed Mar 12, 2012
Showing with 31 additions and 1 deletion.
  1. 0 trunk/prodRoot/{desktopApp/lib → localLibs}/archiver/__init__.py
  2. 0 trunk/prodRoot/{desktopApp/lib → localLibs}/archiver/archiveStorageBase.py
  3. 0 trunk/prodRoot/{desktopApp/lib → localLibs}/archiver/archiver.py
  4. 0 trunk/prodRoot/{desktopApp/lib → localLibs}/archiver/archiverV2.py
  5. 0 trunk/prodRoot/{desktopApp/lib → localLibs}/archiver/encryptionStorageBase.py
  6. 0 trunk/prodRoot/{desktopApp/lib → localLibs}/archiver/extractedZipStorage.py
  7. 0 trunk/prodRoot/{desktopApp/lib → localLibs}/archiver/libSys.py
  8. 0 trunk/prodRoot/{desktopApp/lib → localLibs}/archiver/zipDecStorage.py
  9. 0 trunk/prodRoot/{desktopApp/lib → localLibs}/archiver/zipEncStorage.py
  10. 0 trunk/prodRoot/{desktopApp/lib → localLibs}/archiver/zipStorage.py
  11. 0 trunk/prodRoot/{desktopApp/lib → localLibs}/archiver/zipStorageV2.py
  12. 0 trunk/prodRoot/{desktopApp/lib → localLibs}/compress/__init__.py
  13. 0 trunk/prodRoot/{desktopApp/lib → localLibs}/compress/zipClass.py
  14. +5 −1 trunk/prodRoot/localLibs/storage/infoStorage/zippedInfo.py
  15. +21 −0 trunk/prodRoot/localLibs/storage/infoStorage/zippedInfoWithThumb.py
  16. 0 trunk/prodRoot/{wwjufsdatabase/libs → localLibs}/thumb/__init__.py
  17. 0 trunk/prodRoot/{wwjufsdatabase/libs → localLibs}/thumb/appThumb.py
  18. 0 trunk/prodRoot/{wwjufsdatabase/libs → localLibs}/thumb/ffmpegThumb.py
  19. 0 trunk/prodRoot/{wwjufsdatabase/libs → localLibs}/thumb/libSys.py
  20. 0 trunk/prodRoot/{wwjufsdatabase/libs → localLibs}/thumb/movieThumb.py
  21. 0 trunk/prodRoot/{wwjufsdatabase/libs → localLibs}/thumb/picThumbGenerator.py
  22. +5 −0 trunk/prodRoot/{wwjufsdatabase/libs → localLibs}/thumb/thumbInterface.py
@@ -21,10 +21,14 @@ def __init__(self, workingDir = gWorkingDir):
def addAdditionalInfo(self, addInfo):
for i in addInfo:
self.additionalInfoDict[i] = addInfo[i]
- def addItem(self, fullPath):
+
+ def getItemFromFullPath(self, fullPath):
#Get file info and add info to info dict
fullPath = transform.transformDirToInternal(fullPath)
itemObj = ufsObj.detailedFsObj(fullPath)
+ return itemObj
+ def addItem(self, fullPath):
+ itemObj = self.getItemFromFullPath(fullPath)
self.collectionInfoDict[itemObj.ufsUrl()] = itemObj.getItemInfo()
#Add file to zip
#return self.getZipFile().addfile(unicode(fullPath), unicode(fullPath))
@@ -0,0 +1,21 @@
+import localLibSys
+import wwjufsdatabase.libs.utils.transform as transform
+import localLibs.objSys.ufsObj as ufsObj
+import desktopApp.lib.compress.zipClass as zipClass
+from zippedInfo import zippedInfo
+from localLibs.thumb.thumbInterface import getThumb
+
+gWorkingDir = "d:/tmp/working"
+gDefaultInfoSize = 100
+
+class zippedCollectionWithInfo(zippedInfo):
+ def __init__(self, workingDir = gWorkingDir):
+ super(zippedCollectionWithInfo, self).__init__(workingDir)
+ def addItem(self, fullPath):
+ itemObj = self.getItemFromFullPath(fullPath)
+ infoDict = itemObj.getItemInfo()
+ thumbFullPath = getThumb(fullPath, gWorkingDir)
+ self.collectionInfoDict[itemObj.ufsUrl()] = infoDict
+ #Add file to zip
+ #return self.getZipFile().addfile(unicode(fullPath), unicode(fullPath))
+ return gDefaultInfoSize
@@ -4,6 +4,11 @@
import appThumb
def getThumb(path, targetDir):
+ '''
+ path: Full Path. The path of the file whose thumbnail will be generated
+ targetDir: Directory Path. The target directory where the generated thumbnail will be put in.
+ Return: the thumbnail fullPath
+ '''
newPath = None
ext = path.split('.')[-1].lower()
if ext in ['exe']:

0 comments on commit 34bc715

Please sign in to comment.