Skip to content

Commit

Permalink
fixed dataset printing
Browse files Browse the repository at this point in the history
  • Loading branch information
Dr. Frank Hoffmann authored and Dr. Frank Hoffmann committed Apr 28, 2019
1 parent 78e9eba commit d2ef6cb
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 15 deletions.
8 changes: 4 additions & 4 deletions conf/zms3.formulator.metaobj.xml
Original file line number Diff line number Diff line change
Expand Up @@ -675,7 +675,7 @@ $ZMI.registerReady(function() {
<item key="id"><![CDATA[ZMSFormulator]]></item>
<item key="name"><![CDATA[ZMSFormulator]]></item>
<item key="package"><![CDATA[zms3.formulator]]></item>
<item key="revision"><![CDATA[3.4.14]]></item>
<item key="revision"><![CDATA[3.4.15]]></item>
<item key="type"><![CDATA[ZMSDocument]]></item>
</dictionary>
</item>
Expand Down Expand Up @@ -1214,7 +1214,7 @@ textarea.form-control.rawJSON {
<item key="id"><![CDATA[ZMSFormulatorItem]]></item>
<item key="name"><![CDATA[ZMSFormulatorItem]]></item>
<item key="package"><![CDATA[zms3.formulator]]></item>
<item key="revision"><![CDATA[3.4.14]]></item>
<item key="revision"><![CDATA[3.4.15]]></item>
<item key="type"><![CDATA[ZMSObject]]></item>
</dictionary>
</item>
Expand Down Expand Up @@ -1246,7 +1246,7 @@ textarea.form-control.rawJSON {
<item key="enabled" type="int">0</item>
<item key="id"><![CDATA[zms3.formulator]]></item>
<item key="name"><![CDATA[zms3.formulator]]></item>
<item key="revision"><![CDATA[3.4.13]]></item>
<item key="revision"><![CDATA[3.4.15]]></item>
<item key="type"><![CDATA[ZMSPackage]]></item>
</dictionary>
</item>
Expand Down Expand Up @@ -1524,7 +1524,7 @@ def downloadData(self):
<item key="id"><![CDATA[zms3.formulator.lib]]></item>
<item key="name"><![CDATA[zms3.formulator.lib]]></item>
<item key="package"><![CDATA[zms3.formulator]]></item>
<item key="revision"><![CDATA[3.4.14]]></item>
<item key="revision"><![CDATA[3.4.15]]></item>
<item key="type"><![CDATA[ZMSLibrary]]></item>
</dictionary>
</item>
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
else:
site_packages = get_python_lib()

VERSION = '3.4.14'
VERSION = '3.4.15'

zmspkg_name = 'formulator'
branch_name = 'master'
Expand Down
18 changes: 8 additions & 10 deletions zms3/formulator/ZMSFormulator.py
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,7 @@ def printDataRaw(self, receivedData=None, frmt='txt'):
data = self.getData()
header = ['TIMESTAMP']
output = []
s = '' # text stream

# Received data
if isinstance(receivedData, dict):
Expand All @@ -382,22 +383,21 @@ def printDataRaw(self, receivedData=None, frmt='txt'):
if isinstance(data, dict):
if frmt=='txt':
s = '%s entries:\n\n'%len(data)
else:
s = ''
s1 = s2 = ''
for t, v in sorted(data.iteritems()):

if len(data) > 0:
header.extend( [ i[0] for i in data[data.keys()[0]] ] )
s += '#/#'.join(header).upper() +'\n'

for t, v in sorted(data.iteritems()):
output = []
output.append(time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(t)))
for i in sorted(v):
i1, i2 = i
header.append(i1.upper())
outstr = self.this.str_item(i2)
outstr = outstr.replace('\n',', ')
output.append(_globals.html_quote(outstr))
s1 = '#/#'.join(header)
s2 += '#/#'.join(output) + '\n'
s += '#/#'.join(output) + '\n'

s += s1.upper() + '\n' + s2

# Handle SQL-Storage
else:
Expand All @@ -406,8 +406,6 @@ def printDataRaw(self, receivedData=None, frmt='txt'):
res = con.execute(sel)
if frmt=='txt':
s = '%s entries:\n\n'%res.rowcount
else:
s = ''

sel = select([self.sqldb.c.ZMS_FRM_KEY]).distinct().order_by(self.sqldb.c.ZMS_FRM_ORD, self.sqldb.c.ZMS_FRM_KEY)
con = self.engine.connect()
Expand Down

0 comments on commit d2ef6cb

Please sign in to comment.