[Pymoul-svn] SF.net SVN: pymoul: [30] pymoul/trunk
Status: Alpha
Brought to you by:
tiran
|
From: <ti...@us...> - 2007-01-15 19:55:56
|
Revision: 30
http://pymoul.svn.sourceforge.net/pymoul/?rev=30&view=rev
Author: tiran
Date: 2007-01-15 11:55:56 -0800 (Mon, 15 Jan 2007)
Log Message:
-----------
* Added WDYS test
* setup handler for PyTz
* misc
Modified Paths:
--------------
pymoul/trunk/setup_win32.py
pymoul/trunk/src/moul/file/plasmalog.py
pymoul/trunk/src/moul/qt/moulqt.py
Added Paths:
-----------
pymoul/trunk/src/moul/crypt/tests/test_wdys.py
Modified: pymoul/trunk/setup_win32.py
===================================================================
--- pymoul/trunk/setup_win32.py 2007-01-15 19:05:55 UTC (rev 29)
+++ pymoul/trunk/setup_win32.py 2007-01-15 19:55:56 UTC (rev 30)
@@ -29,6 +29,16 @@
# no build path setup, no worries.
pass
+# PyTz uses some import magic
+def findPyTz():
+ import pytz
+ pytz_dir = os.path.dirname(pytz.__file__)
+ if not os.path.isdir(pytz_dir):
+ raise ValueError('Install pytz with easy_install -Z pytz')
+ packages = find_packages(pytz_dir)
+ packages = ['pytz.%s.*' % pack for pack in packages]
+ return packages
+
def inEnvPath(name):
result = []
for path in os.environ['PATH'].split(';'):
@@ -67,7 +77,9 @@
pexe = kw['options'].setdefault('py2exe', {})
pexe['compressed'] = 100 # compress zip file
pexe['optimize'] = 0 # 0,1,2
- #pexe['includes'] = 'encodings,encodings.*'
+ pexe['includes'] = ['sip', 'PyQt4', 'encodings', 'encodings.*']
+ # not required at the moment
+ #pexe['includes'].extend(findPyTz())
kw['zipfile'] = 'library.zip'
def updateSetupOptionsQT(kw):
Added: pymoul/trunk/src/moul/crypt/tests/test_wdys.py
===================================================================
--- pymoul/trunk/src/moul/crypt/tests/test_wdys.py (rev 0)
+++ pymoul/trunk/src/moul/crypt/tests/test_wdys.py 2007-01-15 19:55:56 UTC (rev 30)
@@ -0,0 +1,66 @@
+# pyMoul - Python interface to Myst Online URU Live
+# Copyright (C) 2007 Christian Heimes <christian (at) cheimes (dot) de>
+
+# This program is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the
+# Free Software Foundation; either version 2 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc., 59
+# Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+"""moul.crypt.whatdoyousee unit tests
+"""
+import os
+import unittest
+from doctest import DocTestSuite
+
+import moul.file
+from moul.crypt.whatdoyousee import decryptWDYS
+from moul.crypt.whatdoyousee import encryptWDYS
+
+base = os.path.join(os.path.dirname(moul.file.__file__), 'tests')
+gra_enc = os.path.join(base, 'graphics.ini')
+gra_dec = os.path.join(base, 'graphics.txt')
+aud_enc = os.path.join(base, 'audio.ini')
+aud_dec = os.path.join(base, 'audio.txt')
+
+
+class WDYSTest(unittest.TestCase):
+ def setUp(self):
+ self.gra_enc = open(aud_enc, 'rb')
+ self.gra_dec = open(aud_dec, 'r')
+ self.aud_enc = open(aud_enc, 'rb')
+ self.aud_dec = open(aud_dec, 'r')
+
+ def tearDown(self):
+ self.gra_enc.close()
+ self.gra_dec.close()
+ self.aud_enc.close()
+ self.aud_dec.close()
+
+ def _compareEnc(self, enc, dec):
+ data = decryptWDYS(enc)
+ self.failUnlessEqual(data, dec.read())
+
+ def test_audioini(self):
+ self._compareEnc(self.aud_enc, self.aud_dec)
+
+ def test_graphicsini(self):
+ self._compareEnc(self.gra_enc, self.gra_dec)
+
+def test_suite():
+ return unittest.TestSuite((
+ unittest.makeSuite(WDYSTest),
+ ))
+
+if __name__ == '__main__':
+ unittest.main(defaultTest="test_suite")
+
+
Property changes on: pymoul/trunk/src/moul/crypt/tests/test_wdys.py
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: pymoul/trunk/src/moul/file/plasmalog.py
===================================================================
--- pymoul/trunk/src/moul/file/plasmalog.py 2007-01-15 19:05:55 UTC (rev 29)
+++ pymoul/trunk/src/moul/file/plasmalog.py 2007-01-15 19:55:56 UTC (rev 30)
@@ -25,6 +25,7 @@
from moul.config import getMoulDir
from moul.config import getConfigOption
+from moul.crypt.elf import decryptElf
PLASMA_LOG = "plasmalog.txt"
_marker = object()
Modified: pymoul/trunk/src/moul/qt/moulqt.py
===================================================================
--- pymoul/trunk/src/moul/qt/moulqt.py 2007-01-15 19:05:55 UTC (rev 29)
+++ pymoul/trunk/src/moul/qt/moulqt.py 2007-01-15 19:55:56 UTC (rev 30)
@@ -1,11 +1,40 @@
#!/usr/bin/env python2.5
+# pyMoul - Python interface to Myst Online URU Live
+# Copyright (C) 2007 Christian Heimes <christian (at) cheimes (dot) de>
+
+# This program is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the
+# Free Software Foundation; either version 2 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc., 59
+# Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+"""Moul QT GUI main module
+"""
import sys
-from PyQt4 import QtCore, QtGui
+from PyQt4 import QtGui
+
from moul.qt.mainwindow import MainWindow
from moul.file import plasmalog
+from moul.file import wdysini
+from moul.file import kiimage
+from moul.time import cavern as caverntime
+from moul.time import dni as dnitime
-app = QtGui.QApplication(sys.argv)
-mainWindow = MainWindow()
-mainWindow.show()
-sys.exit(app.exec_())
+def main(*args):
+ app = QtGui.QApplication(*args)
+ mainWindow = MainWindow()
+ mainWindow.show()
+ return app.exec_()
+
+if __name__ == '__main__':
+ err = main(sys.argv)
+ sys.exit(err)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|