Permalink
Browse files

fix data files on windows.

  • Loading branch information...
1 parent 33e6ce8 commit 507d33604b8a6c367310806994d573e19e61df1c unknown committed May 8, 2011
Showing with 24 additions and 15 deletions.
  1. +2 −2 resources/win32/couchapp.iss
  2. +22 −13 setup.py
@@ -7,7 +7,7 @@
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
AppId={{0CDA65F1-9FD8-42C5-8DD0-F65F7E8B7304}
AppName=Couchapp
-AppVerName=Couchapp 0.7.5
+AppVerName=Couchapp 0.8.0
AppPublisher=Benoit Chesneau
AppPublisherURL=http://github.com/couchapp/couchapp
AppSupportURL=http://github.com/couchapp/couchapp
@@ -16,7 +16,7 @@ DefaultDirName={pf}\Couchapp
DefaultGroupName=Couchapp
LicenseFile=LICENSE
InfoAfterFile=resources\win32\postinstall.txt
-OutputBaseFilename=couchapp-0.7.5
+OutputBaseFilename=couchapp-0.8.0
Compression=lzma
SolidCompression=yes
SourceDir=..\..
View
@@ -87,8 +87,8 @@
def get_data_files():
data_files = []
data_files.append(('couchapp',
- ["LICENSE", "MANIFEST.in", "NOTICE", "README.md",
- "THANKS.txt",]))
+ ["LICENSE", "MANIFEST.in", "NOTICE", "README.rst",
+ "THANKS",]))
return data_files
@@ -100,14 +100,14 @@ def get_packages_data():
for root in ('templates',):
for curdir, dirs, files in os.walk(os.path.join("couchapp", root)):
- print curdir
curdir = curdir.split(os.sep, 1)[1]
dirs[:] = filter(ordinarypath, dirs)
for f in filter(ordinarypath, files):
- f = os.path.join(curdir, f)
+ f = os.path.normpath(os.path.join(curdir, f))
packagedata['couchapp'].append(f)
return packagedata
+
MODULES = [
'couchapp',
'couchapp.autopush',
@@ -146,6 +146,22 @@ def get_scripts():
"couchapp.bat"))
return scripts
+DATA_FILES = get_data_files()
+
+
+def get_py2exe_datafiles():
+ datapath = os.path.join('couchapp', 'templates')
+ head, tail = os.path.split(datapath)
+ d = dict(get_data_files())
+ for root, dirs, files in os.walk(datapath):
+ files = [os.path.join(root, filename) for filename in files]
+ root = root.replace(tail, datapath)
+ root = root[root.index(datapath):]
+ d[root] = files
+ return d.items()
+
+
+
if os.name == "nt" or sys.platform == "win32":
# py2exe needs to be installed to work
try:
@@ -181,6 +197,8 @@ def get_scripts():
except ImportError:
raise SystemExit('You need py2exe installed to run Couchapp.')
+ DATA_FILES = get_py2exe_datafiles()
+
class install_package_data(install_data):
def finalize_options(self):
self.set_undefined_options('install',
@@ -228,10 +246,7 @@ def build_extension(self, ext):
cmdclass = {'install_data': install_package_data }
-
def main():
-
-
# read long description
with open(os.path.join(os.path.dirname(__file__), 'README.rst')) as f:
long_description = f.read()
@@ -240,12 +255,6 @@ def main():
for name in MODULES:
PACKAGES[name] = name.replace(".", "/")
- DATA_FILES = [
- ('couchapp', ["LICENSE", "MANIFEST.in", "NOTICE", "README.rst",
- "THANKS",])
- ]
-
-
options = dict(
name = 'Couchapp',
version = couchapp.__version__,

0 comments on commit 507d336

Please sign in to comment.