[Libreoffice-commits] .: src/globals.py src/oletool.py src/xlsstream.py xls-dump.py

Kohei Yoshida kohei at kemper.freedesktop.org
Mon Apr 11 20:20:40 PDT 2011


 src/globals.py   |   15 ---------------
 src/oletool.py   |    1 -
 src/xlsstream.py |   14 ++++++++++++++
 xls-dump.py      |    2 +-
 4 files changed, 15 insertions(+), 17 deletions(-)

New commits:
commit 188b8d412c1cf2bb40347ccb54a1146328cc9b51
Author: Kohei Yoshida <kyoshida at novell.com>
Date:   Mon Apr 11 23:18:43 2011 -0400

    Moved StreamData from globals to xlsstream since this is XL-specific.

diff --git a/src/globals.py b/src/globals.py
index 1505a54..3ccfe14 100644
--- a/src/globals.py
+++ b/src/globals.py
@@ -51,21 +51,6 @@ class Params(object):
         self.showStreamPos = False
 
 
-class StreamData(object):
-    """run-time stream data."""
-    def __init__ (self):
-        self.encrypted = False
-        self.pivotCacheIDs = {}
-
-    def appendPivotCacheId (self, newId):
-        # must be 4-digit with leading '0's.
-        strId = "%.4d"%newId
-        self.pivotCacheIDs[strId] = True
-
-    def isPivotCacheStream (self, name):
-        return self.pivotCacheIDs.has_key(name)
-
-
 class ByteStream(object):
 
     def __init__ (self, bytes):
diff --git a/src/oletool.py b/src/oletool.py
index 3be6077..5ab1edf 100755
--- a/src/oletool.py
+++ b/src/oletool.py
@@ -45,7 +45,6 @@ class OleContainer:
 
     def __parseFile (self):
         file = open(self.filePath, 'rb')
-        self.strmData = globals.StreamData()
         self.chars = file.read()
         file.close()    
 
diff --git a/src/xlsstream.py b/src/xlsstream.py
index 6ab4195..394077e 100644
--- a/src/xlsstream.py
+++ b/src/xlsstream.py
@@ -305,6 +305,20 @@ recDataRev = {
     0x0151: ["EONB*", "Change Track End of Nested Block"]
 }
 
+class StreamData(object):
+    """run-time stream data."""
+    def __init__ (self):
+        self.encrypted = False
+        self.pivotCacheIDs = {}
+
+    def appendPivotCacheId (self, newId):
+        # must be 4-digit with leading '0's.
+        strId = "%.4d"%newId
+        self.pivotCacheIDs[strId] = True
+
+    def isPivotCacheStream (self, name):
+        return self.pivotCacheIDs.has_key(name)
+
 class XLStream(object):
 
     def __init__ (self, chars, params, strmData):
diff --git a/xls-dump.py b/xls-dump.py
index 18e75a9..357bd97 100755
--- a/xls-dump.py
+++ b/xls-dump.py
@@ -68,7 +68,7 @@ class XLDumper(object):
 
     def __parseFile (self):
         file = open(self.filepath, 'rb')
-        self.strmData = globals.StreamData()
+        self.strmData = xlsstream.StreamData()
         self.strm = xlsstream.XLStream(file.read(), self.params, self.strmData)
         file.close()
 


More information about the Libreoffice-commits mailing list