def _write_dxfs(self):
if 'dxf_list' in self._style_properties
self._style_properties is of NoneType: None
Traceback (most recent call last):
File "/Users/me/eclipse/plugins/org.python.pydev_2.8.2.2013090511/pysrc/pydevd.py", line 1446, in <module>
debugger.run(setup['file'], None, None)
File "/Users/me/eclipse/plugins/org.python.pydev_2.8.2.2013090511/pysrc/pydevd.py", line 1092, in run
pydev_imports.execfile(file, globals, locals) #execute the script
File "/Users/me/git/metrics/metrics.py", line 226, in <module>
db.create()
File "/Users/me/git/metrics/metrics_db.py", line 52, in create
self._create_xlsx()
File "/Users/me/git/metrics/metrics_db.py", line 165, in _create_xlsx
wb.save(self.xls_file)
File "/Library/Python/2.7/site-packages/openpyxl-1.8.0-py2.7.egg/openpyxl/workbook.py", line 233, in save
save_workbook(self, filename)
File "/Library/Python/2.7/site-packages/openpyxl-1.8.0-py2.7.egg/openpyxl/writer/excel.py", line 159, in save_workbook
writer.save(filename)
File "/Library/Python/2.7/site-packages/openpyxl-1.8.0-py2.7.egg/openpyxl/writer/excel.py", line 142, in save
self.write_data(archive)
File "/Library/Python/2.7/site-packages/openpyxl-1.8.0-py2.7.egg/openpyxl/writer/excel.py", line 72, in write_data
archive.writestr(ARC_STYLE, self.style_writer.write_table())
File "/Library/Python/2.7/site-packages/openpyxl-1.8.0-py2.7.egg/openpyxl/writer/styles.py", line 65, in write_table
self._write_dxfs()
File "/Library/Python/2.7/site-packages/openpyxl-1.8.0-py2.7.egg/openpyxl/writer/styles.py", line 268, in _write_dxfs
if 'dxf_list' in self._style_properties:
TypeError: argument of type 'NoneType' is not iterable
from openpyxl import Workbookfrom openpyxl.style import Color, Fill
wb = Workbook()ws = wb.get_active_sheet()
ws.title = 'Data Collection Tab'ws.cell('U6').value = 0.5ws.cell('U7').value = 5ws.cell('U10').value = 1ws.cell('U11').value = 2ws.cell('U12').value = 3ws.cell('U13').value = 4ws.cell('U14').value = 5ws.cell('U15').value = 6ws.cell('U16').value = 7ws.cell('U17').value = 8ws.cell('U18').value = 9ws.cell('U19').value = 10redFill = Fill()redFill.start_color.index = 'FFEE1111'redFill.end_color.index = 'FFEE1111'redFill.fill_type = Fill.FILL_SOLIDyellowFill = Fill()yellowFill.start_color.index = 'FFEEEE11'yellowFill.end_color.index = 'FFEEEE11'yellowFill.fill_type = Fill.FILL_SOLIDgreenFill = Fill()greenFill.start_color.index = 'FF11AA11'greenFill.end_color.index = 'FF11AA11'greenFill.fill_type = Fill.FILL_SOLIDdxfId = ws.conditional_formatting.addDxfStyle(wb, None, None, None)ws.conditional_formatting.addCustomRule('U10:U18', {'type': 'expression', 'formula': ['ISBLANK(U10)'], 'stopIfTrue': '1'})ws.conditional_formatting.addCellIs('U10:U18', 'lessThan', ['U$7-U$6*U$7'], True, wb, None, None, greenFill)ws.conditional_formatting.addCellIs('U10:U18', 'lessThan', ['U$7'], True, wb, None, None, yellowFill)ws.conditional_formatting.addCellIs('U10:U18', 'greaterThanOrEqual', ['U$7'], True, wb, None, None, redFill)wb.save('...')