fixed bug, speeding up share loading and verification by 50%
[p2pool.git] / setup.py
index 8601c28..3067cd3 100644 (file)
--- a/setup.py
+++ b/setup.py
@@ -8,9 +8,11 @@ import py2exe
 
 version = __import__('p2pool').__version__
 
-old_contents = open('p2pool/__init__.py', 'rb').read()
+if os.path.exists('INITBAK'):
+    os.remove('INITBAK')
+os.rename(os.path.join('p2pool', '__init__.py'), 'INITBAK')
 try:
-    open('p2pool/__init__.py', 'wb').write('__version__ = %r%s%sDEBUG = False%s' % (version, os.linesep, os.linesep, os.linesep))
+    open(os.path.join('p2pool', '__init__.py'), 'wb').write('__version__ = %r%s%sDEBUG = False%s' % (version, os.linesep, os.linesep, os.linesep))
     
     sys.argv[1:] = ['py2exe']
     setup(name='p2pool',
@@ -24,19 +26,22 @@ try:
             ('web-static', [
                 'web-static/d3.v2.min.js',
                 'web-static/graphs.html',
+                'web-static/index.html',
+                'web-static/share.html',
             ]),
         ],
         
         console=['run_p2pool.py'],
         options=dict(py2exe=dict(
             bundle_files=1,
-            dll_excludes=['w9xpopen.exe'],
+            dll_excludes=['w9xpopen.exe', "mswsock.dll", "MSWSOCK.dll"],
             includes=['twisted.web.resource', 'ltc_scrypt'],
         )),
         zipfile=None,
     )
 finally:
-    open('p2pool/__init__.py', 'wb').write(old_contents)
+    os.remove(os.path.join('p2pool', '__init__.py'))
+    os.rename('INITBAK', os.path.join('p2pool', '__init__.py'))
 
 dir_name = 'p2pool_win32_' + version