Skip to content

Commit 9783d11

Browse files
Export Data functionality works
2 parents e2dff8e + cc32d21 commit 9783d11

114 files changed

Lines changed: 26800 additions & 16 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

src/Patient.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@ class Patient:
1111
HorizontalPhoto horizontal - an horizontal image object
1212
VerticalPhoto vertical - a vertical image object
1313
"""
14-
def __init__(self, name, birth, gender, ethnicity, language, roomNumber,
15-
school, screeningComment, referral):
14+
def __init__(self):
1615
""" Initialize the horizontal and vertical attributes by creating
1716
HorizontalPhoto and VerticalPhoto objects
1817
"""

src/hLeftEye.jpg

2.74 KB
Loading

src/hRightEye.jpg

2.41 KB
Loading

src/interaction.py

Lines changed: 80 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
import wx, os
1+
import wx, os, tkFileDialog
22
from Controller import *
3+
from xlwt import Workbook
34
#use makepatient method from controller
45

56
IMGMASK = "JPEG Files(*.jpg;*.jpeg;*.jpe;*.jfif) " \
@@ -163,17 +164,36 @@ def upPaint(self, page, upPath, imgCtrl, orientation):
163164
# vImgCtrl - vertical image control of 2nd page
164165
def next0(self, page0, page1, name, birth, gender, ethnicity, language,
165166
roomNumber, school, screeningComment, referral):
166-
#if name == "" or age == "" or ethnicity == "":
167-
# errorTxt = "Please fill out all inputs."
168-
# errMsg = wx.MessageDialog(page0, errorTxt, "Please fill out all inputs.", wx.OK)
169-
# errMsg.ShowModal()
170-
# errMsg.Destroy()
171-
#else:
172167

173-
self.patient = makePatient0(name, birth, gender, ethnicity,
174-
language, roomNumber, school,
175-
screeningComment, referral)
176-
168+
self.patient = Patient()
169+
170+
if name != "":
171+
self.patient.name = name
172+
173+
if birth != "":
174+
self.patient.birth = birth
175+
176+
if gender != "":
177+
self.patient.gender = gender
178+
179+
if ethnicity != "":
180+
self.patient.ethnicity = ethnicity
181+
182+
if language != "":
183+
self.patient.language = language
184+
185+
if roomNumber != "":
186+
self.patient.roomNumber = roomNumber
187+
188+
if school != "":
189+
self.patient.school = school
190+
191+
if screeningComment != "":
192+
self.patient.screeningComment = screeningComment
193+
194+
if referral != "":
195+
self.patient.referral = referral
196+
177197
page0.Hide()
178198
self.ShowYourself(page1) # Shows 2nd page
179199

@@ -192,7 +212,7 @@ def next1(self, hPhotoTxt, vPhotoTxt, page1, page2, hImgCtrl, vImgCtrl):
192212
errMsg1.ShowModal()
193213
errMsg1.Destroy()
194214

195-
print "good"
215+
print self.patient.name
196216

197217
#self.patient = makePatient(self.horizontalPath, self.verticalPath)
198218
setPatient(self.horizontalPath, self.verticalPath, self.patient)
@@ -596,4 +616,51 @@ def startOver(self, resultPage, page1, horImgCtrl, verImgCtrl, text1, text2, pag
596616
self.reset(page1, horImgCtrl, verImgCtrl, text1, text2, pageNum)
597617

598618
# Shows first page
599-
page1.Show()
619+
page1.Show()
620+
621+
def exportData(self,page):
622+
book = Workbook()
623+
sheet1 = book.add_sheet('Patient Data')
624+
625+
sheet1.write(0,0,'Name')
626+
sheet1.write(0,1,self.patient.name)
627+
628+
row1 = sheet1.row(1)
629+
row1.write(0,'Date of Birth')
630+
row1.write(1,self.patient.birth)
631+
632+
row2 = sheet1.row(2)
633+
row2.write(0,'Gender')
634+
row2.write(1,self.patient.gender)
635+
636+
row3 = sheet1.row(3)
637+
row3.write(0,'Ethnicity')
638+
row3.write(1,self.patient.ethnicity)
639+
640+
row4 = sheet1.row(4)
641+
row4.write(0,'Language')
642+
row4.write(1,self.patient.language)
643+
644+
row5 = sheet1.row(5)
645+
row5.write(0,'Room Number')
646+
row5.write(1,self.patient.roomNumber)
647+
648+
row6 = sheet1.row(6)
649+
row6.write(0,'School')
650+
row6.write(1,self.patient.school)
651+
652+
row7 = sheet1.row(7)
653+
row7.write(0,'Screening Comment')
654+
row7.write(1,self.patient.screeningComment)
655+
656+
row8 = sheet1.row(8)
657+
row8.write(0,'Referral')
658+
row8.write(1,self.patient.referral)
659+
660+
sheet1.col(0).width = 5000
661+
sheet1.col(1).width = 5000
662+
663+
book.save('patient_data.xls')
664+
msg = "Excel file saved in current directory"
665+
savedMsg = wx.MessageDialog(page, msg, "Patient Data Exported", wx.OK)
666+
savedMsg.ShowModal()

src/page.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -429,9 +429,15 @@ def resultPageSetup(self, page):
429429
horPhotoTxt.Hide()
430430
verPhotoTxt.Hide()
431431

432+
x = 740
433+
y = 520
432434

433-
restartBtn = wx.Button(page, label="Start Over", pos=(840, 520))
435+
exportBtn = wx.Button(page, label="Export Data", pos=(x, y))
436+
restartBtn = wx.Button(page, label="Start Over", pos=(x + 100, y))
434437

438+
exportBtn.Bind(wx.EVT_BUTTON,
439+
lambda event: self.interact.exportData(page))
440+
435441
restartBtn.Bind(wx.EVT_BUTTON,
436442
lambda event: self.interact.startOver(self.resultPage,
437443
self.page1,

src/patient_data.xls

5.5 KB
Binary file not shown.

src/vLeftEye.jpg

2.74 KB
Loading

src/vRightEye.jpg

2.41 KB
Loading

xlwt-0.7.5/HISTORY.html

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
2+
<html>
3+
<head>
4+
<meta http-equiv='Content-Type' content='text/html; charset=us-ascii' />
5+
<title>xlwt HISTORY</title>
6+
</head>
7+
<body>
8+
<p> Version 0.7.2, released to the general public via PyPI -- 2009-06-01
9+
</p>
10+
<code><br /> Revision: 3844
11+
<br /> Author: sjmachin
12+
<br /> Date: 11:02:54 AM, Wednesday, 20 May 2009
13+
<br /> Message:
14+
<br /> Added function Utils.rowcol_pair_to_cellrange. (0, 0, 65535, 255) -> "A1:IV65536"
15+
<br /> ----
16+
<br /> Modified : /xlwt/trunk/xlwt/Utils.py
17+
<br />
18+
<br /> Revision: 3843
19+
<br /> Author: sjmachin
20+
<br /> Date: 1:46:05 AM, Tuesday, 19 May 2009
21+
<br /> Message:
22+
<br /> Removed Worksheet property show_empty_as_zero,
23+
<br /> and added attribute show_zero_values (default: 1 == True).
24+
<br /> ----
25+
<br /> Modified : /xlwt/trunk/xlwt/Worksheet.py
26+
<br />
27+
<br /> Revision: 3841
28+
<br /> Author: sjmachin
29+
<br /> Date: 11:58:51 AM, Wednesday, 13 May 2009
30+
<br /> Message:
31+
<br /> Fixed formula code generation problem with formulas
32+
<br /> including MAX/SUM/etc functions with arguments like A1+123.
33+
<br /> Updated version to 0.7.2alpha.
34+
<br /> ----
35+
<br /> Modified : /xlwt/trunk/README.html
36+
<br /> Modified : /xlwt/trunk/setup.py
37+
<br /> Modified : /xlwt/trunk/xlwt/ExcelFormulaParser.py
38+
<br /> Modified : /xlwt/trunk/xlwt/ExcelMagic.py
39+
<br /> Modified : /xlwt/trunk/xlwt/__init__.py
40+
<br /> Modified : /xlwt/trunk/xlwt/excel-formula.g
41+
<br />
42+
<br /> Revision: 3816
43+
<br /> Author: sjmachin
44+
<br /> Date: 8:31:39 PM, Tuesday, 24 March 2009
45+
<br /> Message:
46+
<br /> Added .../doc/pattern_examples.xls and put a pointer to it
47+
<br /> in the easyxf part of Style.py.
48+
<br /> ----
49+
<br /> Modified : /xlwt/trunk/xlwt/Style.py
50+
<br /> Added : /xlwt/trunk/xlwt/doc/pattern_examples.xls
51+
<br />
52+
<br /> Revision: 3815
53+
<br /> Author: sjmachin
54+
<br /> Date: 7:54:52 PM, Tuesday, 24 March 2009
55+
<br /> Message:
56+
<br /> Fixed Row.set_cell_formula() bug introduced in 0.7.1.
57+
<br /> Fixed bug(?) with SCL/magnification handling causing(?) Excel
58+
<br /> to raise a dialogue box if sheet is set to open in page preview mode
59+
<br /> and user then switches to normal view.
60+
<br /> Added color and colour as synonyms for font.colour_index in easyxf.
61+
<br /> Removed unused attribute Row.__has_default_format.
62+
<br /> ----
63+
<br /> Modified : /xlwt/trunk/xlwt/Row.py
64+
<br /> Modified : /xlwt/trunk/xlwt/Style.py
65+
<br /> Modified : /xlwt/trunk/xlwt/Worksheet.py
66+
</code>
67+
68+
69+
70+
71+
72+
73+
<p> Version 0.7.1, released to the general public via PyPI -- 2009-03-04
74+
</p>
75+
<p> Version 0.7.0, released to the general public via PyPI
76+
</p>
77+
<ul>
78+
<li> Fixed more bugs and added more various new bits of functionality </li>
79+
</ul>
80+
81+
82+
<p> Version 0.7.0a4, fork of pyExcelerator, released to python-excel.
83+
</p>
84+
<ul>
85+
<li> Fixed various bugs in pyExcelerator and added various new bits of functionality </li>
86+
</ul>
87+
</body></html>

xlwt-0.7.5/PKG-INFO

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
Metadata-Version: 1.0
2+
Name: xlwt
3+
Version: 0.7.5
4+
Summary: Library to create spreadsheet files compatible with MS Excel 97/2000/XP/2003 XLS files, on any platform, with Python 2.3 to 2.7
5+
Home-page: http://www.python-excel.org/
6+
Author: John Machin
7+
Author-email: [email protected]
8+
License: BSD
9+
Download-URL: http://pypi.python.org/pypi/xlwt
10+
Description: xlwt is a library for generating spreadsheet files that are compatible
11+
with Excel 97/2000/XP/2003, OpenOffice.org Calc, and Gnumeric. xlwt has
12+
full support for Unicode. Excel spreadsheets can be generated on any
13+
platform without needing Excel or a COM server. The only requirement is
14+
Python 2.3 to 2.7.
15+
16+
Keywords: xls excel spreadsheet workbook worksheet pyExcelerator
17+
Platform: Platform Independent
18+
Classifier: Operating System :: OS Independent
19+
Classifier: Programming Language :: Python
20+
Classifier: License :: OSI Approved :: BSD License
21+
Classifier: Development Status :: 5 - Production/Stable
22+
Classifier: Intended Audience :: Developers
23+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
24+
Classifier: Topic :: Office/Business :: Financial :: Spreadsheet
25+
Classifier: Topic :: Database
26+
Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content :: CGI Tools/Libraries

0 commit comments

Comments
 (0)