Skip to content

Commit 33fabc6

Browse files
committed
Fixing make.py to use meta.py. Allowing for easier updating of version and platform information. Adding ability to zip no_install from script
1 parent 7fe241d commit 33fabc6

File tree

2 files changed

+41
-26
lines changed

2 files changed

+41
-26
lines changed

odmtools/controller/frmAbout.py

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,28 +2,20 @@
22
import wx
33
from wx import AboutBox, AboutDialogInfo, ClientDC
44
from wx.lib.wordwrap import wordwrap
5-
5+
from odmtools.meta import data
66

77
class frmAbout(wx.Dialog):
88
def __init__(self, parent):
99
self.parent = parent
1010
info = AboutDialogInfo()
11-
info.Name = "ODMTools"
12-
info.Version = "1.2.0 Beta"
13-
info.Copyright = "Copyright (c) 2013 - 2015, Utah State University. All rights reserved."
14-
info.Description = wordwrap(
15-
"ODMTools is a python application for managing observational data using the Observations Data Model. "
16-
"ODMTools allows you to query, visualize, and edit data stored in an Observations Data Model (ODM) database."
17-
" ODMTools was originally developed as part of the CUAHSI Hydrologic Information System.",
18-
350, ClientDC(parent))
19-
info.WebSite = ("http://uchic.github.io/ODMToolsPython/", "ODMTools home page")
20-
info.Developers = ["Jeffery S. Horsburgh",
21-
"Amber Spackman Jones",
22-
"Stephanie L. Reeder",
23-
"Jacob Meline",
24-
"James Patton"]
25-
26-
info.License = wordwrap(licenseText, 500, ClientDC(parent))
11+
info.Name = data.app_name
12+
info.Version = data.version
13+
info.Copyright = data.copyright
14+
info.Description = wordwrap(data.description, 350, ClientDC(parent))
15+
info.WebSite = data.website
16+
info.Developers = data.developers
17+
18+
info.License = wordwrap(data.license, 500, ClientDC(parent))
2719

2820
# Then we call wx.AboutBox giving it that info object
2921
AboutBox(info)

setup/make.py

Lines changed: 32 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,25 @@
1+
from __future__ import with_statement
12
import os, sys, shutil, zipfile
2-
BASE_DIR = os.path.dirname(os.path.realpath(__file__))
3+
from contextlib import closing
4+
from zipfile import ZipFile, ZIP_DEFLATED
5+
import os
6+
7+
def zipdir(basedir, archivename):
8+
assert os.path.isdir(basedir)
9+
with closing(ZipFile(archivename, "w", ZIP_DEFLATED)) as z:
10+
for root, dirs, files in os.walk(basedir):
11+
#NOTE: ignore empty directories
12+
for fn in files:
13+
absfn = os.path.join(root, fn)
14+
zfn = absfn[len(basedir)+len(os.sep):]
15+
z.write(absfn, zfn)
16+
## Update this for each new release ##
17+
18+
19+
320

21+
##
22+
BASE_DIR = os.path.dirname(os.path.realpath(__file__))
423
WIN_DIR = os.path.join(BASE_DIR, "Windows")
524
MAC_DIR = os.path.join(BASE_DIR, "Mac")
625

@@ -37,15 +56,15 @@ def check_if_dirs_exist():
3756
assert os.path.exists(MAC_DIR)
3857
print "Success"
3958

40-
print "Trying to open WORK_DIR: ",
59+
print "Trying to open WORK_DIR: ",
4160
assert os.path.exists(WORK_DIR)
4261
print "Success"
4362

44-
print "Trying to open ICON_DIR: ",
63+
print "Trying to open ICON_DIR: ",
4564
assert os.path.exists(ICON_DIR)
4665
print "Success"
4766

48-
print "Trying to open EXE_DIR: ",
67+
print "Trying to open EXE_DIR: ",
4968
assert os.path.exists(EXE_DIR)
5069
print "Success"
5170

@@ -105,26 +124,30 @@ def run_inno():
105124
os.system(INNO_EXECUTABLE + " " + INNO_SCRIPT)
106125

107126
def run_no_installer():
108-
pass
127+
# pass
128+
zipdir(os.path.join('..', 'odmtools'), "Windows_Test_zip.zip")
129+
109130
# zf = zipfile.ZipFile('')
110131

111132
def run_iceberg():
112133
os.system(ICE_EXECUTABLE + " "+ ICE_SCRIPT)
113134

114-
135+
115136
def main():
116-
delete_old_out_dir()
117-
check_if_dirs_exist()
137+
# delete_old_out_dir()
138+
# check_if_dirs_exist()
118139

119140
if sys.platform == 'win32':
120141
print "Creating Windows Executable..."
121142
if (run_pyinstaller()):
122143
run_inno()
123144

124-
125145
if sys.platform =='darwin':
126146
if(mac_pyinstaller()):
127147
run_iceberg()
148+
else:
149+
run_no_installer()
150+
128151

129152
if __name__ == '__main__':
130153
main()

0 commit comments

Comments
 (0)