Thread: [Pymoul-svn] SF.net SVN: pymoul: [16] pymoul/trunk
Status: Alpha
Brought to you by:
tiran
From: <ti...@us...> - 2007-01-12 16:23:53
|
Revision: 16 http://pymoul.svn.sourceforge.net/pymoul/?rev=16&view=rev Author: tiran Date: 2007-01-12 08:23:37 -0800 (Fri, 12 Jan 2007) Log Message: ----------- Removed GTK support in favor of QT. Qt Desinger is cool and PyQt makes more fun :) Modified Paths: -------------- pymoul/trunk/INSTALL.txt pymoul/trunk/setup.py pymoul/trunk/setup_win32.py pymoul/trunk/src/moul/qt/MainWindow.ui Removed Paths: ------------- pymoul/trunk/README.gtk.txt pymoul/trunk/src/moul/gtk/ Property Changed: ---------------- pymoul/trunk/ Property changes on: pymoul/trunk ___________________________________________________________________ Name: svn:ignore - build dist distgtk + build dist Modified: pymoul/trunk/INSTALL.txt =================================================================== --- pymoul/trunk/INSTALL.txt 2007-01-12 16:19:52 UTC (rev 15) +++ pymoul/trunk/INSTALL.txt 2007-01-12 16:23:37 UTC (rev 16) @@ -3,7 +3,7 @@ * Python 2.5.x - Also read README.qt.txt and README.gtk.txt + Also read README.qt.txt Windows ------- Deleted: pymoul/trunk/README.gtk.txt =================================================================== --- pymoul/trunk/README.gtk.txt 2007-01-12 16:19:52 UTC (rev 15) +++ pymoul/trunk/README.gtk.txt 2007-01-12 16:23:37 UTC (rev 16) @@ -1,5 +0,0 @@ - * PyGTK (Win32: http://www.pcpm.ucl.ac.be/~gustin/win32_ports/) - * Gtk+ Development Environment (Win32: http://gladewin32.sourceforge.net/) - * Tepache http://www.gnomefiles.org/app.php/tepache - * GnuWin32 patch and diffutils http://gnuwin32.sourceforge.net/packages.html - * GTK+ 2.8 Runtime Environment (Win32: http://gladewin32.sourceforge.net/) \ No newline at end of file Modified: pymoul/trunk/setup.py =================================================================== --- pymoul/trunk/setup.py 2007-01-12 16:19:52 UTC (rev 15) +++ pymoul/trunk/setup.py 2007-01-12 16:23:37 UTC (rev 16) @@ -45,7 +45,7 @@ options = {}, data_files = [], package_dir = {'' : 'src'}, - packages = find_packages('src', exclude="moul.gtk,moul.qt"), + packages = find_packages('src', exclude="moul.qt"), include_package_data = True, zip_safe = True, ) @@ -71,13 +71,10 @@ if sys.platform.startswith('win'): from setup_win32 import updateSetupOptions - from setup_win32 import updateSetupOptionsGTK from setup_win32 import updateSetupOptionsQT from setup_win32 import upxPack - from setup_win32 import copyGTK updateSetupOptions(kwargs) updateSetupOptionsQT(kwargs) - #updateSetupOptionsGTK(kwargs) setup(**kwargs) @@ -86,4 +83,3 @@ if sys.platform.startswith('win') and 'py2exe' in sys.argv: pass upxPack('dist') - #copyGTK() Modified: pymoul/trunk/setup_win32.py =================================================================== --- pymoul/trunk/setup_win32.py 2007-01-12 16:19:52 UTC (rev 15) +++ pymoul/trunk/setup_win32.py 2007-01-12 16:23:37 UTC (rev 16) @@ -1,15 +1,4 @@ """Win23 helpers for setup.py - 'dll_excludes': [ - 'iconv.dll','intl.dll','libatk-1.0-0.dll', - 'libgdk_pixbuf-2.0-0.dll','libgdk-win32-2.0-0.dll', - 'libglib-2.0-0.dll','libgmodule-2.0-0.dll', - 'libgobject-2.0-0.dll','libgthread-2.0-0.dll', - 'libgtk-win32-2.0-0.dll','libpango-1.0-0.dll', - 'libpangowin32-1.0-0.dll','libcairo-2.dll', - 'libpangocairo-1.0-0.dll','libpangoft2-1.0-0.dll', - # my - 'libglade-2.0-0.dll', - ], """ import os import sys @@ -80,24 +69,6 @@ pexe['includes'] = 'encodings,encodings.*' kw['zipfile'] = 'library.zip' -def updateSetupOptionsGTK(kw): - for req in (): - kw['setup_requires'].append(req) - for req in ('pygtk>=2.0',): - kw['install_requires'].append(req) - for f in ('src/moul/gtk/moulgtk.glade',): - kw['data_files'].append(f) - kw['packages'].append('moul.gtk') - windows = kw.setdefault('windows', []) - windows.append({ - "script" : "src/moul/gtk/moulgtk.py", - "icon_resources": [(1, "src/moul/uru.ico")] - } - ) - pexe = kw['options']['py2exe'] - includes = pexe.setdefault('includes', '') - pexe['includes'] = ','.join(('pango,atk,gobject,cairo,pangocairo,gtk.keysyms', includes)) - def updateSetupOptionsQT(kw): pexe = kw['options'].setdefault('py2exe', {}) pexe['includes'] = 'PyQt4.uic,PyQt4.uic.*' @@ -108,17 +79,3 @@ "icon_resources": [(1, "src/moul/uru.ico")] } ) -def copyGTK(): - print >>sys.stderr, """ -*** COPY GTK FILES *** - -Now you have to copy the following directories from %s into the dist folder: - - * etc/ - * lib/pango/ - * lib/gtk-2.0/2.10.0/ [TBT] - * share/themes/ - * share/locales/ for every language you want to support - -You have to do this only once -""" % os.environ.get('GTK_BASEPATH', "NOT FOUND") Modified: pymoul/trunk/src/moul/qt/MainWindow.ui =================================================================== --- pymoul/trunk/src/moul/qt/MainWindow.ui 2007-01-12 16:19:52 UTC (rev 15) +++ pymoul/trunk/src/moul/qt/MainWindow.ui 2007-01-12 16:23:37 UTC (rev 16) @@ -1,6 +1,9 @@ <ui version="4.0" > <class>MainWindow</class> <widget class="QMainWindow" name="MainWindow" > + <property name="windowModality" > + <enum>Qt::ApplicationModal</enum> + </property> <property name="geometry" > <rect> <x>0</x> @@ -11,46 +14,120 @@ </property> <property name="sizePolicy" > <sizepolicy> - <hsizetype>0</hsizetype> - <vsizetype>0</vsizetype> + <hsizetype>13</hsizetype> + <vsizetype>13</vsizetype> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> </property> + <property name="minimumSize" > + <size> + <width>350</width> + <height>450</height> + </size> + </property> + <property name="maximumSize" > + <size> + <width>350</width> + <height>450</height> + </size> + </property> <property name="windowTitle" > <string>MainWindow</string> </property> <widget class="QWidget" name="centralwidget" > - <widget class="QSlider" name="horizontalSlider" > + <property name="enabled" > + <bool>true</bool> + </property> + <widget class="QTabWidget" name="tabWidget" > <property name="geometry" > <rect> - <x>100</x> - <y>230</y> - <width>160</width> - <height>16</height> + <x>0</x> + <y>40</y> + <width>351</width> + <height>391</height> </rect> </property> - <property name="maximum" > - <number>11</number> - </property> - <property name="pageStep" > - <number>1</number> - </property> - <property name="sliderPosition" > + <property name="currentIndex" > <number>0</number> </property> - <property name="tracking" > - <bool>true</bool> - </property> - <property name="orientation" > - <enum>Qt::Horizontal</enum> - </property> - <property name="tickPosition" > - <enum>QSlider::TicksBelow</enum> - </property> - <property name="tickInterval" > - <number>1</number> - </property> + <widget class="QWidget" name="tab" > + <attribute name="title" > + <string>Tab 1</string> + </attribute> + </widget> + <widget class="QWidget" name="tab_3" > + <attribute name="title" > + <string>Page</string> + </attribute> + <widget class="QGroupBox" name="groupBox" > + <property name="geometry" > + <rect> + <x>10</x> + <y>10</y> + <width>181</width> + <height>81</height> + </rect> + </property> + <property name="title" > + <string>GroupBox</string> + </property> + <widget class="QSlider" name="horizontalSlider" > + <property name="geometry" > + <rect> + <x>10</x> + <y>30</y> + <width>160</width> + <height>16</height> + </rect> + </property> + <property name="maximum" > + <number>11</number> + </property> + <property name="pageStep" > + <number>1</number> + </property> + <property name="sliderPosition" > + <number>0</number> + </property> + <property name="tracking" > + <bool>true</bool> + </property> + <property name="orientation" > + <enum>Qt::Horizontal</enum> + </property> + <property name="tickPosition" > + <enum>QSlider::TicksBelow</enum> + </property> + <property name="tickInterval" > + <number>1</number> + </property> + </widget> + </widget> + <widget class="QGroupBox" name="groupBox_2" > + <property name="geometry" > + <rect> + <x>10</x> + <y>100</y> + <width>331</width> + <height>251</height> + </rect> + </property> + <property name="title" > + <string>GroupBox</string> + </property> + </widget> + </widget> + <widget class="QWidget" name="tab_2" > + <attribute name="title" > + <string>Tab 2</string> + </attribute> + </widget> + <widget class="QWidget" name="tab_4" > + <attribute name="title" > + <string>Page</string> + </attribute> + </widget> </widget> </widget> <widget class="QStatusBar" name="statusbar" /> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ti...@us...> - 2007-01-12 18:19:54
|
Revision: 19 http://pymoul.svn.sourceforge.net/pymoul/?rev=19&view=rev Author: tiran Date: 2007-01-12 10:19:48 -0800 (Fri, 12 Jan 2007) Log Message: ----------- * Added compileui script to compile QtDesigner's UI files to Python files * Moved UI files to seperate subfolder Modified Paths: -------------- pymoul/trunk/setup.py pymoul/trunk/src/moul/qt/moulqt.py pymoul/trunk/src/pyMoul.egg-info/SOURCES.txt Added Paths: ----------- pymoul/trunk/compileui.py pymoul/trunk/src/moul/qt/ui/ pymoul/trunk/src/moul/qt/ui/README.txt pymoul/trunk/src/moul/qt/ui/__init__.py pymoul/trunk/src/moul/qt/ui/mainwindow.py pymoul/trunk/src/moul/qt/ui/mainwindow.ui Removed Paths: ------------- pymoul/trunk/src/moul/qt/MainWindow.ui pymoul/trunk/src/moul/qt/mainwindow.py Added: pymoul/trunk/compileui.py =================================================================== --- pymoul/trunk/compileui.py (rev 0) +++ pymoul/trunk/compileui.py 2007-01-12 18:19:48 UTC (rev 19) @@ -0,0 +1,55 @@ +#!/usr/bin/env python2.5 +"""Compile QtDesigner's UI files to Python files +""" +import os +from PyQt4 import uic + +UI_EXT = '.ui' +PY_EXT = '.py' + +def previewUi(uifname): + """Copied from PyQt.uic.pyuic + """ + from PyQt4 import QtGui + app = QtGui.QApplication([uifname]) + widget = uic.loadUi(uifname) + widget.show() + return app.exec_() + +def findUiFiles(base): + uis = [] + if not os.path.isdir(base): + raise IOError("%s is not a directory" % root) + for root, dirs, files in os.walk(base): + if '.svn' in dirs: + dirs.remove('.svn') + for file in files: + if file.endswith(UI_EXT): + uis.append((root, file)) + return uis + +def compileUiFiles(uis, execute=False, preview=False): + pys = [] + for root, ui_name in uis: + py_name = ui_name.lower()[:-len(UI_EXT)]+PY_EXT + ui_path = os.path.join(root, ui_name) + py_path = os.path.join(root, py_name) + ui = open(ui_path, 'r') + py = open(py_path, 'w') + err = uic.compileUi(ui, py, execute) + if err: + raise RuntimeError("%s: %s" % (ui_path, str(err))) + if preview: + previewUi(ui_path) + pys.append(py_path) + return pys + +def compileUi(base='src', execute=True, preview=False): + uis = findUiFiles(base) + pys = compileUiFiles(uis, execute=execute, preview=preview) + return pys + +if __name__ == '__main__': + pys = compileUi() + print "Python files written:\n" + print '\n'.join(pys) Modified: pymoul/trunk/setup.py =================================================================== --- pymoul/trunk/setup.py 2007-01-12 18:15:06 UTC (rev 18) +++ pymoul/trunk/setup.py 2007-01-12 18:19:48 UTC (rev 19) @@ -1,3 +1,4 @@ +#/usr/bin/env python2.5 """pyMoul: Python tools for Myst Online - URU Live (MOUL) TODO: Long description of pyMoul @@ -9,6 +10,7 @@ use_setuptools() from setuptools import setup from setuptools import find_packages +from compileui import compileUi VERSION = "0.0" @@ -65,10 +67,15 @@ fd.write("%s = '''%s'''\n" % (name, value)) fd.close() +# Write Metadata and compile UI files +writeMetadata() +compileUi() + kwargs = {} kwargs.update(setup_infos) kwargs.update(setup_options) +# Do some windows stuff if sys.platform.startswith('win'): from setup_win32 import updateSetupOptions from setup_win32 import updateSetupOptionsQT @@ -78,8 +85,6 @@ setup(**kwargs) -writeMetadata() - if sys.platform.startswith('win') and 'py2exe' in sys.argv: pass upxPack('dist') Deleted: pymoul/trunk/src/moul/qt/MainWindow.ui =================================================================== --- pymoul/trunk/src/moul/qt/MainWindow.ui 2007-01-12 18:15:06 UTC (rev 18) +++ pymoul/trunk/src/moul/qt/MainWindow.ui 2007-01-12 18:19:48 UTC (rev 19) @@ -1,137 +0,0 @@ -<ui version="4.0" > - <class>MainWindow</class> - <widget class="QMainWindow" name="MainWindow" > - <property name="windowModality" > - <enum>Qt::ApplicationModal</enum> - </property> - <property name="geometry" > - <rect> - <x>0</x> - <y>0</y> - <width>350</width> - <height>450</height> - </rect> - </property> - <property name="sizePolicy" > - <sizepolicy> - <hsizetype>13</hsizetype> - <vsizetype>13</vsizetype> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="minimumSize" > - <size> - <width>350</width> - <height>450</height> - </size> - </property> - <property name="maximumSize" > - <size> - <width>350</width> - <height>450</height> - </size> - </property> - <property name="windowTitle" > - <string>MainWindow</string> - </property> - <widget class="QWidget" name="centralwidget" > - <property name="enabled" > - <bool>true</bool> - </property> - <widget class="QTabWidget" name="tabWidget" > - <property name="geometry" > - <rect> - <x>0</x> - <y>40</y> - <width>351</width> - <height>391</height> - </rect> - </property> - <property name="currentIndex" > - <number>0</number> - </property> - <widget class="QWidget" name="tab" > - <attribute name="title" > - <string>Tab 1</string> - </attribute> - </widget> - <widget class="QWidget" name="tab_3" > - <attribute name="title" > - <string>Page</string> - </attribute> - <widget class="QGroupBox" name="groupBox" > - <property name="geometry" > - <rect> - <x>10</x> - <y>10</y> - <width>181</width> - <height>81</height> - </rect> - </property> - <property name="title" > - <string>GroupBox</string> - </property> - <widget class="QSlider" name="horizontalSlider" > - <property name="geometry" > - <rect> - <x>10</x> - <y>30</y> - <width>160</width> - <height>16</height> - </rect> - </property> - <property name="maximum" > - <number>11</number> - </property> - <property name="pageStep" > - <number>1</number> - </property> - <property name="sliderPosition" > - <number>0</number> - </property> - <property name="tracking" > - <bool>true</bool> - </property> - <property name="orientation" > - <enum>Qt::Horizontal</enum> - </property> - <property name="tickPosition" > - <enum>QSlider::TicksBelow</enum> - </property> - <property name="tickInterval" > - <number>1</number> - </property> - </widget> - </widget> - <widget class="QGroupBox" name="groupBox_2" > - <property name="geometry" > - <rect> - <x>10</x> - <y>100</y> - <width>331</width> - <height>251</height> - </rect> - </property> - <property name="title" > - <string>GroupBox</string> - </property> - </widget> - </widget> - <widget class="QWidget" name="tab_2" > - <attribute name="title" > - <string>Tab 2</string> - </attribute> - </widget> - <widget class="QWidget" name="tab_4" > - <attribute name="title" > - <string>Page</string> - </attribute> - </widget> - </widget> - </widget> - <widget class="QStatusBar" name="statusbar" /> - </widget> - <resources/> - <connections/> -</ui> Deleted: pymoul/trunk/src/moul/qt/mainwindow.py =================================================================== --- pymoul/trunk/src/moul/qt/mainwindow.py 2007-01-12 18:15:06 UTC (rev 18) +++ pymoul/trunk/src/moul/qt/mainwindow.py 2007-01-12 18:19:48 UTC (rev 19) @@ -1,48 +0,0 @@ -# -*- coding: utf-8 -*- - -# Form implementation generated from reading ui file 'MainWindow.ui' -# -# Created: Fri Jan 12 11:52:01 2007 -# by: PyQt4 UI code generator 4.1.1 -# -# WARNING! All changes made in this file will be lost! - -import sys -from PyQt4 import QtCore, QtGui - -class Ui_MainWindow(object): - def setupUi(self, MainWindow): - MainWindow.setObjectName("MainWindow") - MainWindow.resize(QtCore.QSize(QtCore.QRect(0,0,350,450).size()).expandedTo(MainWindow.minimumSizeHint())) - - sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Policy(0),QtGui.QSizePolicy.Policy(0)) - sizePolicy.setHorizontalStretch(0) - sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth(MainWindow.sizePolicy().hasHeightForWidth()) - MainWindow.setSizePolicy(sizePolicy) - - self.centralwidget = QtGui.QWidget(MainWindow) - self.centralwidget.setObjectName("centralwidget") - - self.horizontalSlider = QtGui.QSlider(self.centralwidget) - self.horizontalSlider.setGeometry(QtCore.QRect(100,230,160,16)) - self.horizontalSlider.setMaximum(11) - self.horizontalSlider.setPageStep(1) - self.horizontalSlider.setSliderPosition(0) - self.horizontalSlider.setTracking(True) - self.horizontalSlider.setOrientation(QtCore.Qt.Horizontal) - self.horizontalSlider.setTickPosition(QtGui.QSlider.TicksBelow) - self.horizontalSlider.setTickInterval(1) - self.horizontalSlider.setObjectName("horizontalSlider") - MainWindow.setCentralWidget(self.centralwidget) - - self.statusbar = QtGui.QStatusBar(MainWindow) - self.statusbar.setObjectName("statusbar") - MainWindow.setStatusBar(self.statusbar) - - self.retranslateUi(MainWindow) - QtCore.QMetaObject.connectSlotsByName(MainWindow) - - def retranslateUi(self, MainWindow): - MainWindow.setWindowTitle(QtGui.QApplication.translate("MainWindow", "MainWindow", None, QtGui.QApplication.UnicodeUTF8)) - Modified: pymoul/trunk/src/moul/qt/moulqt.py =================================================================== --- pymoul/trunk/src/moul/qt/moulqt.py 2007-01-12 18:15:06 UTC (rev 18) +++ pymoul/trunk/src/moul/qt/moulqt.py 2007-01-12 18:19:48 UTC (rev 19) @@ -1,21 +1,12 @@ import sys -from PyQt4 import QtGui -from PyQt4.uic import loadUiType +from PyQt4 import QtCore, QtGui -# XXX IMPORTS! -import _elementtree -import sip -#from moul.qt.mainwindow import Ui_MainWindow +from moul.qt.ui.mainwindow import Ui_MainWindow +from moul.file import plasmalog -import moul.config -import moul.files.plasmalog - -Ui_MainWindow, Qt_MainWindow = loadUiType('mainwindow.ui') - app = QtGui.QApplication(sys.argv) -window = QtGui.QMainWindow() +MainWindow = QtGui.QMainWindow() ui = Ui_MainWindow() -ui.setupUi(window) - -window.show() +ui.setupUi(MainWindow) +MainWindow.show() sys.exit(app.exec_()) Added: pymoul/trunk/src/moul/qt/ui/README.txt =================================================================== --- pymoul/trunk/src/moul/qt/ui/README.txt (rev 0) +++ pymoul/trunk/src/moul/qt/ui/README.txt 2007-01-12 18:19:48 UTC (rev 19) @@ -0,0 +1,8 @@ +WARNING! +======== + +All Python files in this directory are autogenerated! + +DO NOT CHANGE THEM MANUALLY! + +Use compileui.py to compile the UI files to Python files. \ No newline at end of file Property changes on: pymoul/trunk/src/moul/qt/ui/README.txt ___________________________________________________________________ Name: svn:eol-style + native Added: pymoul/trunk/src/moul/qt/ui/__init__.py =================================================================== --- pymoul/trunk/src/moul/qt/ui/__init__.py (rev 0) +++ pymoul/trunk/src/moul/qt/ui/__init__.py 2007-01-12 18:19:48 UTC (rev 19) @@ -0,0 +1,7 @@ +# See http://peak.telecommunity.com/DevCenter/setuptools#namespace-packages +try: + __import__('pkg_resources').declare_namespace(__name__) +except ImportError: + from pkgutil import extend_path + __path__ = extend_path(__path__, __name__) + Property changes on: pymoul/trunk/src/moul/qt/ui/__init__.py ___________________________________________________________________ Name: svn:eol-style + native Added: pymoul/trunk/src/moul/qt/ui/mainwindow.py =================================================================== --- pymoul/trunk/src/moul/qt/ui/mainwindow.py (rev 0) +++ pymoul/trunk/src/moul/qt/ui/mainwindow.py 2007-01-12 18:19:48 UTC (rev 19) @@ -0,0 +1,96 @@ +# -*- coding: utf-8 -*- + +# Form implementation generated from reading ui file 'src\moul\qt\ui\mainwindow.ui' +# +# Created: Fri Jan 12 19:11:35 2007 +# by: PyQt4 UI code generator 4.1.1 +# +# WARNING! All changes made in this file will be lost! + +import sys +from PyQt4 import QtCore, QtGui + +class Ui_MainWindow(object): + def setupUi(self, MainWindow): + MainWindow.setObjectName("MainWindow") + MainWindow.setWindowModality(QtCore.Qt.ApplicationModal) + MainWindow.resize(QtCore.QSize(QtCore.QRect(0,0,350,450).size()).expandedTo(MainWindow.minimumSizeHint())) + + sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Policy(13),QtGui.QSizePolicy.Policy(13)) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(MainWindow.sizePolicy().hasHeightForWidth()) + MainWindow.setSizePolicy(sizePolicy) + MainWindow.setMinimumSize(QtCore.QSize(350,450)) + MainWindow.setMaximumSize(QtCore.QSize(350,450)) + + self.centralwidget = QtGui.QWidget(MainWindow) + self.centralwidget.setEnabled(True) + self.centralwidget.setObjectName("centralwidget") + + self.tabWidget = QtGui.QTabWidget(self.centralwidget) + self.tabWidget.setGeometry(QtCore.QRect(0,40,351,391)) + self.tabWidget.setObjectName("tabWidget") + + self.tab = QtGui.QWidget() + self.tab.setObjectName("tab") + self.tabWidget.addTab(self.tab,"") + + self.tab_3 = QtGui.QWidget() + self.tab_3.setObjectName("tab_3") + + self.groupBox = QtGui.QGroupBox(self.tab_3) + self.groupBox.setGeometry(QtCore.QRect(10,10,181,81)) + self.groupBox.setObjectName("groupBox") + + self.horizontalSlider = QtGui.QSlider(self.groupBox) + self.horizontalSlider.setGeometry(QtCore.QRect(10,30,160,16)) + self.horizontalSlider.setMaximum(11) + self.horizontalSlider.setPageStep(1) + self.horizontalSlider.setSliderPosition(0) + self.horizontalSlider.setTracking(True) + self.horizontalSlider.setOrientation(QtCore.Qt.Horizontal) + self.horizontalSlider.setTickPosition(QtGui.QSlider.TicksBelow) + self.horizontalSlider.setTickInterval(1) + self.horizontalSlider.setObjectName("horizontalSlider") + + self.groupBox_2 = QtGui.QGroupBox(self.tab_3) + self.groupBox_2.setGeometry(QtCore.QRect(10,100,331,251)) + self.groupBox_2.setObjectName("groupBox_2") + self.tabWidget.addTab(self.tab_3,"") + + self.tab_2 = QtGui.QWidget() + self.tab_2.setObjectName("tab_2") + self.tabWidget.addTab(self.tab_2,"") + + self.tab_4 = QtGui.QWidget() + self.tab_4.setObjectName("tab_4") + self.tabWidget.addTab(self.tab_4,"") + MainWindow.setCentralWidget(self.centralwidget) + + self.statusbar = QtGui.QStatusBar(MainWindow) + self.statusbar.setObjectName("statusbar") + MainWindow.setStatusBar(self.statusbar) + + self.retranslateUi(MainWindow) + self.tabWidget.setCurrentIndex(0) + QtCore.QMetaObject.connectSlotsByName(MainWindow) + + def retranslateUi(self, MainWindow): + MainWindow.setWindowTitle(QtGui.QApplication.translate("MainWindow", "MainWindow", None, QtGui.QApplication.UnicodeUTF8)) + self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab), QtGui.QApplication.translate("MainWindow", "Tab 1", None, QtGui.QApplication.UnicodeUTF8)) + self.groupBox.setTitle(QtGui.QApplication.translate("MainWindow", "GroupBox", None, QtGui.QApplication.UnicodeUTF8)) + self.groupBox_2.setTitle(QtGui.QApplication.translate("MainWindow", "GroupBox", None, QtGui.QApplication.UnicodeUTF8)) + self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_3), QtGui.QApplication.translate("MainWindow", "Page", None, QtGui.QApplication.UnicodeUTF8)) + self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_2), QtGui.QApplication.translate("MainWindow", "Tab 2", None, QtGui.QApplication.UnicodeUTF8)) + self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_4), QtGui.QApplication.translate("MainWindow", "Page", None, QtGui.QApplication.UnicodeUTF8)) + + + +if __name__ == "__main__": + app = QtGui.QApplication(sys.argv) + MainWindow = QtGui.QMainWindow() + ui = Ui_MainWindow() + ui.setupUi(MainWindow) + MainWindow.show() + sys.exit(app.exec_()) Property changes on: pymoul/trunk/src/moul/qt/ui/mainwindow.py ___________________________________________________________________ Name: svn:eol-style + native Added: pymoul/trunk/src/moul/qt/ui/mainwindow.ui =================================================================== --- pymoul/trunk/src/moul/qt/ui/mainwindow.ui (rev 0) +++ pymoul/trunk/src/moul/qt/ui/mainwindow.ui 2007-01-12 18:19:48 UTC (rev 19) @@ -0,0 +1,137 @@ +<ui version="4.0" > + <class>MainWindow</class> + <widget class="QMainWindow" name="MainWindow" > + <property name="windowModality" > + <enum>Qt::ApplicationModal</enum> + </property> + <property name="geometry" > + <rect> + <x>0</x> + <y>0</y> + <width>350</width> + <height>450</height> + </rect> + </property> + <property name="sizePolicy" > + <sizepolicy> + <hsizetype>13</hsizetype> + <vsizetype>13</vsizetype> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize" > + <size> + <width>350</width> + <height>450</height> + </size> + </property> + <property name="maximumSize" > + <size> + <width>350</width> + <height>450</height> + </size> + </property> + <property name="windowTitle" > + <string>MainWindow</string> + </property> + <widget class="QWidget" name="centralwidget" > + <property name="enabled" > + <bool>true</bool> + </property> + <widget class="QTabWidget" name="tabWidget" > + <property name="geometry" > + <rect> + <x>0</x> + <y>40</y> + <width>351</width> + <height>391</height> + </rect> + </property> + <property name="currentIndex" > + <number>0</number> + </property> + <widget class="QWidget" name="tab" > + <attribute name="title" > + <string>Tab 1</string> + </attribute> + </widget> + <widget class="QWidget" name="tab_3" > + <attribute name="title" > + <string>Page</string> + </attribute> + <widget class="QGroupBox" name="groupBox" > + <property name="geometry" > + <rect> + <x>10</x> + <y>10</y> + <width>181</width> + <height>81</height> + </rect> + </property> + <property name="title" > + <string>GroupBox</string> + </property> + <widget class="QSlider" name="horizontalSlider" > + <property name="geometry" > + <rect> + <x>10</x> + <y>30</y> + <width>160</width> + <height>16</height> + </rect> + </property> + <property name="maximum" > + <number>11</number> + </property> + <property name="pageStep" > + <number>1</number> + </property> + <property name="sliderPosition" > + <number>0</number> + </property> + <property name="tracking" > + <bool>true</bool> + </property> + <property name="orientation" > + <enum>Qt::Horizontal</enum> + </property> + <property name="tickPosition" > + <enum>QSlider::TicksBelow</enum> + </property> + <property name="tickInterval" > + <number>1</number> + </property> + </widget> + </widget> + <widget class="QGroupBox" name="groupBox_2" > + <property name="geometry" > + <rect> + <x>10</x> + <y>100</y> + <width>331</width> + <height>251</height> + </rect> + </property> + <property name="title" > + <string>GroupBox</string> + </property> + </widget> + </widget> + <widget class="QWidget" name="tab_2" > + <attribute name="title" > + <string>Tab 2</string> + </attribute> + </widget> + <widget class="QWidget" name="tab_4" > + <attribute name="title" > + <string>Page</string> + </attribute> + </widget> + </widget> + </widget> + <widget class="QStatusBar" name="statusbar" /> + </widget> + <resources/> + <connections/> +</ui> Modified: pymoul/trunk/src/pyMoul.egg-info/SOURCES.txt =================================================================== --- pymoul/trunk/src/pyMoul.egg-info/SOURCES.txt 2007-01-12 18:15:06 UTC (rev 18) +++ pymoul/trunk/src/pyMoul.egg-info/SOURCES.txt 2007-01-12 18:19:48 UTC (rev 19) @@ -1,5 +1,6 @@ GPL.txt INSTALL.txt +README.qt.txt README.txt ez_setup.py setup.py @@ -27,14 +28,7 @@ src/moul/files/localization.py src/moul/files/plasmalog.py src/moul/files/wdysini.py -src/moul/gtk/MOULGT~1.GLAp -src/moul/gtk/SimpleGladeApp.py -src/moul/gtk/__init__.py -src/moul/gtk/build.bat -src/moul/gtk/moulgtk.glade -src/moul/gtk/moulgtk.py -src/moul/gtk/moulgtk.py.orig -src/moul/gtk/patchgtkpath.py +src/moul/qt/MainWindow.ui src/moul/qt/__init__.py src/moul/qt/mainwindow.py src/moul/qt/moulqt.py This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ti...@us...> - 2007-01-15 15:19:01
|
Revision: 23 http://pymoul.svn.sourceforge.net/pymoul/?rev=23&view=rev Author: tiran Date: 2007-01-15 07:19:00 -0800 (Mon, 15 Jan 2007) Log Message: ----------- propset svn:eol-style native for all py, txt, ui and qrc files Modified Paths: -------------- pymoul/trunk/compileui.py pymoul/trunk/setup_win32.py Property Changed: ---------------- pymoul/trunk/compileui.py pymoul/trunk/ez_setup.py pymoul/trunk/misc/build_exe.py pymoul/trunk/setup.py pymoul/trunk/setup_win32.py pymoul/trunk/src/moul/__init__.py pymoul/trunk/src/moul/cli/__init__.py pymoul/trunk/src/moul/cli/moullauncher.py pymoul/trunk/src/moul/config/__init__.py pymoul/trunk/src/moul/config/generic.py pymoul/trunk/src/moul/config/miniwinshell.py pymoul/trunk/src/moul/config/win32.py pymoul/trunk/src/moul/crypt/__init__.py pymoul/trunk/src/moul/crypt/bitops.py pymoul/trunk/src/moul/crypt/elf.py pymoul/trunk/src/moul/crypt/whatdoyousee.py pymoul/trunk/src/moul/crypt/xtea.py pymoul/trunk/src/moul/file/__init__.py pymoul/trunk/src/moul/file/chatlog.py pymoul/trunk/src/moul/file/kiimage.py pymoul/trunk/src/moul/file/localization.py pymoul/trunk/src/moul/file/plasmalog.py pymoul/trunk/src/moul/file/wdysini.py pymoul/trunk/src/moul/log.py pymoul/trunk/src/moul/metadata.py pymoul/trunk/src/moul/qt/__init__.py pymoul/trunk/src/moul/qt/moulqt.py pymoul/trunk/src/moul/qt/ui/__init__.py pymoul/trunk/src/moul/qt/ui/mainwindow.py pymoul/trunk/src/moul/qt/ui/mainwindow.ui pymoul/trunk/src/moul/qt/ui/moulqt.qrc pymoul/trunk/src/moul/qt/ui/moulqt_rc.py pymoul/trunk/src/moul/time/__init__.py pymoul/trunk/src/moul/time/cavern.py pymoul/trunk/src/moul/time/dni.py Modified: pymoul/trunk/compileui.py =================================================================== --- pymoul/trunk/compileui.py 2007-01-15 15:15:25 UTC (rev 22) +++ pymoul/trunk/compileui.py 2007-01-15 15:19:00 UTC (rev 23) @@ -1,100 +1,100 @@ -#!/usr/bin/env python2.5 -"""Compile QtDesigner's UI and QRC files to Python files -""" -import os -import re - -from PyQt4 import uic - -RE_RC_TEXT = "^import\ (?P<module>[a-zA-Z]\w*_rc)\s$" -RE_RC = re.compile(RE_RC_TEXT) - -UI_EXT = '.ui' -PY_EXT = '.py' -QRC_EXT = '.qrc' -PY_QRC_EXT = '_rc.py' -QRC_COMPILER = "pyrcc4 -o %(py)s %(qrc)s" -UI_MODULE = "moul.qt.ui" - -def previewUi(uifname): - """Copied from PyQt.uic.pyuic - """ - from PyQt4 import QtGui - app = QtGui.QApplication([uifname]) - widget = uic.loadUi(uifname) - widget.show() - return app.exec_() - -def findFiles(base): - uis = [] - qrcs = [] - if not os.path.isdir(base): - raise IOError("%s is not a directory" % root) - for root, dirs, files in os.walk(base): - if '.svn' in dirs: - dirs.remove('.svn') - for file in files: - if file.endswith(UI_EXT): - uis.append((root, file)) - if file.endswith(QRC_EXT): - qrcs.append((root, file)) - return uis, qrcs - -def compileUiFiles(uis, execute=False, preview=False): - pys = [] - for root, ui_name in uis: - py_name = ui_name.lower()[:-len(UI_EXT)]+PY_EXT - ui_path = os.path.join(root, ui_name) - py_path = os.path.join(root, py_name) - ui = open(ui_path, 'r') - py = open(py_path, 'w') - err = uic.compileUi(ui, py, execute) - ui.close() - py.close() - if err: - raise RuntimeError("%s: %s" % (ui_path, str(err))) - fixRelativeImport(py_path) - if preview: - previewUi(ui_path) - pys.append(py_path) - return pys - -def fixRelativeImport(fname): - lines = [] - fin = open(fname, 'r') - for line in fin: - - if line.startswith('import'): - # faster than re - match = RE_RC.match(line) - if match: - line = match.expand("from %s import \g<module>" % UI_MODULE) - lines.append(line) - fin.close() - fout = open(fname, 'w') - fout.write(''.join(lines)) - fout.close() - -def compileQRCFiles(qrcs): - pys = [] - for root, qrc_name in qrcs: - py_name = qrc_name.lower()[:-len(QRC_EXT)]+PY_QRC_EXT - kw = {} - kw['qrc'] = os.path.join(root, qrc_name) - kw['py'] = os.path.join(root, py_name) - err = os.system(QRC_COMPILER % kw) - if err != 0: - raise RuntimeError("pyrcc error") - pys.append(kw['py']) - return pys - -def compileUi(base='src', execute=True, preview=False): - uis, qrcs = findFiles(base) - upys = compileUiFiles(uis, execute=execute, preview=preview) - qpys = compileQRCFiles(qrcs) - return upys + qpys - -if __name__ == '__main__': - pys = compileUi() - print "Python files written:\n" - print '\n'.join(pys) +#!/usr/bin/env python2.5 +"""Compile QtDesigner's UI and QRC files to Python files +""" +import os +import re + +from PyQt4 import uic + +RE_RC_TEXT = "^import\ (?P<module>[a-zA-Z]\w*_rc)\s$" +RE_RC = re.compile(RE_RC_TEXT) + +UI_EXT = '.ui' +PY_EXT = '.py' +QRC_EXT = '.qrc' +PY_QRC_EXT = '_rc.py' +QRC_COMPILER = "pyrcc4 -o %(py)s %(qrc)s" +UI_MODULE = "moul.qt.ui" + +def previewUi(uifname): + """Copied from PyQt.uic.pyuic + """ + from PyQt4 import QtGui + app = QtGui.QApplication([uifname]) + widget = uic.loadUi(uifname) + widget.show() + return app.exec_() + +def findFiles(base): + uis = [] + qrcs = [] + if not os.path.isdir(base): + raise IOError("%s is not a directory" % root) + for root, dirs, files in os.walk(base): + if '.svn' in dirs: + dirs.remove('.svn') + for file in files: + if file.endswith(UI_EXT): + uis.append((root, file)) + if file.endswith(QRC_EXT): + qrcs.append((root, file)) + return uis, qrcs + +def compileUiFiles(uis, execute=False, preview=False): + pys = [] + for root, ui_name in uis: + py_name = ui_name.lower()[:-len(UI_EXT)]+PY_EXT + ui_path = os.path.join(root, ui_name) + py_path = os.path.join(root, py_name) + ui = open(ui_path, 'r') + py = open(py_path, 'w') + err = uic.compileUi(ui, py, execute) + ui.close() + py.close() + if err: + raise RuntimeError("%s: %s" % (ui_path, str(err))) + fixRelativeImport(py_path) + if preview: + previewUi(ui_path) + pys.append(py_path) + return pys + +def fixRelativeImport(fname): + lines = [] + fin = open(fname, 'r') + for line in fin: + + if line.startswith('import'): + # faster than re + match = RE_RC.match(line) + if match: + line = match.expand("from %s import \g<module>" % UI_MODULE) + lines.append(line) + fin.close() + fout = open(fname, 'w') + fout.write(''.join(lines)) + fout.close() + +def compileQRCFiles(qrcs): + pys = [] + for root, qrc_name in qrcs: + py_name = qrc_name.lower()[:-len(QRC_EXT)]+PY_QRC_EXT + kw = {} + kw['qrc'] = os.path.join(root, qrc_name) + kw['py'] = os.path.join(root, py_name) + err = os.system(QRC_COMPILER % kw) + if err != 0: + raise RuntimeError("pyrcc error") + pys.append(kw['py']) + return pys + +def compileUi(base='src', execute=True, preview=False): + uis, qrcs = findFiles(base) + upys = compileUiFiles(uis, execute=execute, preview=preview) + qpys = compileQRCFiles(qrcs) + return upys + qpys + +if __name__ == '__main__': + pys = compileUi() + print "Python files written:\n" + print '\n'.join(pys) Property changes on: pymoul/trunk/compileui.py ___________________________________________________________________ Name: eol-style + native Name: svn:eol-style + native Property changes on: pymoul/trunk/ez_setup.py ___________________________________________________________________ Name: eol-style + native Property changes on: pymoul/trunk/misc/build_exe.py ___________________________________________________________________ Name: eol-style + native Property changes on: pymoul/trunk/setup.py ___________________________________________________________________ Name: eol-style + native Modified: pymoul/trunk/setup_win32.py =================================================================== --- pymoul/trunk/setup_win32.py 2007-01-15 15:15:25 UTC (rev 22) +++ pymoul/trunk/setup_win32.py 2007-01-15 15:19:00 UTC (rev 23) @@ -1,81 +1,81 @@ -"""Win23 helpers for setup.py -""" -import os -import sys -from setuptools import find_packages - -try: - import py2exe -except ImportError: - print >>sys.stderr, "py2exe missing, unable to create executables" -else: - # If run without args, build executables, in quiet mode. - if len(sys.argv) == 1: - sys.argv.append("py2exe") - -# py2exe's ModuleFinder can't handle runtime changes to __path__, -# but win32com uses them -try: - import modulefinder - import win32com - for p in win32com.__path__[1:]: - modulefinder.AddPackagePath("win32com", p) - for extra in ["win32com.shell"]: - __import__(extra) - m = sys.modules[extra] - for p in m.__path__[1:]: - modulefinder.AddPackagePath(extra, p) -except ImportError: - # no build path setup, no worries. - pass - -def inEnvPath(name): - result = [] - for path in os.environ['PATH'].split(';'): - upx = os.path.join(path, name) - if os.path.isfile(upx): - result.append(upx) - if result: - return result[0] - -def upxPack(dst): - """Pack PE executables with UPX http://upx.sourceforge.net/ - - UPX can shrink dll, exe and pyd files 50 to 70% without disadvantage - """ - if not inEnvPath('upx.exe'): - print >>sys.stderr, "UPX not available - skipping" - upx_pack = [] - for root, dirs, files in os.walk(dst): - for file in files: - if file[-4:] in ('.pyd', '.dll', '.exe'): - upx_pack.append(os.path.join(root, file)) - # --best --all-methods --all-filters - os.system("upx -q --mono %s" % ' '.join(upx_pack)) - -def updateSetupOptions(kw): - for req in ("py2exe >=0.6.5",): - kw['setup_requires'].append(req) - for req in (): - kw['install_requires'].append(req) - kw['console'] = [ - { "script" : "src/moul/cli/moullauncher.py", - "icon_resources": [(1, "src/moul/uru.ico")] - } - ] - pexe = kw['options'].setdefault('py2exe', {}) - pexe['compressed'] = 100 # compress zip file - pexe['optimize'] = 0 # 0,1,2 - #pexe['includes'] = 'encodings,encodings.*' - kw['zipfile'] = 'library.zip' - -def updateSetupOptionsQT(kw): - pexe = kw['options'].setdefault('py2exe', {}) - #pexe['includes'] = 'PyQt4' - kw['packages'].append('moul.qt') - windows = kw.setdefault('windows', []) - windows.append({ - "script" : "src/moul/qt/moulqt.py", - "icon_resources": [(1, "src/moul/uru.ico")] - } - ) +"""Win23 helpers for setup.py +""" +import os +import sys +from setuptools import find_packages + +try: + import py2exe +except ImportError: + print >>sys.stderr, "py2exe missing, unable to create executables" +else: + # If run without args, build executables, in quiet mode. + if len(sys.argv) == 1: + sys.argv.append("py2exe") + +# py2exe's ModuleFinder can't handle runtime changes to __path__, +# but win32com uses them +try: + import modulefinder + import win32com + for p in win32com.__path__[1:]: + modulefinder.AddPackagePath("win32com", p) + for extra in ["win32com.shell"]: + __import__(extra) + m = sys.modules[extra] + for p in m.__path__[1:]: + modulefinder.AddPackagePath(extra, p) +except ImportError: + # no build path setup, no worries. + pass + +def inEnvPath(name): + result = [] + for path in os.environ['PATH'].split(';'): + upx = os.path.join(path, name) + if os.path.isfile(upx): + result.append(upx) + if result: + return result[0] + +def upxPack(dst): + """Pack PE executables with UPX http://upx.sourceforge.net/ + + UPX can shrink dll, exe and pyd files 50 to 70% without disadvantage + """ + if not inEnvPath('upx.exe'): + print >>sys.stderr, "UPX not available - skipping" + upx_pack = [] + for root, dirs, files in os.walk(dst): + for file in files: + if file[-4:] in ('.pyd', '.dll', '.exe'): + upx_pack.append(os.path.join(root, file)) + # --best --all-methods --all-filters + os.system("upx -q --mono %s" % ' '.join(upx_pack)) + +def updateSetupOptions(kw): + for req in ("py2exe >=0.6.5",): + kw['setup_requires'].append(req) + for req in (): + kw['install_requires'].append(req) + kw['console'] = [ + { "script" : "src/moul/cli/moullauncher.py", + "icon_resources": [(1, "src/moul/uru.ico")] + } + ] + pexe = kw['options'].setdefault('py2exe', {}) + pexe['compressed'] = 100 # compress zip file + pexe['optimize'] = 0 # 0,1,2 + #pexe['includes'] = 'encodings,encodings.*' + kw['zipfile'] = 'library.zip' + +def updateSetupOptionsQT(kw): + pexe = kw['options'].setdefault('py2exe', {}) + #pexe['includes'] = 'PyQt4' + kw['packages'].append('moul.qt') + windows = kw.setdefault('windows', []) + windows.append({ + "script" : "src/moul/qt/moulqt.py", + "icon_resources": [(1, "src/moul/uru.ico")] + } + ) Property changes on: pymoul/trunk/setup_win32.py ___________________________________________________________________ Name: eol-style + native Name: svn:eol-style + native Property changes on: pymoul/trunk/src/moul/__init__.py ___________________________________________________________________ Name: eol-style + native Property changes on: pymoul/trunk/src/moul/cli/__init__.py ___________________________________________________________________ Name: eol-style + native Property changes on: pymoul/trunk/src/moul/cli/moullauncher.py ___________________________________________________________________ Name: eol-style + native Property changes on: pymoul/trunk/src/moul/config/__init__.py ___________________________________________________________________ Name: eol-style + native Property changes on: pymoul/trunk/src/moul/config/generic.py ___________________________________________________________________ Name: eol-style + native Property changes on: pymoul/trunk/src/moul/config/miniwinshell.py ___________________________________________________________________ Name: eol-style + native Property changes on: pymoul/trunk/src/moul/config/win32.py ___________________________________________________________________ Name: eol-style + native Property changes on: pymoul/trunk/src/moul/crypt/__init__.py ___________________________________________________________________ Name: eol-style + native Property changes on: pymoul/trunk/src/moul/crypt/bitops.py ___________________________________________________________________ Name: eol-style + native Property changes on: pymoul/trunk/src/moul/crypt/elf.py ___________________________________________________________________ Name: eol-style + native Property changes on: pymoul/trunk/src/moul/crypt/whatdoyousee.py ___________________________________________________________________ Name: eol-style + native Property changes on: pymoul/trunk/src/moul/crypt/xtea.py ___________________________________________________________________ Name: eol-style + native Property changes on: pymoul/trunk/src/moul/file/__init__.py ___________________________________________________________________ Name: eol-style + native Property changes on: pymoul/trunk/src/moul/file/chatlog.py ___________________________________________________________________ Name: eol-style + native Property changes on: pymoul/trunk/src/moul/file/kiimage.py ___________________________________________________________________ Name: eol-style + native Property changes on: pymoul/trunk/src/moul/file/localization.py ___________________________________________________________________ Name: eol-style + native Property changes on: pymoul/trunk/src/moul/file/plasmalog.py ___________________________________________________________________ Name: eol-style + native Property changes on: pymoul/trunk/src/moul/file/wdysini.py ___________________________________________________________________ Name: eol-style + native Property changes on: pymoul/trunk/src/moul/log.py ___________________________________________________________________ Name: eol-style + native Property changes on: pymoul/trunk/src/moul/metadata.py ___________________________________________________________________ Name: eol-style + native Property changes on: pymoul/trunk/src/moul/qt/__init__.py ___________________________________________________________________ Name: eol-style + native Property changes on: pymoul/trunk/src/moul/qt/moulqt.py ___________________________________________________________________ Name: eol-style + native Property changes on: pymoul/trunk/src/moul/qt/ui/__init__.py ___________________________________________________________________ Name: eol-style + native Property changes on: pymoul/trunk/src/moul/qt/ui/mainwindow.py ___________________________________________________________________ Name: eol-style + native Property changes on: pymoul/trunk/src/moul/qt/ui/mainwindow.ui ___________________________________________________________________ Name: svn:eol-style + native Property changes on: pymoul/trunk/src/moul/qt/ui/moulqt.qrc ___________________________________________________________________ Name: svn:eol-style + native Property changes on: pymoul/trunk/src/moul/qt/ui/moulqt_rc.py ___________________________________________________________________ Name: eol-style + native Property changes on: pymoul/trunk/src/moul/time/__init__.py ___________________________________________________________________ Name: eol-style + native Name: svn:eol-style + native Property changes on: pymoul/trunk/src/moul/time/cavern.py ___________________________________________________________________ Name: eol-style + native Name: svn:eol-style + native Property changes on: pymoul/trunk/src/moul/time/dni.py ___________________________________________________________________ Name: eol-style + native Name: svn:eol-style + native This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ti...@us...> - 2007-01-15 15:52:39
|
Revision: 24 http://pymoul.svn.sourceforge.net/pymoul/?rev=24&view=rev Author: tiran Date: 2007-01-15 07:52:35 -0800 (Mon, 15 Jan 2007) Log Message: ----------- Removed egg info stuff from svn Updated some scripts to support Linux and Mac although both systems aren't supported yet Modified Paths: -------------- pymoul/trunk/setup.py pymoul/trunk/setup_win32.py pymoul/trunk/src/moul/cli/moullauncher.py pymoul/trunk/src/moul/config/__init__.py pymoul/trunk/src/moul/qt/moulqt.py Added Paths: ----------- pymoul/trunk/src/moul/config/darwin.py pymoul/trunk/src/moul/config/linux2.py Removed Paths: ------------- pymoul/trunk/src/pyMoul.egg-info/ Property Changed: ---------------- pymoul/trunk/setup.py pymoul/trunk/src/ pymoul/trunk/src/moul/cli/moullauncher.py pymoul/trunk/src/moul/qt/moulqt.py Modified: pymoul/trunk/setup.py =================================================================== --- pymoul/trunk/setup.py 2007-01-15 15:19:00 UTC (rev 23) +++ pymoul/trunk/setup.py 2007-01-15 15:52:35 UTC (rev 24) @@ -1,4 +1,4 @@ -#/usr/bin/env python2.5 +#!/usr/bin/env python2.5 """pyMoul: Python tools for Myst Online - URU Live (MOUL) TODO: Long description of pyMoul @@ -7,8 +7,9 @@ import os import time # boot strap easy setup +SETUPTOOLS_VERSION = "0.6c1" from ez_setup import use_setuptools -use_setuptools() +use_setuptools(version=SETUPTOOLS_VERSION) from setuptools import setup from setuptools import find_packages @@ -42,14 +43,13 @@ ) setup_options = dict( - setup_requires = ["setuptools>=0.6c"], + setup_requires = ["setuptools>="+SETUPTOOLS_VERSION,], install_requires = [], - options = {}, data_files = [], package_dir = {'' : 'src'}, packages = find_packages('src', exclude="moul.qt"), include_package_data = True, - zip_safe = True, + zip_safe = False, ) def writeMetadata(): @@ -75,12 +75,14 @@ kwargs.update(setup_options) # Do some windows stuff -if sys.platform.startswith('win'): +if sys.platform.startswith('win32'): from setup_win32 import updateSetupOptions from setup_win32 import updateSetupOptionsQT from setup_win32 import upxPack updateSetupOptions(kwargs) updateSetupOptionsQT(kwargs) +elif sys.platform.startswith('linux2'): + kwargs['packages'].append('moul.qt') setup(**kwargs) Property changes on: pymoul/trunk/setup.py ___________________________________________________________________ Name: svn:executable + * Modified: pymoul/trunk/setup_win32.py =================================================================== --- pymoul/trunk/setup_win32.py 2007-01-15 15:19:00 UTC (rev 23) +++ pymoul/trunk/setup_win32.py 2007-01-15 15:52:35 UTC (rev 24) @@ -63,6 +63,7 @@ "icon_resources": [(1, "src/moul/uru.ico")] } ] + kw.setdefault('options', {}) pexe = kw['options'].setdefault('py2exe', {}) pexe['compressed'] = 100 # compress zip file pexe['optimize'] = 0 # 0,1,2 Property changes on: pymoul/trunk/src ___________________________________________________________________ Name: svn:ignore + pyMoul.egg-info Modified: pymoul/trunk/src/moul/cli/moullauncher.py =================================================================== --- pymoul/trunk/src/moul/cli/moullauncher.py 2007-01-15 15:19:00 UTC (rev 23) +++ pymoul/trunk/src/moul/cli/moullauncher.py 2007-01-15 15:52:35 UTC (rev 24) @@ -1,3 +1,4 @@ +#!/usr/bin/env python2.5 # pyMoul - Python interface to Myst Online URU Live # Copyright (C) 2007 Christian Heimes <christian (at) cheimes (dot) de> Property changes on: pymoul/trunk/src/moul/cli/moullauncher.py ___________________________________________________________________ Name: svn:executable + * Modified: pymoul/trunk/src/moul/config/__init__.py =================================================================== --- pymoul/trunk/src/moul/config/__init__.py 2007-01-15 15:19:00 UTC (rev 23) +++ pymoul/trunk/src/moul/config/__init__.py 2007-01-15 15:52:35 UTC (rev 24) @@ -23,7 +23,7 @@ import sys _marker=object() - +# XXX: what about cygwin, bsd and others? if sys.platform.startswith('win32'): from moul.config.win32 import ( getMoulUserDataDir, @@ -31,6 +31,20 @@ _startMOUL, EXEC_NAME ) +elif sys.platform.startswith('linux2'): + from moul.config.linux import ( + getMoulUserDataDir, + getPyMoulIniLocation, + _startMOUL, + EXEC_NAME + ) +elif sys.platform.startswith('darwin'): + from moul.config.darwin import ( + getMoulUserDataDir, + getPyMoulIniLocation, + _startMOUL, + EXEC_NAME + ) else: raise RuntimeError('platform %s not supported' % sys.platform) Added: pymoul/trunk/src/moul/config/darwin.py =================================================================== --- pymoul/trunk/src/moul/config/darwin.py (rev 0) +++ pymoul/trunk/src/moul/config/darwin.py 2007-01-15 15:52:35 UTC (rev 24) @@ -0,0 +1,53 @@ +# 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 +# +"""Darwin (Mac OS X) configuration for pyMoul + +XXX: untested! +""" +import os +from moul.log import LOG +LOG.warning('Darwin/Mac support is not tested') + +MOUL_DIR = "Uru Live" +INI_FILE = ('pyMoul', 'pymoul.ini') +EXEC_NAME = "UruLauncher" +HOME = os.environ('HOME') + +def getMoulUserDataDir(): + """Get path of MOUL data directory + + The MOUL data directory contains log files, chatlogs, KI images and many + more things. + """ + moul_data = os.path.join(HOME, MOUL_DIR) + +def getPyMoulIniLocation(): + """Get path to the pyMoul ini file + """ + ini_file = os.path.join(HOME, *INI_FILE) + return ini_file + +def _startMOUL(installdir, *args): + """Start MOUL + """ + # P_DETACH is similar to P_NOWAIT, but the new process is detached from + # the console of the calling process. + mode = os.P_DETACH + path = os.path.join(installdir, EXEC_NAME) + args = (EXEC_NAME,) + args + return os.spawnv(mode, path, args) Added: pymoul/trunk/src/moul/config/linux2.py =================================================================== --- pymoul/trunk/src/moul/config/linux2.py (rev 0) +++ pymoul/trunk/src/moul/config/linux2.py 2007-01-15 15:52:35 UTC (rev 24) @@ -0,0 +1,53 @@ +# 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 +# +"""Linux configuration for pyMoul + +XXX: untested! +""" +import os +from moul.log import LOG +LOG.warning('Linux support is not tested') + +MOUL_DIR = "Uru Live" +INI_FILE = ('pyMoul', 'pymoul.ini') +EXEC_NAME = "UruLauncher" +HOME = os.environ('HOME') + +def getMoulUserDataDir(): + """Get path of MOUL data directory + + The MOUL data directory contains log files, chatlogs, KI images and many + more things. + """ + moul_data = os.path.join(HOME, MOUL_DIR) + +def getPyMoulIniLocation(): + """Get path to the pyMoul ini file + """ + ini_file = os.path.join(HOME, *INI_FILE) + return ini_file + +def _startMOUL(installdir, *args): + """Start MOUL + """ + # P_DETACH is similar to P_NOWAIT, but the new process is detached from + # the console of the calling process. + mode = os.P_DETACH + path = os.path.join(installdir, EXEC_NAME) + args = (EXEC_NAME,) + args + return os.spawnv(mode, path, args) Modified: pymoul/trunk/src/moul/qt/moulqt.py =================================================================== --- pymoul/trunk/src/moul/qt/moulqt.py 2007-01-15 15:19:00 UTC (rev 23) +++ pymoul/trunk/src/moul/qt/moulqt.py 2007-01-15 15:52:35 UTC (rev 24) @@ -1,3 +1,4 @@ +#!/usr/bin/env python2.5 import sys from PyQt4 import QtCore, QtGui Property changes on: pymoul/trunk/src/moul/qt/moulqt.py ___________________________________________________________________ Name: svn:executable + * This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ti...@us...> - 2007-01-15 17:50:07
|
Revision: 26 http://pymoul.svn.sourceforge.net/pymoul/?rev=26&view=rev Author: tiran Date: 2007-01-15 09:28:51 -0800 (Mon, 15 Jan 2007) Log Message: ----------- Added dummy i18n message and message factory inspired by Zope3 Added unit test packages and first doc test Modified Paths: -------------- pymoul/trunk/src/moul/config/generic.py pymoul/trunk/src/moul/crypt/elf.py pymoul/trunk/src/moul/crypt/whatdoyousee.py pymoul/trunk/src/moul/log.py pymoul/trunk/src/moul/time/dni.py Added Paths: ----------- pymoul/trunk/src/moul/cli/tests/ pymoul/trunk/src/moul/cli/tests/__init__.py pymoul/trunk/src/moul/config/tests/ pymoul/trunk/src/moul/config/tests/__init__.py pymoul/trunk/src/moul/crypt/tests/ pymoul/trunk/src/moul/crypt/tests/__init__.py pymoul/trunk/src/moul/file/tests/ pymoul/trunk/src/moul/file/tests/__init__.py pymoul/trunk/src/moul/i18n.py pymoul/trunk/src/moul/qt/tests/ pymoul/trunk/src/moul/qt/tests/__init__.py pymoul/trunk/src/moul/tests/__init__.py pymoul/trunk/src/moul/tests/test_i18n.py pymoul/trunk/src/moul/time/tests/ pymoul/trunk/src/moul/time/tests/__init__.py Removed Paths: ------------- pymoul/trunk/src/moul/crypt/bitops.py Property Changed: ---------------- pymoul/trunk/test.py Added: pymoul/trunk/src/moul/cli/tests/__init__.py =================================================================== --- pymoul/trunk/src/moul/cli/tests/__init__.py (rev 0) +++ pymoul/trunk/src/moul/cli/tests/__init__.py 2007-01-15 17:28:51 UTC (rev 26) @@ -0,0 +1,2 @@ +# testing package + Modified: pymoul/trunk/src/moul/config/generic.py =================================================================== --- pymoul/trunk/src/moul/config/generic.py 2007-01-15 16:08:38 UTC (rev 25) +++ pymoul/trunk/src/moul/config/generic.py 2007-01-15 17:28:51 UTC (rev 26) @@ -17,20 +17,6 @@ # """cross platform configuration tools for pyMoul """ -from ConfigParser import SafeConfigParser - -class PyMoulConfig(object): - _default = { - 'pyMoul': { - 'moul_install_dir' : 'C:\\Program Files\\Myst Online', - } - } - - def __init__(self, fname): - self._parser = SafeConfigParser() - self._fname = fname - self._data = {} - # Stub for platform specific functions def getMoulUserDataDir(): """Get path of MOUL user data directory Added: pymoul/trunk/src/moul/config/tests/__init__.py =================================================================== --- pymoul/trunk/src/moul/config/tests/__init__.py (rev 0) +++ pymoul/trunk/src/moul/config/tests/__init__.py 2007-01-15 17:28:51 UTC (rev 26) @@ -0,0 +1,2 @@ +# testing package + Deleted: pymoul/trunk/src/moul/crypt/bitops.py =================================================================== --- pymoul/trunk/src/moul/crypt/bitops.py 2007-01-15 16:08:38 UTC (rev 25) +++ pymoul/trunk/src/moul/crypt/bitops.py 2007-01-15 17:28:51 UTC (rev 26) @@ -1,49 +0,0 @@ -# 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 -# -"""Misc bit operation helpers -""" -# str2int, lshift, rshift, list2int, list2str - -def str2int(s): - """converts a string to an integer""" - out = 0 - for i, e in enumerate(s): - out += ord(e) << 8*i - return out - -def int2str(i): - """ """ - out = [] - for j in (0,1,2,3): - s = rshift(i, 8*j) - out.append(chr(s)) - return ''.join(out) - -def lshift(a, b, mask=0xff): - """8 bit integer <<""" - return (a << b) & mask - -def rshift(a, b, mask=0xff): - """8 bit integer >>""" - return (a >> b) & mask - -def list2int(lst): - return [ord(s) for s in lst] - -def list2str(lst): - return [chr(s) for s in lst] Modified: pymoul/trunk/src/moul/crypt/elf.py =================================================================== --- pymoul/trunk/src/moul/crypt/elf.py 2007-01-15 16:08:38 UTC (rev 25) +++ pymoul/trunk/src/moul/crypt/elf.py 2007-01-15 17:28:51 UTC (rev 26) @@ -19,8 +19,12 @@ Based on the C++ code from Marack """ -from mounl.crypt.bitops import str2int, lshift, rshift, list2int, list2str +def list2int(lst): + return [ord(s) for s in lst] +def list2str(lst): + return [chr(s) for s in lst] + def decryptElf(fin): """Decrypts an encrypted log file (MOUL elf file) @@ -65,20 +69,20 @@ b = key d = v[0] d = d ^ b - d = rshift(d, 5) # d >> 5 + d = (d >> 5) & 0xff i = size - 1 while i >=0: a = v[i] a = a ^ b c = a - a = lshift(a, 3) # a << 3 + a = (a << 3) & 0xff a = a | d d = a - d = rshift(d, 6) # d >> 6 - a = lshift(a, 2) # a << 2 + d = (d >> 6) & 0xff + a = (a << 2) & 0xff d = d | a - c = rshift(c, 5) # c >> 5 + c = (c >> 5) & 0xff v[i] = d d = c @@ -97,28 +101,24 @@ # Startup c = v[len - 1]; c &= 0xfc; - c = lshift(c, 3) # c << 3; + c = (c << 3) & 0xff i = 0 while i < len: d = v[i] a = d - a = lshift(a, 6) # a << 6 - d = rshift(d, 2) # d >> 2 + a = (a << 6) & 0xff + d = (d >> 2) & 0xff a = a | d d = a - a = rshift(a, 3) # a >> 3 + a = (a >> 3) & 0xff a = a | c c = key a = a ^ c - d = lshift(d, 5) # d << 5 + d = (d << 5) & 0xff v[i] = a c = d i+=1 return ''.join(list2str(v)) - -if __name__ == '__main__': - fd = open("Python.0.elf", 'rb') - print '\n'.join(decryptElf(fd)) Added: pymoul/trunk/src/moul/crypt/tests/__init__.py =================================================================== --- pymoul/trunk/src/moul/crypt/tests/__init__.py (rev 0) +++ pymoul/trunk/src/moul/crypt/tests/__init__.py 2007-01-15 17:28:51 UTC (rev 26) @@ -0,0 +1,2 @@ +# testing package + Modified: pymoul/trunk/src/moul/crypt/whatdoyousee.py =================================================================== --- pymoul/trunk/src/moul/crypt/whatdoyousee.py 2007-01-15 16:08:38 UTC (rev 25) +++ pymoul/trunk/src/moul/crypt/whatdoyousee.py 2007-01-15 17:28:51 UTC (rev 26) @@ -26,8 +26,6 @@ """ import struct -from moul.crypt.bitops import str2int -from moul.crypt.bitops import int2str from moul.crypt.xtea import xtea_decrypt from moul.crypt.xtea import xtea_encrypt @@ -48,7 +46,7 @@ raise IOError("Not a whatdoyousee/xTEA encrypted file") header = fin.read(4) - length = str2int(header) + struct.unpack(ENDIAN+"L", header) out = [] pos = 0 @@ -74,7 +72,7 @@ fout.write(HEADER) flen = len(instr) - length = int2str(flen) + length = struct.pack(ENDIAN+"L", flen) fout.write(length) pos = 0 Added: pymoul/trunk/src/moul/file/tests/__init__.py =================================================================== --- pymoul/trunk/src/moul/file/tests/__init__.py (rev 0) +++ pymoul/trunk/src/moul/file/tests/__init__.py 2007-01-15 17:28:51 UTC (rev 26) @@ -0,0 +1,2 @@ +# testing package + Added: pymoul/trunk/src/moul/i18n.py =================================================================== --- pymoul/trunk/src/moul/i18n.py (rev 0) +++ pymoul/trunk/src/moul/i18n.py 2007-01-15 17:28:51 UTC (rev 26) @@ -0,0 +1,91 @@ +# 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 +# +"""pyMoul i18n + +A dumb and do nearly nothing i18n message factory and message implementation. +It's a kind of a place holder. + +Inspired by zope.i18nmessage + +>>> _ = MessageFactory('test') +>>> msg = _(u'test') +>>> msg +u'test' +>>> msg.domain +'test' +>>> msg.default +u'test' +>>> msg.mapping is None +True + +>>> template = _(u'id', u'This is a ${name}!') +>>> template +u'id' +>>> template % {'name' : u'test'} +u'This is a test!' +>>> template % {'name' : u'another test'} +u'This is a another test!' + +>>> error = _('id') +Traceback (most recent call last): +... +TypeError: ustr must be a unicode string +>>> error = _(u'id', 'This is a ${name}!') +Traceback (most recent call last): +... +TypeError: default must be a unicode string +""" +from string import Template + +__all__ = ['_', 'PymoulMessageFactory', 'MessageFactory'] + +class Message(unicode, Template): + __slots__ = ('domain', 'default', 'mapping') + + def __new__(cls, ustr, domain=None, default=None, mapping=None): + if not isinstance(ustr, unicode): + raise TypeError("ustr must be a unicode string") + if default is not None and not isinstance(default, unicode): + raise TypeError("default must be a unicode string") + + self = unicode.__new__(cls, ustr) + self.domain = domain + if default is None: + self.default = unicode(ustr) + else: + self.default = unicode(default) + self.mapping = mapping + return self + + def __init__(self, *args, **kwargs): + return Template.__init__(self, self.default) + + def __mod__(self, other): + return self.substitute(other) + +class MessageFactory(object): + """Factory for Messages""" + + def __init__(self, domain): + self._domain = domain + + def __call__(self, ustr, default=None, mapping=None): + return Message(ustr, self._domain, default, mapping) + +_ = PymoulMessageFactory = MessageFactory('pymoul') + Modified: pymoul/trunk/src/moul/log.py =================================================================== --- pymoul/trunk/src/moul/log.py 2007-01-15 16:08:38 UTC (rev 25) +++ pymoul/trunk/src/moul/log.py 2007-01-15 17:28:51 UTC (rev 26) @@ -25,5 +25,4 @@ ) LOG = logging.getLogger('pyMoul') - - +getLogger = logging.getLogger Added: pymoul/trunk/src/moul/qt/tests/__init__.py =================================================================== --- pymoul/trunk/src/moul/qt/tests/__init__.py (rev 0) +++ pymoul/trunk/src/moul/qt/tests/__init__.py 2007-01-15 17:28:51 UTC (rev 26) @@ -0,0 +1,2 @@ +# testing package + Added: pymoul/trunk/src/moul/tests/__init__.py =================================================================== --- pymoul/trunk/src/moul/tests/__init__.py (rev 0) +++ pymoul/trunk/src/moul/tests/__init__.py 2007-01-15 17:28:51 UTC (rev 26) @@ -0,0 +1,2 @@ +# testing package + Added: pymoul/trunk/src/moul/tests/test_i18n.py =================================================================== --- pymoul/trunk/src/moul/tests/test_i18n.py (rev 0) +++ pymoul/trunk/src/moul/tests/test_i18n.py 2007-01-15 17:28:51 UTC (rev 26) @@ -0,0 +1,28 @@ +# 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 +# +import unittest +from doctest import DocTestSuite + +def test_suite(): + return unittest.TestSuite(( + DocTestSuite('moul.i18n'), + )) + +if __name__ == '__main__': + unittest.main(defaultTest="test_suite") + Modified: pymoul/trunk/src/moul/time/dni.py =================================================================== --- pymoul/trunk/src/moul/time/dni.py 2007-01-15 16:08:38 UTC (rev 25) +++ pymoul/trunk/src/moul/time/dni.py 2007-01-15 17:28:51 UTC (rev 26) @@ -29,7 +29,7 @@ ('tah-vo', 25), ('gor-ahn', 25), ('pro-rahn', 1), - ) +) VAILATEE = ( ('Leefo', ( 4, 21), ( 5, 27)), # 1: April 21st to May 27th @@ -42,7 +42,8 @@ ('Leevosahn', ( 1, 2), ( 2, 7)), # 8: January 2nd to February 7th ('Leevotar', ( 2, 7), ( 3, 15)), # 9: February 7th to March 15th ('Leenovoo', ( 3, 16), ( 4, 21)), # 10: March 16th to April 21st - ) +) + PRORAHN_PER_HAHR = reduce(mul, [float(factor) for name, factor in DNI_FACTORS[1:-1]]) Added: pymoul/trunk/src/moul/time/tests/__init__.py =================================================================== --- pymoul/trunk/src/moul/time/tests/__init__.py (rev 0) +++ pymoul/trunk/src/moul/time/tests/__init__.py 2007-01-15 17:28:51 UTC (rev 26) @@ -0,0 +1,2 @@ +# testing package + Property changes on: pymoul/trunk/test.py ___________________________________________________________________ Name: svn:executable + * This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ti...@us...> - 2007-01-15 19:05:54
|
Revision: 29 http://pymoul.svn.sourceforge.net/pymoul/?rev=29&view=rev Author: tiran Date: 2007-01-15 11:05:55 -0800 (Mon, 15 Jan 2007) Log Message: ----------- Minor tweaks for the setup system Modified Paths: -------------- pymoul/trunk/Makefile pymoul/trunk/setup.py Property Changed: ---------------- pymoul/trunk/Makefile Modified: pymoul/trunk/Makefile =================================================================== --- pymoul/trunk/Makefile 2007-01-15 19:01:38 UTC (rev 28) +++ pymoul/trunk/Makefile 2007-01-15 19:05:55 UTC (rev 29) @@ -1,5 +1,5 @@ -PYTHON?=python2.5 -TESTFLAGS=-p -v +PYTHON?=python +TESTFLAGS=-v TESTOPTS= SETUPFLAGS= @@ -18,10 +18,13 @@ bdist_egg: $(PYTHON) setup.py $(SETUPFLAGS) bdist_egg +run: + $(PYTHON) src/moul/qt/moulqt.py + test_build: build $(PYTHON) test.py $(TESTFLAGS) $(TESTOPTS) -test_inplace: inplace +test_inplace: $(PYTHON) test.py $(TESTFLAGS) $(TESTOPTS) ftest_build: build Property changes on: pymoul/trunk/Makefile ___________________________________________________________________ Name: svn:eol-style + native Modified: pymoul/trunk/setup.py =================================================================== --- pymoul/trunk/setup.py 2007-01-15 19:01:38 UTC (rev 28) +++ pymoul/trunk/setup.py 2007-01-15 19:05:55 UTC (rev 29) @@ -12,6 +12,7 @@ use_setuptools(version=SETUPTOOLS_VERSION) from setuptools import setup from setuptools import find_packages +from compileui import compileUi VERSION = "0.0" @@ -69,6 +70,7 @@ # Write Metadata and compile UI files writeMetadata() +compileUi() kwargs = {} kwargs.update(setup_infos) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
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. |
From: <ti...@us...> - 2007-01-16 00:03:34
|
Revision: 31 http://pymoul.svn.sourceforge.net/pymoul/?rev=31&view=rev Author: tiran Date: 2007-01-15 16:03:34 -0800 (Mon, 15 Jan 2007) Log Message: ----------- Some UI work to test integration of cavern time into the QT ui Modified Paths: -------------- pymoul/trunk/setup_win32.py pymoul/trunk/src/moul/qt/mainwindow.py pymoul/trunk/src/moul/qt/ui/mainwindow.py pymoul/trunk/src/moul/qt/ui/mainwindow.ui pymoul/trunk/src/moul/qt/ui/moulqt_rc.py pymoul/trunk/src/moul/time/cavern.py Modified: pymoul/trunk/setup_win32.py =================================================================== --- pymoul/trunk/setup_win32.py 2007-01-15 19:55:56 UTC (rev 30) +++ pymoul/trunk/setup_win32.py 2007-01-16 00:03:34 UTC (rev 31) @@ -31,13 +31,19 @@ # 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] + packages = ['pytz.zoneinfo'] + for tz in ('GMT', 'UTC'): + packages.append('pytz.zoneinfo.%s' % tz) + for tz in ('America', 'Canada', 'Etc', 'Europe', 'US'): + packages.append('pytz.zoneinfo.%s.*' % tz) return packages +# 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 = [] @@ -79,7 +85,7 @@ pexe['optimize'] = 0 # 0,1,2 pexe['includes'] = ['sip', 'PyQt4', 'encodings', 'encodings.*'] # not required at the moment - #pexe['includes'].extend(findPyTz()) + pexe['includes'].extend(findPyTz()) kw['zipfile'] = 'library.zip' def updateSetupOptionsQT(kw): Modified: pymoul/trunk/src/moul/qt/mainwindow.py =================================================================== --- pymoul/trunk/src/moul/qt/mainwindow.py 2007-01-15 19:55:56 UTC (rev 30) +++ pymoul/trunk/src/moul/qt/mainwindow.py 2007-01-16 00:03:34 UTC (rev 31) @@ -4,9 +4,14 @@ from PyQt4 import QtGui from moul.qt.ui.mainwindow import Ui_MainWindow +from moul.time import cavern as caverntime class MainWindow(QtGui.QMainWindow, Ui_MainWindow): def __init__(self): QtGui.QMainWindow.__init__(self) # Set up the user interface from Designer. self.setupUi(self) + + # timezone + self.cb_timezone_chooser.addItems(caverntime.TIMEZONE_NAMES) + Modified: pymoul/trunk/src/moul/qt/ui/mainwindow.py =================================================================== --- pymoul/trunk/src/moul/qt/ui/mainwindow.py 2007-01-15 19:55:56 UTC (rev 30) +++ pymoul/trunk/src/moul/qt/ui/mainwindow.py 2007-01-16 00:03:34 UTC (rev 31) @@ -2,7 +2,7 @@ # Form implementation generated from reading ui file 'src\moul\qt\ui\mainwindow.ui' # -# Created: Mon Jan 15 19:26:00 2007 +# Created: Tue Jan 16 01:02:23 2007 # by: PyQt4 UI code generator 4.1.1 # # WARNING! All changes made in this file will be lost! @@ -58,6 +58,12 @@ self.pushButton.setObjectName("pushButton") self.hboxlayout.addWidget(self.pushButton) + self.buttonbox_rresavcl = QtGui.QDialogButtonBox(self.centralwidget) + self.buttonbox_rresavcl.setGeometry(QtCore.QRect(10,480,441,32)) + self.buttonbox_rresavcl.setOrientation(QtCore.Qt.Horizontal) + self.buttonbox_rresavcl.setStandardButtons(QtGui.QDialogButtonBox.Close|QtGui.QDialogButtonBox.NoButton|QtGui.QDialogButtonBox.Reset|QtGui.QDialogButtonBox.Save) + self.buttonbox_rresavcl.setObjectName("buttonbox_rresavcl") + self.label = QtGui.QLabel(self.centralwidget) self.label.setGeometry(QtCore.QRect(15,10,430,58)) self.label.setFrameShape(QtGui.QFrame.StyledPanel) @@ -65,12 +71,6 @@ self.label.setPixmap(QtGui.QPixmap(":/resources/moul_logo.png")) self.label.setObjectName("label") - self.buttonbox_rresavcl = QtGui.QDialogButtonBox(self.centralwidget) - self.buttonbox_rresavcl.setGeometry(QtCore.QRect(10,480,441,32)) - self.buttonbox_rresavcl.setOrientation(QtCore.Qt.Horizontal) - self.buttonbox_rresavcl.setStandardButtons(QtGui.QDialogButtonBox.Close|QtGui.QDialogButtonBox.NoButton|QtGui.QDialogButtonBox.Reset|QtGui.QDialogButtonBox.Save) - self.buttonbox_rresavcl.setObjectName("buttonbox_rresavcl") - self.tabWidget = QtGui.QTabWidget(self.centralwidget) self.tabWidget.setGeometry(QtCore.QRect(5,100,450,375)) self.tabWidget.setTabPosition(QtGui.QTabWidget.North) @@ -153,7 +153,7 @@ self.vboxlayout1.addLayout(self.hboxlayout1) self.verticalLayout_6 = QtGui.QWidget(self.groupBox_2) - self.verticalLayout_6.setGeometry(QtCore.QRect(220,130,179,73)) + self.verticalLayout_6.setGeometry(QtCore.QRect(230,140,179,73)) self.verticalLayout_6.setObjectName("verticalLayout_6") self.vboxlayout2 = QtGui.QVBoxLayout(self.verticalLayout_6) @@ -287,6 +287,70 @@ self.tab_audio.setObjectName("tab_audio") self.tabWidget.addTab(self.tab_audio,"") + self.tab_time = QtGui.QWidget() + self.tab_time.setObjectName("tab_time") + + self.gb_caverntime = QtGui.QGroupBox(self.tab_time) + self.gb_caverntime.setGeometry(QtCore.QRect(10,100,421,121)) + self.gb_caverntime.setObjectName("gb_caverntime") + + self.horizontalLayout_2 = QtGui.QWidget(self.gb_caverntime) + self.horizontalLayout_2.setGeometry(QtCore.QRect(20,20,261,31)) + self.horizontalLayout_2.setObjectName("horizontalLayout_2") + + self.hboxlayout5 = QtGui.QHBoxLayout(self.horizontalLayout_2) + self.hboxlayout5.setMargin(0) + self.hboxlayout5.setSpacing(6) + self.hboxlayout5.setObjectName("hboxlayout5") + + self.label_4 = QtGui.QLabel(self.horizontalLayout_2) + self.label_4.setObjectName("label_4") + self.hboxlayout5.addWidget(self.label_4) + + self.dt_cavern = QtGui.QDateTimeEdit(self.horizontalLayout_2) + self.dt_cavern.setReadOnly(True) + self.dt_cavern.setObjectName("dt_cavern") + self.hboxlayout5.addWidget(self.dt_cavern) + + self.label_3 = QtGui.QLabel(self.horizontalLayout_2) + self.label_3.setObjectName("label_3") + self.hboxlayout5.addWidget(self.label_3) + + self.horizontalLayout_3 = QtGui.QWidget(self.gb_caverntime) + self.horizontalLayout_3.setGeometry(QtCore.QRect(20,70,261,31)) + self.horizontalLayout_3.setObjectName("horizontalLayout_3") + + self.hboxlayout6 = QtGui.QHBoxLayout(self.horizontalLayout_3) + self.hboxlayout6.setMargin(0) + self.hboxlayout6.setSpacing(6) + self.hboxlayout6.setObjectName("hboxlayout6") + + self.label_5 = QtGui.QLabel(self.horizontalLayout_3) + self.label_5.setObjectName("label_5") + self.hboxlayout6.addWidget(self.label_5) + + self.dt_local = QtGui.QDateTimeEdit(self.horizontalLayout_3) + self.dt_local.setReadOnly(True) + self.dt_local.setObjectName("dt_local") + self.hboxlayout6.addWidget(self.dt_local) + + self.label_11 = QtGui.QLabel(self.horizontalLayout_3) + self.label_11.setObjectName("label_11") + self.hboxlayout6.addWidget(self.label_11) + + self.gb_dnitime = QtGui.QGroupBox(self.tab_time) + self.gb_dnitime.setGeometry(QtCore.QRect(10,230,421,111)) + self.gb_dnitime.setObjectName("gb_dnitime") + + self.gb_timezone = QtGui.QGroupBox(self.tab_time) + self.gb_timezone.setGeometry(QtCore.QRect(10,10,421,81)) + self.gb_timezone.setObjectName("gb_timezone") + + self.cb_timezone_chooser = QtGui.QComboBox(self.gb_timezone) + self.cb_timezone_chooser.setGeometry(QtCore.QRect(10,30,271,21)) + self.cb_timezone_chooser.setObjectName("cb_timezone_chooser") + self.tabWidget.addTab(self.tab_time,"") + self.tab_4 = QtGui.QWidget() self.tab_4.setObjectName("tab_4") @@ -302,7 +366,7 @@ MainWindow.setStatusBar(self.statusbar) self.retranslateUi(MainWindow) - self.tabWidget.setCurrentIndex(0) + self.tabWidget.setCurrentIndex(2) QtCore.QObject.connect(self.buttonbox_rresavcl,QtCore.SIGNAL("rejected()"),MainWindow.close) QtCore.QMetaObject.connectSlotsByName(MainWindow) @@ -328,6 +392,14 @@ self.label_7.setText(QtGui.QApplication.translate("MainWindow", "Ultra", None, QtGui.QApplication.UnicodeUTF8)) self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_graphics), QtGui.QApplication.translate("MainWindow", "Graphis", None, QtGui.QApplication.UnicodeUTF8)) self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_audio), QtGui.QApplication.translate("MainWindow", "Audio", None, QtGui.QApplication.UnicodeUTF8)) + self.gb_caverntime.setTitle(QtGui.QApplication.translate("MainWindow", "Cavern Time", None, QtGui.QApplication.UnicodeUTF8)) + self.label_4.setText(QtGui.QApplication.translate("MainWindow", "Cavern time:", None, QtGui.QApplication.UnicodeUTF8)) + self.label_3.setText(QtGui.QApplication.translate("MainWindow", "UTC", None, QtGui.QApplication.UnicodeUTF8)) + self.label_5.setText(QtGui.QApplication.translate("MainWindow", "Local time:", None, QtGui.QApplication.UnicodeUTF8)) + self.label_11.setText(QtGui.QApplication.translate("MainWindow", "UTC", None, QtGui.QApplication.UnicodeUTF8)) + self.gb_dnitime.setTitle(QtGui.QApplication.translate("MainWindow", "D\'ni time", None, QtGui.QApplication.UnicodeUTF8)) + self.gb_timezone.setTitle(QtGui.QApplication.translate("MainWindow", "Time Zone", None, QtGui.QApplication.UnicodeUTF8)) + self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_time), QtGui.QApplication.translate("MainWindow", "Time", None, QtGui.QApplication.UnicodeUTF8)) self.label_6.setText(QtGui.QApplication.translate("MainWindow", "pyMoul tools", None, QtGui.QApplication.UnicodeUTF8)) self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_4), QtGui.QApplication.translate("MainWindow", "About", None, QtGui.QApplication.UnicodeUTF8)) Modified: pymoul/trunk/src/moul/qt/ui/mainwindow.ui =================================================================== --- pymoul/trunk/src/moul/qt/ui/mainwindow.ui 2007-01-15 19:55:56 UTC (rev 30) +++ pymoul/trunk/src/moul/qt/ui/mainwindow.ui 2007-01-16 00:03:34 UTC (rev 31) @@ -78,6 +78,22 @@ </item> </layout> </widget> + <widget class="QDialogButtonBox" name="buttonbox_rresavcl" > + <property name="geometry" > + <rect> + <x>10</x> + <y>480</y> + <width>441</width> + <height>32</height> + </rect> + </property> + <property name="orientation" > + <enum>Qt::Horizontal</enum> + </property> + <property name="standardButtons" > + <set>QDialogButtonBox::Close|QDialogButtonBox::NoButton|QDialogButtonBox::Reset|QDialogButtonBox::Save</set> + </property> + </widget> <widget class="QLabel" name="label" > <property name="geometry" > <rect> @@ -100,22 +116,6 @@ <pixmap resource="moulqt.qrc" >:/resources/moul_logo.png</pixmap> </property> </widget> - <widget class="QDialogButtonBox" name="buttonbox_rresavcl" > - <property name="geometry" > - <rect> - <x>10</x> - <y>480</y> - <width>441</width> - <height>32</height> - </rect> - </property> - <property name="orientation" > - <enum>Qt::Horizontal</enum> - </property> - <property name="standardButtons" > - <set>QDialogButtonBox::Close|QDialogButtonBox::NoButton|QDialogButtonBox::Reset|QDialogButtonBox::Save</set> - </property> - </widget> <widget class="QTabWidget" name="tabWidget" > <property name="geometry" > <rect> @@ -129,7 +129,7 @@ <enum>QTabWidget::North</enum> </property> <property name="currentIndex" > - <number>0</number> + <number>2</number> </property> <widget class="QWidget" name="tab_graphics" > <attribute name="title" > @@ -296,8 +296,8 @@ <widget class="QWidget" name="verticalLayout_6" > <property name="geometry" > <rect> - <x>220</x> - <y>130</y> + <x>230</x> + <y>140</y> <width>179</width> <height>73</height> </rect> @@ -560,6 +560,138 @@ <string>Audio</string> </attribute> </widget> + <widget class="QWidget" name="tab_time" > + <attribute name="title" > + <string>Time</string> + </attribute> + <widget class="QGroupBox" name="gb_caverntime" > + <property name="geometry" > + <rect> + <x>10</x> + <y>100</y> + <width>421</width> + <height>121</height> + </rect> + </property> + <property name="title" > + <string>Cavern Time</string> + </property> + <widget class="QWidget" name="horizontalLayout_2" > + <property name="geometry" > + <rect> + <x>20</x> + <y>20</y> + <width>261</width> + <height>31</height> + </rect> + </property> + <layout class="QHBoxLayout" > + <property name="margin" > + <number>0</number> + </property> + <property name="spacing" > + <number>6</number> + </property> + <item> + <widget class="QLabel" name="label_4" > + <property name="text" > + <string>Cavern time:</string> + </property> + </widget> + </item> + <item> + <widget class="QDateTimeEdit" name="dt_cavern" > + <property name="readOnly" > + <bool>true</bool> + </property> + </widget> + </item> + <item> + <widget class="QLabel" name="label_3" > + <property name="text" > + <string>UTC</string> + </property> + </widget> + </item> + </layout> + </widget> + <widget class="QWidget" name="horizontalLayout_3" > + <property name="geometry" > + <rect> + <x>20</x> + <y>70</y> + <width>261</width> + <height>31</height> + </rect> + </property> + <layout class="QHBoxLayout" > + <property name="margin" > + <number>0</number> + </property> + <property name="spacing" > + <number>6</number> + </property> + <item> + <widget class="QLabel" name="label_5" > + <property name="text" > + <string>Local time:</string> + </property> + </widget> + </item> + <item> + <widget class="QDateTimeEdit" name="dt_local" > + <property name="readOnly" > + <bool>true</bool> + </property> + </widget> + </item> + <item> + <widget class="QLabel" name="label_11" > + <property name="text" > + <string>UTC</string> + </property> + </widget> + </item> + </layout> + </widget> + </widget> + <widget class="QGroupBox" name="gb_dnitime" > + <property name="geometry" > + <rect> + <x>10</x> + <y>230</y> + <width>421</width> + <height>111</height> + </rect> + </property> + <property name="title" > + <string>D'ni time</string> + </property> + </widget> + <widget class="QGroupBox" name="gb_timezone" > + <property name="geometry" > + <rect> + <x>10</x> + <y>10</y> + <width>421</width> + <height>81</height> + </rect> + </property> + <property name="title" > + <string>Time Zone</string> + </property> + <widget class="QComboBox" name="cb_timezone_chooser" > + <property name="geometry" > + <rect> + <x>10</x> + <y>30</y> + <width>271</width> + <height>21</height> + </rect> + </property> + </widget> + </widget> + </widget> <widget class="QWidget" name="tab_4" > <attribute name="title" > <string>About</string> Modified: pymoul/trunk/src/moul/qt/ui/moulqt_rc.py =================================================================== --- pymoul/trunk/src/moul/qt/ui/moulqt_rc.py 2007-01-15 19:55:56 UTC (rev 30) +++ pymoul/trunk/src/moul/qt/ui/moulqt_rc.py 2007-01-16 00:03:34 UTC (rev 31) @@ -2,7 +2,7 @@ # Resource object code # -# Created: Mo 15. Jan 19:26:00 2007 +# Created: Di 16. Jan 01:02:23 2007 # by: The Resource Compiler for PyQt (Qt v4.2.2) # # WARNING! All changes made in this file will be lost! Modified: pymoul/trunk/src/moul/time/cavern.py =================================================================== --- pymoul/trunk/src/moul/time/cavern.py 2007-01-15 19:55:56 UTC (rev 30) +++ pymoul/trunk/src/moul/time/cavern.py 2007-01-16 00:03:34 UTC (rev 31) @@ -22,12 +22,35 @@ from datetime import datetime from datetime import timedelta -from pytz import common_timezones +#from pytz import common_timezones +from pytz import all_timezones from pytz import timezone from pytz import utc as UTC -TIMEZONE_NAMES = common_timezones +SUPPORTED_TZ = ('America', 'Canada', 'Etc', 'Europe', 'US') +ADDITIONAL_TZ = ('GMT', 'UTC') +def _listSupported(tz_list): + supported = [] + unsupported = [] + for tz in tz_list: + if tz.find('/') == -1: + if tz in ADDITIONAL_TZ: + supported.append(tz) + else: + unsupported.append(tz) + continue + prefix, postfix = tz.split('/')[:2] + if prefix in SUPPORTED_TZ: + supported.append(tz) + else: + unsupported.append(tz) + supported.sort() + unsupported.sort() + return supported, unsupported + +TIMEZONE_NAMES, UNSUPPORTED = _listSupported(all_timezones) + # Cyan HQ is near Spokane / Washington # Cavern time is Mountain Time Zone (MDT) with daylight savings (MST) CAVERN_TZ_NAME = 'US/Mountain' # MDT / MST This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ti...@us...> - 2007-01-16 11:16:49
|
Revision: 33 http://pymoul.svn.sourceforge.net/pymoul/?rev=33&view=rev Author: tiran Date: 2007-01-16 03:16:50 -0800 (Tue, 16 Jan 2007) Log Message: ----------- * Changed compileui.py. It doesn't recompile the files if the orig files are older than the source files * Ignore eric4 files Modified Paths: -------------- pymoul/trunk/compileui.py Property Changed: ---------------- pymoul/trunk/ Property changes on: pymoul/trunk ___________________________________________________________________ Name: svn:ignore - build dist + build dist *.e4? Modified: pymoul/trunk/compileui.py =================================================================== --- pymoul/trunk/compileui.py 2007-01-16 11:13:44 UTC (rev 32) +++ pymoul/trunk/compileui.py 2007-01-16 11:16:50 UTC (rev 33) @@ -3,6 +3,7 @@ """ import os import re +from stat import ST_MTIME from PyQt4 import uic @@ -16,6 +17,9 @@ QRC_COMPILER = "pyrcc4 -o %(py)s %(qrc)s" UI_MODULE = "moul.qt.ui" +def _newer(orig, py): + return os.stat(orig)[ST_MTIME] > os.stat(py)[ST_MTIME] + def previewUi(uifname): """Copied from PyQt.uic.pyuic """ @@ -46,6 +50,8 @@ py_name = ui_name.lower()[:-len(UI_EXT)]+PY_EXT ui_path = os.path.join(root, ui_name) py_path = os.path.join(root, py_name) + if not _newer(ui_path, py_path): + continue ui = open(ui_path, 'r') py = open(py_path, 'w') err = uic.compileUi(ui, py, execute) @@ -63,7 +69,6 @@ lines = [] fin = open(fname, 'r') for line in fin: - if line.startswith('import'): # faster than re match = RE_RC.match(line) @@ -82,6 +87,8 @@ kw = {} kw['qrc'] = os.path.join(root, qrc_name) kw['py'] = os.path.join(root, py_name) + if not _newer(kw['qrc'], kw['py']): + continue err = os.system(QRC_COMPILER % kw) if err != 0: raise RuntimeError("pyrcc error") This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ti...@us...> - 2007-01-16 13:09:31
|
Revision: 35 http://pymoul.svn.sourceforge.net/pymoul/?rev=35&view=rev Author: tiran Date: 2007-01-16 05:09:30 -0800 (Tue, 16 Jan 2007) Log Message: ----------- Added author info Added svn:keywords Fixed and updated eol-styles Modified Paths: -------------- pymoul/trunk/compileui.py pymoul/trunk/setup.py pymoul/trunk/setup_win32.py pymoul/trunk/src/moul/cli/moullauncher.py pymoul/trunk/src/moul/config/darwin.py pymoul/trunk/src/moul/config/generic.py pymoul/trunk/src/moul/config/linux2.py pymoul/trunk/src/moul/config/win32.py pymoul/trunk/src/moul/crypt/elf.py pymoul/trunk/src/moul/crypt/tests/test_elf.py pymoul/trunk/src/moul/crypt/tests/test_wdys.py pymoul/trunk/src/moul/crypt/whatdoyousee.py pymoul/trunk/src/moul/file/chatlog.py pymoul/trunk/src/moul/file/kiimage.py pymoul/trunk/src/moul/file/localization.py pymoul/trunk/src/moul/file/plasmalog.py pymoul/trunk/src/moul/file/wdysini.py pymoul/trunk/src/moul/i18n.py pymoul/trunk/src/moul/log.py pymoul/trunk/src/moul/qt/mainwindow.py pymoul/trunk/src/moul/qt/moulqt.py pymoul/trunk/src/moul/qt/ui/mainwindow.py pymoul/trunk/src/moul/tests/test_i18n.py pymoul/trunk/src/moul/time/cavern.py pymoul/trunk/src/moul/time/dni.py pymoul/trunk/src/moul/time/tests/__init__.py pymoul/trunk/src/moul/time/tests/test_cavern.py Property Changed: ---------------- pymoul/trunk/compileui.py pymoul/trunk/ez_setup.py pymoul/trunk/misc/build_exe.py pymoul/trunk/setup.py pymoul/trunk/setup_win32.py pymoul/trunk/src/moul/__init__.py pymoul/trunk/src/moul/cli/__init__.py pymoul/trunk/src/moul/cli/moullauncher.py pymoul/trunk/src/moul/cli/tests/__init__.py pymoul/trunk/src/moul/config/__init__.py pymoul/trunk/src/moul/config/darwin.py pymoul/trunk/src/moul/config/generic.py pymoul/trunk/src/moul/config/linux2.py pymoul/trunk/src/moul/config/miniwinshell.py pymoul/trunk/src/moul/config/tests/__init__.py pymoul/trunk/src/moul/config/win32.py pymoul/trunk/src/moul/crypt/__init__.py pymoul/trunk/src/moul/crypt/elf.py pymoul/trunk/src/moul/crypt/tests/__init__.py pymoul/trunk/src/moul/crypt/tests/test_elf.py pymoul/trunk/src/moul/crypt/tests/test_wdys.py pymoul/trunk/src/moul/crypt/whatdoyousee.py pymoul/trunk/src/moul/crypt/xtea.py pymoul/trunk/src/moul/file/__init__.py pymoul/trunk/src/moul/file/chatlog.py pymoul/trunk/src/moul/file/kiimage.py pymoul/trunk/src/moul/file/localization.py pymoul/trunk/src/moul/file/plasmalog.py pymoul/trunk/src/moul/file/tests/__init__.py pymoul/trunk/src/moul/file/wdysini.py pymoul/trunk/src/moul/i18n.py pymoul/trunk/src/moul/log.py pymoul/trunk/src/moul/metadata.py pymoul/trunk/src/moul/qt/__init__.py pymoul/trunk/src/moul/qt/mainwindow.py pymoul/trunk/src/moul/qt/moulqt.py pymoul/trunk/src/moul/qt/tests/__init__.py pymoul/trunk/src/moul/qt/ui/__init__.py pymoul/trunk/src/moul/qt/ui/mainwindow.py pymoul/trunk/src/moul/qt/ui/moulqt_rc.py pymoul/trunk/src/moul/tests/__init__.py pymoul/trunk/src/moul/tests/test_i18n.py pymoul/trunk/src/moul/time/__init__.py pymoul/trunk/src/moul/time/cavern.py pymoul/trunk/src/moul/time/dni.py pymoul/trunk/src/moul/time/tests/__init__.py pymoul/trunk/src/moul/time/tests/test_cavern.py pymoul/trunk/test.py Modified: pymoul/trunk/compileui.py =================================================================== --- pymoul/trunk/compileui.py 2007-01-16 12:40:27 UTC (rev 34) +++ pymoul/trunk/compileui.py 2007-01-16 13:09:30 UTC (rev 35) @@ -1,6 +1,10 @@ #!/usr/bin/env python2.5 """Compile QtDesigner's UI and QRC files to Python files """ +__author__ = "Christian Heimes" +__version__ = "$Id$" +__revision__ = "$Revision$" + import os import re from stat import ST_MTIME Property changes on: pymoul/trunk/compileui.py ___________________________________________________________________ Name: svn:keywords + Id Revision Property changes on: pymoul/trunk/ez_setup.py ___________________________________________________________________ Name: svn:keywords + Id Revision Property changes on: pymoul/trunk/misc/build_exe.py ___________________________________________________________________ Name: svn:keywords + Id Revision Modified: pymoul/trunk/setup.py =================================================================== --- pymoul/trunk/setup.py 2007-01-16 12:40:27 UTC (rev 34) +++ pymoul/trunk/setup.py 2007-01-16 13:09:30 UTC (rev 35) @@ -3,6 +3,10 @@ TODO: Long description of pyMoul """ +__author__ = "Christian Heimes" +__version__ = "$Id$" +__revision__ = "$Revision$" + import sys import os import time Property changes on: pymoul/trunk/setup.py ___________________________________________________________________ Name: svn:keywords + Id Revision Modified: pymoul/trunk/setup_win32.py =================================================================== --- pymoul/trunk/setup_win32.py 2007-01-16 12:40:27 UTC (rev 34) +++ pymoul/trunk/setup_win32.py 2007-01-16 13:09:30 UTC (rev 35) @@ -1,5 +1,9 @@ """Win23 helpers for setup.py """ +__author__ = "Christian Heimes" +__version__ = "$Id$" +__revision__ = "$Revision$" + import os import sys from setuptools import find_packages Property changes on: pymoul/trunk/setup_win32.py ___________________________________________________________________ Name: svn:keywords + Id Revision Property changes on: pymoul/trunk/src/moul/__init__.py ___________________________________________________________________ Name: svn:keywords + Id Revision Property changes on: pymoul/trunk/src/moul/cli/__init__.py ___________________________________________________________________ Name: svn:keywords + Id Revision Modified: pymoul/trunk/src/moul/cli/moullauncher.py =================================================================== --- pymoul/trunk/src/moul/cli/moullauncher.py 2007-01-16 12:40:27 UTC (rev 34) +++ pymoul/trunk/src/moul/cli/moullauncher.py 2007-01-16 13:09:30 UTC (rev 35) @@ -18,6 +18,10 @@ # """MOUL launcher """ +__author__ = "Christian Heimes" +__version__ = "$Id$" +__revision__ = "$Revision$" + import os import sys from optparse import OptionParser Property changes on: pymoul/trunk/src/moul/cli/moullauncher.py ___________________________________________________________________ Name: svn:keywords + Id Revision Property changes on: pymoul/trunk/src/moul/cli/tests/__init__.py ___________________________________________________________________ Name: svn:keywords + Id Revision Name: svn:eol-style + native Property changes on: pymoul/trunk/src/moul/config/__init__.py ___________________________________________________________________ Name: svn:keywords + Id Revision Modified: pymoul/trunk/src/moul/config/darwin.py =================================================================== --- pymoul/trunk/src/moul/config/darwin.py 2007-01-16 12:40:27 UTC (rev 34) +++ pymoul/trunk/src/moul/config/darwin.py 2007-01-16 13:09:30 UTC (rev 35) @@ -19,6 +19,10 @@ XXX: untested! """ +__author__ = "Christian Heimes" +__version__ = "$Id$" +__revision__ = "$Revision$" + import os from moul.log import LOG LOG.warning('Darwin/Mac support is not tested') Property changes on: pymoul/trunk/src/moul/config/darwin.py ___________________________________________________________________ Name: svn:keywords + Id Revision Name: svn:eol-style + native Modified: pymoul/trunk/src/moul/config/generic.py =================================================================== --- pymoul/trunk/src/moul/config/generic.py 2007-01-16 12:40:27 UTC (rev 34) +++ pymoul/trunk/src/moul/config/generic.py 2007-01-16 13:09:30 UTC (rev 35) @@ -17,6 +17,10 @@ # """cross platform configuration tools for pyMoul """ +__author__ = "Christian Heimes" +__version__ = "$Id$" +__revision__ = "$Revision$" + # Stub for platform specific functions def getMoulUserDataDir(): """Get path of MOUL user data directory Property changes on: pymoul/trunk/src/moul/config/generic.py ___________________________________________________________________ Name: svn:keywords + Id Revision Modified: pymoul/trunk/src/moul/config/linux2.py =================================================================== --- pymoul/trunk/src/moul/config/linux2.py 2007-01-16 12:40:27 UTC (rev 34) +++ pymoul/trunk/src/moul/config/linux2.py 2007-01-16 13:09:30 UTC (rev 35) @@ -19,6 +19,10 @@ XXX: untested! """ +__author__ = "Christian Heimes" +__version__ = "$Id$" +__revision__ = "$Revision$" + import os from moul.log import LOG LOG.warning('Linux support is not tested') Property changes on: pymoul/trunk/src/moul/config/linux2.py ___________________________________________________________________ Name: svn:keywords + Id Revision Name: svn:eol-style + native Property changes on: pymoul/trunk/src/moul/config/miniwinshell.py ___________________________________________________________________ Name: svn:keywords + Id Revision Property changes on: pymoul/trunk/src/moul/config/tests/__init__.py ___________________________________________________________________ Name: svn:keywords + Id Revision Name: svn:eol-style + native Modified: pymoul/trunk/src/moul/config/win32.py =================================================================== --- pymoul/trunk/src/moul/config/win32.py 2007-01-16 12:40:27 UTC (rev 34) +++ pymoul/trunk/src/moul/config/win32.py 2007-01-16 13:09:30 UTC (rev 35) @@ -17,6 +17,10 @@ # """Win32 configuration for pyMoul """ +__author__ = "Christian Heimes" +__version__ = "$Id$" +__revision__ = "$Revision$" + import os from miniwinshell import my_documents from miniwinshell import application_data Property changes on: pymoul/trunk/src/moul/config/win32.py ___________________________________________________________________ Name: svn:keywords + Id Revision Property changes on: pymoul/trunk/src/moul/crypt/__init__.py ___________________________________________________________________ Name: svn:keywords + Id Revision Modified: pymoul/trunk/src/moul/crypt/elf.py =================================================================== --- pymoul/trunk/src/moul/crypt/elf.py 2007-01-16 12:40:27 UTC (rev 34) +++ pymoul/trunk/src/moul/crypt/elf.py 2007-01-16 13:09:30 UTC (rev 35) @@ -19,6 +19,10 @@ Based on the C++ code from Marack """ +__author__ = "Christian Heimes" +__version__ = "$Id$" +__revision__ = "$Revision$" + import struct def list2int(lst): Property changes on: pymoul/trunk/src/moul/crypt/elf.py ___________________________________________________________________ Name: svn:keywords + Id Revision Property changes on: pymoul/trunk/src/moul/crypt/tests/__init__.py ___________________________________________________________________ Name: svn:keywords + Id Revision Name: svn:eol-style + native Modified: pymoul/trunk/src/moul/crypt/tests/test_elf.py =================================================================== --- pymoul/trunk/src/moul/crypt/tests/test_elf.py 2007-01-16 12:40:27 UTC (rev 34) +++ pymoul/trunk/src/moul/crypt/tests/test_elf.py 2007-01-16 13:09:30 UTC (rev 35) @@ -14,33 +14,37 @@ # 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.elf unit tests -""" -import os +# +"""moul.crypt.elf unit tests +""" +__author__ = "Christian Heimes" +__version__ = "$Id$" +__revision__ = "$Revision$" + +import os import unittest from doctest import DocTestSuite - -import moul.file -from moul.crypt.elf import decryptElf - -base = os.path.dirname(moul.file.__file__) -elf_enc = os.path.join(base, 'tests', 'audiocaps.0.elf') -elf_dec = os.path.join(base, 'tests', 'audiocaps.0.txt') - -class ElfTest(unittest.TestCase): - def setUp(self): - self.enc = open(elf_enc, 'rb') - self.dec = open(elf_dec, 'r') - - def tearDown(self): - self.enc.close() - self.dec.close() - - def test_compare(self): - data = '\n'.join(decryptElf(self.enc)) - self.failUnlessEqual(data, self.dec.read()) - + +import moul.file +from moul.crypt.elf import decryptElf + +base = os.path.dirname(moul.file.__file__) +elf_enc = os.path.join(base, 'tests', 'audiocaps.0.elf') +elf_dec = os.path.join(base, 'tests', 'audiocaps.0.txt') + +class ElfTest(unittest.TestCase): + def setUp(self): + self.enc = open(elf_enc, 'rb') + self.dec = open(elf_dec, 'r') + + def tearDown(self): + self.enc.close() + self.dec.close() + + def test_compare(self): + data = '\n'.join(decryptElf(self.enc)) + self.failUnlessEqual(data, self.dec.read()) + def test_suite(): return unittest.TestSuite(( unittest.makeSuite(ElfTest), @@ -48,5 +52,5 @@ if __name__ == '__main__': unittest.main(defaultTest="test_suite") - - + + Property changes on: pymoul/trunk/src/moul/crypt/tests/test_elf.py ___________________________________________________________________ Name: svn:keywords + Id Revision Name: svn:eol-style + native Modified: pymoul/trunk/src/moul/crypt/tests/test_wdys.py =================================================================== --- pymoul/trunk/src/moul/crypt/tests/test_wdys.py 2007-01-16 12:40:27 UTC (rev 34) +++ pymoul/trunk/src/moul/crypt/tests/test_wdys.py 2007-01-16 13:09:30 UTC (rev 35) @@ -17,6 +17,10 @@ # """moul.crypt.whatdoyousee unit tests """ +__author__ = "Christian Heimes" +__version__ = "$Id$" +__revision__ = "$Revision$" + import os import unittest from doctest import DocTestSuite Property changes on: pymoul/trunk/src/moul/crypt/tests/test_wdys.py ___________________________________________________________________ Name: svn:keywords + Id Revision Modified: pymoul/trunk/src/moul/crypt/whatdoyousee.py =================================================================== --- pymoul/trunk/src/moul/crypt/whatdoyousee.py 2007-01-16 12:40:27 UTC (rev 34) +++ pymoul/trunk/src/moul/crypt/whatdoyousee.py 2007-01-16 13:09:30 UTC (rev 35) @@ -24,6 +24,10 @@ Thanks to Anonymous54321 on the Clockwork Orange BBS forum for the xTEA keys. """ +__author__ = "Christian Heimes" +__version__ = "$Id$" +__revision__ = "$Revision$" + import struct from moul.crypt.xtea import xtea_decrypt Property changes on: pymoul/trunk/src/moul/crypt/whatdoyousee.py ___________________________________________________________________ Name: svn:keywords + Id Revision Property changes on: pymoul/trunk/src/moul/crypt/xtea.py ___________________________________________________________________ Name: svn:keywords + Id Revision Property changes on: pymoul/trunk/src/moul/file/__init__.py ___________________________________________________________________ Name: svn:keywords + Id Revision Modified: pymoul/trunk/src/moul/file/chatlog.py =================================================================== --- pymoul/trunk/src/moul/file/chatlog.py 2007-01-16 12:40:27 UTC (rev 34) +++ pymoul/trunk/src/moul/file/chatlog.py 2007-01-16 13:09:30 UTC (rev 35) @@ -17,6 +17,10 @@ # """Chat log parser """ +__author__ = "Christian Heimes" +__version__ = "$Id$" +__revision__ = "$Revision$" + import re CHAT_RE_TXT = r"^\((?P<M>\d{1,2})/(?P<D>\d{1,2})\ " \ Property changes on: pymoul/trunk/src/moul/file/chatlog.py ___________________________________________________________________ Name: svn:keywords + Id Revision Modified: pymoul/trunk/src/moul/file/kiimage.py =================================================================== --- pymoul/trunk/src/moul/file/kiimage.py 2007-01-16 12:40:27 UTC (rev 34) +++ pymoul/trunk/src/moul/file/kiimage.py 2007-01-16 13:09:30 UTC (rev 35) @@ -17,6 +17,10 @@ # """KI image module """ +__author__ = "Christian Heimes" +__version__ = "$Id$" +__revision__ = "$Revision$" + import os import tempfile Property changes on: pymoul/trunk/src/moul/file/kiimage.py ___________________________________________________________________ Name: svn:keywords + Id Revision Modified: pymoul/trunk/src/moul/file/localization.py =================================================================== --- pymoul/trunk/src/moul/file/localization.py 2007-01-16 12:40:27 UTC (rev 34) +++ pymoul/trunk/src/moul/file/localization.py 2007-01-16 13:09:30 UTC (rev 35) @@ -19,6 +19,11 @@ """ from __future__ import with_statement +__author__ = "Christian Heimes" +__version__ = "$Id$" +__revision__ = "$Revision$" + + __all__ = ('translationRegistry', 'parseLocDirectory') import os Property changes on: pymoul/trunk/src/moul/file/localization.py ___________________________________________________________________ Name: svn:keywords + Id Revision Modified: pymoul/trunk/src/moul/file/plasmalog.py =================================================================== --- pymoul/trunk/src/moul/file/plasmalog.py 2007-01-16 12:40:27 UTC (rev 34) +++ pymoul/trunk/src/moul/file/plasmalog.py 2007-01-16 13:09:30 UTC (rev 35) @@ -1,108 +1,112 @@ -# 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 -# -"""Module to automagically zip MOUL's log files -""" -import os -from stat import ST_MTIME -import time -import zipfile -import re - -from moul.config import getMoulDir -from moul.config import getConfigOption -from moul.crypt.elf import decryptElf - -PLASMA_LOG = "plasmalog.txt" -_marker = object() -RE_SAFEEXT_TEXT = "\.(elf|txt|log|zip|jpg|jpeg)$" -RE_SAFEXT = re.compile(RE_SAFEEXT_TEXT, re.IGNORECASE) - -def getTimeStamp(path): - """Get time stamp yyyymmdd_hhmm based in the modification time - """ - sec = os.stat(path)[ST_MTIME] - return time.strftime("%Y%m%d_%H%M", time.gmtime(sec)) - -def isLogDir(path): - """Check if a path is a valid plasma log directory - - Just checks for the plasmalog.txt file - - Returns either False or a time stamp - """ - pl = os.path.join(path, PLASMA_LOG) - if not os.path.isfile(pl): - return False - return getTimeStamp(pl) - -def zipLogDir(logdir=None, destdir=None, remove=_marker): - """Zip all log files - - This function also zips subdirectories. - """ - if logdir is None: - logdir = getMoulDir('log') - if destdir is None: - destdir = getMoulDir('userdata') - if remove is _marker: - remove = getConfigOption('moul', 'removelogs', default=False) - - stored_dirs = [] - - for root, dirs, files in os.walk(logdir): - stamp = isLogDir(root) - if not stamp: - continue - name = os.path.basename(root) - zipname = "%s_%s.zip" % (name, stamp) - zipfd = zipfile.ZipFile(os.path.join(destdir, zipname), - 'w', zipfile.ZIP_DEFLATED) - for file in files: - if file.lower().startswith('chat.'): - # omit chatlogs from the logs - continue - fname = os.path.join(root, file) - arcname = os.path.join(name, file) - zipfd.write(fname, arcname) - #zipfd.printdir() - zipfd.close() - stored_dirs.append((root, zipname)) - - if remove: - removeLogs(logdir) - - return stored_dirs - -def removeLogs(logdir=None): - """Removes log directories - - The removeLogs function removes only files considered as safe - """ - if logdir is None: - logdir = getMoulDir('log') - - for root, dirs, files in os.walk(logdir, topdown=False): - for name in files: - if RE_SAFEXT.search(name): - os.remove(os.path.join(root, name)) - else: - print name # XXX - for name in dirs: - os.rmdir(os.path.join(root, name)) - - os.rmdir(logdir) +# 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 +# +"""Module to automagically zip MOUL's log files +""" +__author__ = "Christian Heimes" +__version__ = "$Id$" +__revision__ = "$Revision$" + +import os +from stat import ST_MTIME +import time +import zipfile +import re + +from moul.config import getMoulDir +from moul.config import getConfigOption +from moul.crypt.elf import decryptElf + +PLASMA_LOG = "plasmalog.txt" +_marker = object() +RE_SAFEEXT_TEXT = "\.(elf|txt|log|zip|jpg|jpeg)$" +RE_SAFEXT = re.compile(RE_SAFEEXT_TEXT, re.IGNORECASE) + +def getTimeStamp(path): + """Get time stamp yyyymmdd_hhmm based in the modification time + """ + sec = os.stat(path)[ST_MTIME] + return time.strftime("%Y%m%d_%H%M", time.gmtime(sec)) + +def isLogDir(path): + """Check if a path is a valid plasma log directory + + Just checks for the plasmalog.txt file + + Returns either False or a time stamp + """ + pl = os.path.join(path, PLASMA_LOG) + if not os.path.isfile(pl): + return False + return getTimeStamp(pl) + +def zipLogDir(logdir=None, destdir=None, remove=_marker): + """Zip all log files + + This function also zips subdirectories. + """ + if logdir is None: + logdir = getMoulDir('log') + if destdir is None: + destdir = getMoulDir('userdata') + if remove is _marker: + remove = getConfigOption('moul', 'removelogs', default=False) + + stored_dirs = [] + + for root, dirs, files in os.walk(logdir): + stamp = isLogDir(root) + if not stamp: + continue + name = os.path.basename(root) + zipname = "%s_%s.zip" % (name, stamp) + zipfd = zipfile.ZipFile(os.path.join(destdir, zipname), + 'w', zipfile.ZIP_DEFLATED) + for file in files: + if file.lower().startswith('chat.'): + # omit chatlogs from the logs + continue + fname = os.path.join(root, file) + arcname = os.path.join(name, file) + zipfd.write(fname, arcname) + #zipfd.printdir() + zipfd.close() + stored_dirs.append((root, zipname)) + + if remove: + removeLogs(logdir) + + return stored_dirs + +def removeLogs(logdir=None): + """Removes log directories + + The removeLogs function removes only files considered as safe + """ + if logdir is None: + logdir = getMoulDir('log') + + for root, dirs, files in os.walk(logdir, topdown=False): + for name in files: + if RE_SAFEXT.search(name): + os.remove(os.path.join(root, name)) + else: + print name # XXX + for name in dirs: + os.rmdir(os.path.join(root, name)) + + os.rmdir(logdir) Property changes on: pymoul/trunk/src/moul/file/plasmalog.py ___________________________________________________________________ Name: svn:keywords + Id Revision Property changes on: pymoul/trunk/src/moul/file/tests/__init__.py ___________________________________________________________________ Name: svn:keywords + Id Revision Name: svn:eol-style + native Modified: pymoul/trunk/src/moul/file/wdysini.py =================================================================== --- pymoul/trunk/src/moul/file/wdysini.py 2007-01-16 12:40:27 UTC (rev 34) +++ pymoul/trunk/src/moul/file/wdysini.py 2007-01-16 13:09:30 UTC (rev 35) @@ -17,6 +17,10 @@ # """Configuration file parser """ +__author__ = "Christian Heimes" +__version__ = "$Id$" +__revision__ = "$Revision$" + from moul.crypt.whatdoyousee import decryptWDYS from moul.crypt.whatdoyousee import encryptWDYS Property changes on: pymoul/trunk/src/moul/file/wdysini.py ___________________________________________________________________ Name: svn:keywords + Id Revision Modified: pymoul/trunk/src/moul/i18n.py =================================================================== --- pymoul/trunk/src/moul/i18n.py 2007-01-16 12:40:27 UTC (rev 34) +++ pymoul/trunk/src/moul/i18n.py 2007-01-16 13:09:30 UTC (rev 35) @@ -50,6 +50,10 @@ ... TypeError: default must be a unicode string """ +__author__ = "Christian Heimes" +__version__ = "$Id$" +__revision__ = "$Revision$" + from string import Template __all__ = ['_', 'PymoulMessageFactory', 'MessageFactory'] Property changes on: pymoul/trunk/src/moul/i18n.py ___________________________________________________________________ Name: svn:keywords + Id Revision Name: svn:eol-style + native Modified: pymoul/trunk/src/moul/log.py =================================================================== --- pymoul/trunk/src/moul/log.py 2007-01-16 12:40:27 UTC (rev 34) +++ pymoul/trunk/src/moul/log.py 2007-01-16 13:09:30 UTC (rev 35) @@ -17,6 +17,10 @@ # """pyMoul logger """ +__author__ = "Christian Heimes" +__version__ = "$Id$" +__revision__ = "$Revision$" + import logging logging.basicConfig(level=logging.DEBUG, Property changes on: pymoul/trunk/src/moul/log.py ___________________________________________________________________ Name: svn:keywords + Id Revision Property changes on: pymoul/trunk/src/moul/metadata.py ___________________________________________________________________ Name: svn:keywords + Id Revision Property changes on: pymoul/trunk/src/moul/qt/__init__.py ___________________________________________________________________ Name: svn:keywords + Id Revision Modified: pymoul/trunk/src/moul/qt/mainwindow.py =================================================================== --- pymoul/trunk/src/moul/qt/mainwindow.py 2007-01-16 12:40:27 UTC (rev 34) +++ pymoul/trunk/src/moul/qt/mainwindow.py 2007-01-16 13:09:30 UTC (rev 35) @@ -1,3 +1,26 @@ +# 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 windows +""" +__author__ = "Christian Heimes" +__version__ = "$Id$" +__revision__ = "$Revision$" + import sys from PyQt4 import QtGui Property changes on: pymoul/trunk/src/moul/qt/mainwindow.py ___________________________________________________________________ Name: svn:keywords + Id Revision Modified: pymoul/trunk/src/moul/qt/moulqt.py =================================================================== --- pymoul/trunk/src/moul/qt/moulqt.py 2007-01-16 12:40:27 UTC (rev 34) +++ pymoul/trunk/src/moul/qt/moulqt.py 2007-01-16 13:09:30 UTC (rev 35) @@ -18,6 +18,10 @@ # """Moul QT GUI main module """ +__author__ = "Christian Heimes" +__version__ = "$Id$" +__revision__ = "$Revision$" + import sys from PyQt4 import QtGui Property changes on: pymoul/trunk/src/moul/qt/moulqt.py ___________________________________________________________________ Name: svn:keywords + Id Revision Property changes on: pymoul/trunk/src/moul/qt/tests/__init__.py ___________________________________________________________________ Name: svn:keywords + Id Revision Name: svn:eol-style + native Property changes on: pymoul/trunk/src/moul/qt/ui/__init__.py ___________________________________________________________________ Name: svn:keywords + Id Revision Modified: pymoul/trunk/src/moul/qt/ui/mainwindow.py =================================================================== --- pymoul/trunk/src/moul/qt/ui/mainwindow.py 2007-01-16 12:40:27 UTC (rev 34) +++ pymoul/trunk/src/moul/qt/ui/mainwindow.py 2007-01-16 13:09:30 UTC (rev 35) @@ -2,7 +2,7 @@ # Form implementation generated from reading ui file 'src\moul\qt\ui\mainwindow.ui' # -# Created: Tue Jan 16 12:47:17 2007 +# Created: Tue Jan 16 13:40:50 2007 # by: PyQt4 UI code generator 4.1.1 # # WARNING! All changes made in this file will be lost! Property changes on: pymoul/trunk/src/moul/qt/ui/mainwindow.py ___________________________________________________________________ Name: svn:keywords + Id Revision Property changes on: pymoul/trunk/src/moul/qt/ui/moulqt_rc.py ___________________________________________________________________ Name: svn:keywords + Id Revision Property changes on: pymoul/trunk/src/moul/tests/__init__.py ___________________________________________________________________ Name: svn:keywords + Id Revision Name: svn:eol-style + native Modified: pymoul/trunk/src/moul/tests/test_i18n.py =================================================================== --- pymoul/trunk/src/moul/tests/test_i18n.py 2007-01-16 12:40:27 UTC (rev 34) +++ pymoul/trunk/src/moul/tests/test_i18n.py 2007-01-16 13:09:30 UTC (rev 35) @@ -15,6 +15,11 @@ # with this program; if not, write to the Free Software Foundation, Inc., 59 # Temple Place, Suite 330, Boston, MA 02111-1307 USA # +"""moul.i18n unit tests +__author__ = "Christian Heimes" +__version__ = "$Id$" +__revision__ = "$Revision$" + import unittest from doctest import DocTestSuite Property changes on: pymoul/trunk/src/moul/tests/test_i18n.py ___________________________________________________________________ Name: svn:keywords + Id Revision Name: svn:eol-style + native Property changes on: pymoul/trunk/src/moul/time/__init__.py ___________________________________________________________________ Name: svn:keywords + Id Revision Modified: pymoul/trunk/src/moul/time/cavern.py =================================================================== --- pymoul/trunk/src/moul/time/cavern.py 2007-01-16 12:40:27 UTC (rev 34) +++ pymoul/trunk/src/moul/time/cavern.py 2007-01-16 13:09:30 UTC (rev 35) @@ -17,6 +17,10 @@ # """pyMoul cavern time tool """ +__author__ = "Christian Heimes" +__version__ = "$Id$" +__revision__ = "$Revision$" + __all__ = ['TIMEZONE_NAMES', 'CavernTime'] from datetime import datetime Property changes on: pymoul/trunk/src/moul/time/cavern.py ___________________________________________________________________ Name: svn:keywords + Id Revision Modified: pymoul/trunk/src/moul/time/dni.py =================================================================== --- pymoul/trunk/src/moul/time/dni.py 2007-01-16 12:40:27 UTC (rev 34) +++ pymoul/trunk/src/moul/time/dni.py 2007-01-16 13:09:30 UTC (rev 35) @@ -17,6 +17,10 @@ # """pyMoul D'ni time tool """ +__author__ = "Christian Heimes" +__version__ = "$Id$" +__revision__ = "$Revision$" + from operator import mul FARAH_1 = -7656 # hahrtee fahrah 1 starts at April 21st 7656 B.C Property changes on: pymoul/trunk/src/moul/time/dni.py ___________________________________________________________________ Name: svn:keywords + Id Revision Modified: pymoul/trunk/src/moul/time/tests/__init__.py =================================================================== --- pymoul/trunk/src/moul/time/tests/__init__.py 2007-01-16 12:40:27 UTC (rev 34) +++ pymoul/trunk/src/moul/time/tests/__init__.py 2007-01-16 13:09:30 UTC (rev 35) @@ -1,2 +1,2 @@ -# testing package - +# testing package + Property changes on: pymoul/trunk/src/moul/time/tests/__init__.py ___________________________________________________________________ Name: svn:keywords + Id Revision Name: svn:eol-style + native Modified: pymoul/trunk/src/moul/time/tests/test_cavern.py =================================================================== --- pymoul/trunk/src/moul/time/tests/test_cavern.py 2007-01-16 12:40:27 UTC (rev 34) +++ pymoul/trunk/src/moul/time/tests/test_cavern.py 2007-01-16 13:09:30 UTC (rev 35) @@ -17,6 +17,10 @@ # """moul.time.cavern unit tests """ +__author__ = "Christian Heimes" +__version__ = "$Id$" +__revision__ = "$Revision$" + import os import unittest from doctest import DocTestSuite Property changes on: pymoul/trunk/src/moul/time/tests/test_cavern.py ___________________________________________________________________ Name: svn:keywords + Id Revision Property changes on: pymoul/trunk/test.py ___________________________________________________________________ Name: svn:keywords + Id Revision Name: svn:eol-style + native This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ti...@us...> - 2007-01-16 21:39:46
|
Revision: 38 http://pymoul.svn.sourceforge.net/pymoul/?rev=38&view=rev Author: tiran Date: 2007-01-16 13:39:46 -0800 (Tue, 16 Jan 2007) Log Message: ----------- More cool work on the UI: time and screen resolution slider Modified Paths: -------------- pymoul/trunk/setup_win32.py pymoul/trunk/src/moul/file/wdysini.py pymoul/trunk/src/moul/qt/mainwindow.py pymoul/trunk/src/moul/qt/ui/mainwindow.py pymoul/trunk/src/moul/qt/ui/mainwindow.ui pymoul/trunk/src/moul/time/cavern.py Modified: pymoul/trunk/setup_win32.py =================================================================== --- pymoul/trunk/setup_win32.py 2007-01-16 20:43:19 UTC (rev 37) +++ pymoul/trunk/setup_win32.py 2007-01-16 21:39:46 UTC (rev 38) @@ -38,7 +38,8 @@ packages = ['pytz.zoneinfo'] for tz in ('GMT', 'UTC'): packages.append('pytz.zoneinfo.%s' % tz) - for tz in ('America', 'Canada', 'Etc', 'Europe', 'US'): + # ('America', 'Canada', 'Etc', 'Europe', 'US'): + for tz in ('US',): packages.append('pytz.zoneinfo.%s.*' % tz) return packages # import pytz @@ -78,11 +79,11 @@ kw['setup_requires'].append(req) for req in (): kw['install_requires'].append(req) - kw['console'] = [ - { "script" : "src/moul/cli/moullauncher.py", - "icon_resources": [(1, "src/moul/uru.ico")] - } - ] +# kw['console'] = [ +# { "script" : "src/moul/cli/moullauncher.py", +# "icon_resources": [(1, "src/moul/uru.ico")] +# } +# ] kw.setdefault('options', {}) pexe = kw['options'].setdefault('py2exe', {}) pexe['compressed'] = 100 # compress zip file Modified: pymoul/trunk/src/moul/file/wdysini.py =================================================================== --- pymoul/trunk/src/moul/file/wdysini.py 2007-01-16 20:43:19 UTC (rev 37) +++ pymoul/trunk/src/moul/file/wdysini.py 2007-01-16 21:39:46 UTC (rev 38) @@ -72,4 +72,23 @@ 'Graphics.EnableVSync' : bool, 'Graphics.Shadow.VisibleDistance' : float, } + + # width, height, w ratio, h ratio + _videomodes = VIDEO_MODES + + def getVidModeByIdx(self, idx): + """Get video mode by index + """ + return self._videomodes[idx] + + def getVidModeHuman(self, idx): + """Human readable vidoe mode by index + """ + #import pdb; pdb.set_trace() + return "%ix%i (%i:%i)" % self.getVidModeByIdx(idx) + def getVidIdxByMode(self, w, h): + for idx, mode in enumerate(self._videomodes): + if mode[0] == w and mode[1] == h: + return idx + raise KeyError("Video mode for %ix%i not found" % (w, h)) Modified: pymoul/trunk/src/moul/qt/mainwindow.py =================================================================== --- pymoul/trunk/src/moul/qt/mainwindow.py 2007-01-16 20:43:19 UTC (rev 37) +++ pymoul/trunk/src/moul/qt/mainwindow.py 2007-01-16 21:39:46 UTC (rev 38) @@ -32,7 +32,7 @@ from moul.qt.ui.mainwindow import Ui_MainWindow from moul.time.cavern import CavernTime -from moul.time.cavern import TIMEZONE_NAMES +from moul.file.wdysini import GraphicsIni class MainWindow(QtGui.QMainWindow, Ui_MainWindow): def __init__(self): @@ -41,6 +41,29 @@ self.setupUi(self) self._timezone_init() + self._graphics_init() + + # ************************************************************************ + # graphics + def _graphics_init(self): + """init graphics tab + """ + self._graphicsini = GraphicsIni() + length = len(self._graphicsini._videomodes) -1 + self.slid_screenres.setMaximum(length) + self.connect(self.slid_screenres, SIGNAL("valueChanged(int)"), + self.on_slid_screenres_changed) + self.connect(self.slid_screenres, SIGNAL("sliderMoved(int)"), + self.on_slid_screenres_changed) + + def on_slid_screenres_changed(self, idx): + """SIGNAL: valueChanged (int) + """ + txt = self._graphicsini.getVidModeHuman(idx) + self.lb_screenres.setText(QString(txt)) + + # ************************************************************************ + # time zones def _timezone_init(self): """Init time zone tab""" @@ -52,13 +75,12 @@ self._timezone_timer = timer = QTimer(self) timer.setInterval(1000) # 1 sec # TODO: needs optimization? run only when timer tab is active - self.connect(timer, SIGNAL('timeout()'), self._timezone_update) + self.connect(timer, SIGNAL('timeout()'), self.on_timezone_timer_timeout) timer.start() - def _timezone_update(self, ct=None): + def _timezone_update(self): """Update datetime widgets""" - if ct is None: - ct = self._caverntime() + ct = self._caverntime.info() self.dt_cavern.setDateTime(ct['cavern']['datetime']) self.dt_pacific.setDateTime(ct['pacific']['datetime']) @@ -70,3 +92,10 @@ off = ct['pacific']['utcoffset'] txt = "UTC %s%i" % (off[0], abs(off[1])) self.lb_pacific_utc.setText(QString(txt)) + + def on_timezone_timer_timeout(self): + """SIGNAL: QTimer timeout + """ + ct = self._caverntime() + self.dt_cavern.setDateTime(ct['cavern']) + self.dt_pacific.setDateTime(ct['pacific']) Modified: pymoul/trunk/src/moul/qt/ui/mainwindow.py =================================================================== --- pymoul/trunk/src/moul/qt/ui/mainwindow.py 2007-01-16 20:43:19 UTC (rev 37) +++ pymoul/trunk/src/moul/qt/ui/mainwindow.py 2007-01-16 21:39:46 UTC (rev 38) @@ -2,7 +2,7 @@ # Form implementation generated from reading ui file 'src\moul\qt\ui\mainwindow.ui' # -# Created: Tue Jan 16 21:38:16 2007 +# Created: Tue Jan 16 22:34:20 2007 # by: PyQt4 UI code generator 4.1.1 # # WARNING! All changes made in this file will be lost! @@ -65,12 +65,6 @@ self.label.setPixmap(QtGui.QPixmap(":/resources/moul_logo.png")) self.label.setObjectName("label") - self.buttonbox_rresavcl = QtGui.QDialogButtonBox(self.centralwidget) - self.buttonbox_rresavcl.setGeometry(QtCore.QRect(10,480,441,32)) - self.buttonbox_rresavcl.setOrientation(QtCore.Qt.Horizontal) - self.buttonbox_rresavcl.setStandardButtons(QtGui.QDialogButtonBox.Close|QtGui.QDialogButtonBox.NoButton|QtGui.QDialogButtonBox.Reset|QtGui.QDialogButtonBox.Save) - self.buttonbox_rresavcl.setObjectName("buttonbox_rresavcl") - self.tabWidget = QtGui.QTabWidget(self.centralwidget) self.tabWidget.setGeometry(QtCore.QRect(5,100,450,375)) self.tabWidget.setTabPosition(QtGui.QTabWidget.North) @@ -92,21 +86,20 @@ self.vboxlayout.setSpacing(6) self.vboxlayout.setObjectName("vboxlayout") - self.horizontalSlider = QtGui.QSlider(self.verticalLayout_2) - self.horizontalSlider.setMaximum(11) - self.horizontalSlider.setPageStep(1) - self.horizontalSlider.setSliderPosition(0) - self.horizontalSlider.setTracking(False) - self.horizontalSlider.setOrientation(QtCore.Qt.Horizontal) - self.horizontalSlider.setTickPosition(QtGui.QSlider.TicksBelow) - self.horizontalSlider.setTickInterval(1) - self.horizontalSlider.setObjectName("horizontalSlider") - self.vboxlayout.addWidget(self.horizontalSlider) + self.slid_screenres = QtGui.QSlider(self.verticalLayout_2) + self.slid_screenres.setMaximum(10) + self.slid_screenres.setPageStep(1) + self.slid_screenres.setSliderPosition(0) + self.slid_screenres.setOrientation(QtCore.Qt.Horizontal) + self.slid_screenres.setTickPosition(QtGui.QSlider.TicksBelow) + self.slid_screenres.setTickInterval(1) + self.slid_screenres.setObjectName("slid_screenres") + self.vboxlayout.addWidget(self.slid_screenres) - self.label_resolution = QtGui.QLabel(self.verticalLayout_2) - self.label_resolution.setAlignment(QtCore.Qt.AlignCenter) - self.label_resolution.setObjectName("label_resolution") - self.vboxlayout.addWidget(self.label_resolution) + self.lb_screenres = QtGui.QLabel(self.verticalLayout_2) + self.lb_screenres.setAlignment(QtCore.Qt.AlignCenter) + self.lb_screenres.setObjectName("lb_screenres") + self.vboxlayout.addWidget(self.lb_screenres) self.groupBox_2 = QtGui.QGroupBox(self.tab_graphics) self.groupBox_2.setGeometry(QtCore.QRect(10,90,430,250)) @@ -290,6 +283,10 @@ self.tab_time = QtGui.QWidget() self.tab_time.setObjectName("tab_time") + self.gb_dnitime = QtGui.QGroupBox(self.tab_time) + self.gb_dnitime.setGeometry(QtCore.QRect(10,130,431,211)) + self.gb_dnitime.setObjectName("gb_dnitime") + self.gb_caverntime = QtGui.QGroupBox(self.tab_time) self.gb_caverntime.setGeometry(QtCore.QRect(10,10,431,111)) self.gb_caverntime.setObjectName("gb_caverntime") @@ -330,10 +327,6 @@ self.lb_pacific_utc = QtGui.QLabel(self.gridLayout) self.lb_pacific_utc.setObjectName("lb_pacific_utc") self.gridlayout.addWidget(self.lb_pacific_utc,1,2,1,1) - - self.gb_dnitime = QtGui.QGroupBox(self.tab_time) - self.gb_dnitime.setGeometry(QtCore.QRect(10,130,431,211)) - self.gb_dnitime.setObjectName("gb_dnitime") self.tabWidget.addTab(self.tab_time,"") self.tab_4 = QtGui.QWidget() @@ -344,6 +337,12 @@ self.label_6.setAlignment(QtCore.Qt.AlignCenter) self.label_6.setObjectName("label_6") self.tabWidget.addTab(self.tab_4,"") + + self.buttonbox_rresavcl = QtGui.QDialogButtonBox(self.centralwidget) + self.buttonbox_rresavcl.setGeometry(QtCore.QRect(10,480,441,32)) + self.buttonbox_rresavcl.setOrientation(QtCore.Qt.Horizontal) + self.buttonbox_rresavcl.setStandardButtons(QtGui.QDialogButtonBox.Close|QtGui.QDialogButtonBox.NoButton|QtGui.QDialogButtonBox.Reset|QtGui.QDialogButtonBox.Save) + self.buttonbox_rresavcl.setObjectName("buttonbox_rresavcl") MainWindow.setCentralWidget(self.centralwidget) self.statusbar = QtGui.QStatusBar(MainWindow) @@ -356,10 +355,10 @@ QtCore.QMetaObject.connectSlotsByName(MainWindow) def retranslateUi(self, MainWindow): - MainWindow.setWindowTitle(QtGui.QApplication.translate("MainWindow", "MainWindow", None, QtGui.QApplication.UnicodeUTF8)) + MainWindow.setWindowTitle(QtGui.QApplication.translate("MainWindow", "Tool for Myst Online", None, QtGui.QApplication.UnicodeUTF8)) self.pushButton.setText(QtGui.QApplication.translate("MainWindow", "Configure", None, QtGui.QApplication.UnicodeUTF8)) self.groupBox.setTitle(QtGui.QApplication.translate("MainWindow", "Screen Resolution", None, QtGui.QApplication.UnicodeUTF8)) - self.label_resolution.setText(QtGui.QApplication.translate("MainWindow", "800x600 (4:3)", None, QtGui.QApplication.UnicodeUTF8)) + self.lb_screenres.setText(QtGui.QApplication.translate("MainWindow", "800x600 (4:3)", None, QtGui.QApplication.UnicodeUTF8)) self.groupBox_2.setTitle(QtGui.QApplication.translate("MainWindow", "Quality", None, QtGui.QApplication.UnicodeUTF8)) self.label_20.setText(QtGui.QApplication.translate("MainWindow", "Texture:", None, QtGui.QApplication.UnicodeUTF8)) self.label_21.setText(QtGui.QApplication.translate("MainWindow", "Low", None, QtGui.QApplication.UnicodeUTF8)) @@ -377,12 +376,12 @@ self.label_7.setText(QtGui.QApplication.translate("MainWindow", "Ultra", None, QtGui.QApplication.UnicodeUTF8)) self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_graphics), QtGui.QApplication.translate("MainWindow", "Graphis", None, QtGui.QApplication.UnicodeUTF8)) self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_audio), QtGui.QApplication.translate("MainWindow", "Audio", None, QtGui.QApplication.UnicodeUTF8)) + self.gb_dnitime.setTitle(QtGui.QApplication.translate("MainWindow", "D\'ni time", None, QtGui.QApplication.UnicodeUTF8)) self.gb_caverntime.setTitle(QtGui.QApplication.translate("MainWindow", "Time zones", None, QtGui.QApplication.UnicodeUTF8)) self.label_4.setText(QtGui.QApplication.translate("MainWindow", "Cavern time:", None, QtGui.QApplication.UnicodeUTF8)) self.lb_cavern_utc.setText(QtGui.QApplication.translate("MainWindow", "UTC", None, QtGui.QApplication.UnicodeUTF8)) self.label_5.setText(QtGui.QApplication.translate("MainWindow", "Pacific time:", None, QtGui.QApplication.UnicodeUTF8)) self.lb_pacific_utc.setText(QtGui.QApplication.translate("MainWindow", "UTC", None, QtGui.QApplication.UnicodeUTF8)) - self.gb_dnitime.setTitle(QtGui.QApplication.translate("MainWindow", "D\'ni time", None, QtGui.QApplication.UnicodeUTF8)) self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_time), QtGui.QApplication.translate("MainWindow", "Time", None, QtGui.QApplication.UnicodeUTF8)) self.label_6.setText(QtGui.QApplication.translate("MainWindow", "pyMoul tools", None, QtGui.QApplication.UnicodeUTF8)) self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_4), QtGui.QApplication.translate("MainWindow", "About", None, QtGui.QApplication.UnicodeUTF8)) Modified: pymoul/trunk/src/moul/qt/ui/mainwindow.ui =================================================================== --- pymoul/trunk/src/moul/qt/ui/mainwindow.ui 2007-01-16 20:43:19 UTC (rev 37) +++ pymoul/trunk/src/moul/qt/ui/mainwindow.ui 2007-01-16 21:39:46 UTC (rev 38) @@ -22,7 +22,7 @@ </sizepolicy> </property> <property name="windowTitle" > - <string>MainWindow</string> + <string>Tool for Myst Online</string> </property> <property name="windowIcon" > <iconset resource="moulqt.qrc" >:/resources/uru_icon_32x32.png</iconset> @@ -100,22 +100,6 @@ <pixmap resource="moulqt.qrc" >:/resources/moul_logo.png</pixmap> </property> </widget> - <widget class="QDialogButtonBox" name="buttonbox_rresavcl" > - <property name="geometry" > - <rect> - <x>10</x> - <y>480</y> - <width>441</width> - <height>32</height> - </rect> - </property> - <property name="orientation" > - <enum>Qt::Horizontal</enum> - </property> - <property name="standardButtons" > - <set>QDialogButtonBox::Close|QDialogButtonBox::NoButton|QDialogButtonBox::Reset|QDialogButtonBox::Save</set> - </property> - </widget> <widget class="QTabWidget" name="tabWidget" > <property name="geometry" > <rect> @@ -164,9 +148,9 @@ <number>6</number> </property> <item> - <widget class="QSlider" name="horizontalSlider" > + <widget class="QSlider" name="slid_screenres" > <property name="maximum" > - <number>11</number> + <number>10</number> </property> <property name="pageStep" > <number>1</number> @@ -174,9 +158,6 @@ <property name="sliderPosition" > <number>0</number> </property> - <property name="tracking" > - <bool>false</bool> - </property> <property name="orientation" > <enum>Qt::Horizontal</enum> </property> @@ -189,7 +170,7 @@ </widget> </item> <item> - <widget class="QLabel" name="label_resolution" > + <widget class="QLabel" name="lb_screenres" > <property name="text" > <string>800x600 (4:3)</string> </property> @@ -564,6 +545,19 @@ <attribute name="title" > <string>Time</string> </attribute> + <widget class="QGroupBox" name="gb_dnitime" > + <property name="geometry" > + <rect> + <x>10</x> + <y>130</y> + <width>431</width> + <height>211</height> + </rect> + </property> + <property name="title" > + <string>D'ni time</string> + </property> + </widget> <widget class="QGroupBox" name="gb_caverntime" > <property name="geometry" > <rect> @@ -643,19 +637,6 @@ </layout> </widget> </widget> - <widget class="QGroupBox" name="gb_dnitime" > - <property name="geometry" > - <rect> - <x>10</x> - <y>130</y> - <width>431</width> - <height>211</height> - </rect> - </property> - <property name="title" > - <string>D'ni time</string> - </property> - </widget> </widget> <widget class="QWidget" name="tab_4" > <attribute name="title" > @@ -679,6 +660,22 @@ </widget> </widget> </widget> + <widget class="QDialogButtonBox" name="buttonbox_rresavcl" > + <property name="geometry" > + <rect> + <x>10</x> + <y>480</y> + <width>441</width> + <height>32</height> + </rect> + </property> + <property name="orientation" > + <enum>Qt::Horizontal</enum> + </property> + <property name="standardButtons" > + <set>QDialogButtonBox::Close|QDialogButtonBox::NoButton|QDialogButtonBox::Reset|QDialogButtonBox::Save</set> + </property> + </widget> </widget> <widget class="QStatusBar" name="statusbar" /> </widget> @@ -697,8 +694,8 @@ <y>494</y> </hint> <hint type="destinationlabel" > - <x>46</x> - <y>661</y> + <x>42</x> + <y>529</y> </hint> </hints> </connection> Modified: pymoul/trunk/src/moul/time/cavern.py =================================================================== --- pymoul/trunk/src/moul/time/cavern.py 2007-01-16 20:43:19 UTC (rev 37) +++ pymoul/trunk/src/moul/time/cavern.py 2007-01-16 21:39:46 UTC (rev 38) @@ -119,6 +119,9 @@ >>> ct = CavernTime() >>> result = ct() + >>> 'cavern' in result, 'pacific' in result + (True, True) + >>> result = ct.info() >>> 'utc' in result True @@ -169,11 +172,18 @@ if utc_dt is None: utc_dt = self._utcnow() return tz.normalize(utc_dt.astimezone(tz)) - + def __call__(self): now = self._utcnow() result = {} for id, tz in (('cavern', self._cavern), ('pacific', self._pacific)): + result[id] = self._normalize(tz, now) + return result + + def info(self): + now = self._utcnow() + result = {} + for id, tz in (('cavern', self._cavern), ('pacific', self._pacific)): info = result.setdefault(id, {}) utcoffset = td2int(tz.utcoffset(now)) signum = utcoffset < 0 and '-' or '+' This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ti...@us...> - 2007-01-17 12:52:53
|
Revision: 41 http://pymoul.svn.sourceforge.net/pymoul/?rev=41&view=rev Author: tiran Date: 2007-01-17 04:52:49 -0800 (Wed, 17 Jan 2007) Log Message: ----------- * Disabled some code in time.cavern that is no longer required * Revamped ping tests and added some useful stuff to ServerList like iter() and len() Modified Paths: -------------- pymoul/trunk/Makefile pymoul/trunk/src/moul/qt/ui/mainwindow.py pymoul/trunk/src/moul/qt/ui/mainwindow.ui pymoul/trunk/src/moul/server/ping.py pymoul/trunk/src/moul/server/tests/test_ping.py pymoul/trunk/src/moul/time/cavern.py Modified: pymoul/trunk/Makefile =================================================================== --- pymoul/trunk/Makefile 2007-01-17 11:29:30 UTC (rev 40) +++ pymoul/trunk/Makefile 2007-01-17 12:52:49 UTC (rev 41) @@ -9,7 +9,7 @@ inplace: $(PYTHON) setup.py $(SETUPFLAGS) build_ext -i -build: +build: compileui $(PYTHON) setup.py $(SETUPFLAGS) build py2exe: @@ -18,13 +18,16 @@ bdist_egg: $(PYTHON) setup.py $(SETUPFLAGS) bdist_egg -run: +run: compileui $(PYTHON) src/moul/qt/moulqt.py -test_build: build +compileui: + $(PYTHON) compileui.py + +test_build: build compileui $(PYTHON) test.py $(TESTFLAGS) $(TESTOPTS) -test_inplace: +test_inplace: compileui $(PYTHON) test.py $(TESTFLAGS) $(TESTOPTS) ftest_build: build Modified: pymoul/trunk/src/moul/qt/ui/mainwindow.py =================================================================== --- pymoul/trunk/src/moul/qt/ui/mainwindow.py 2007-01-17 11:29:30 UTC (rev 40) +++ pymoul/trunk/src/moul/qt/ui/mainwindow.py 2007-01-17 12:52:49 UTC (rev 41) @@ -2,7 +2,7 @@ # Form implementation generated from reading ui file 'src\moul\qt\ui\mainwindow.ui' # -# Created: Wed Jan 17 01:43:35 2007 +# Created: Wed Jan 17 13:36:40 2007 # by: PyQt4 UI code generator 4.1.1 # # WARNING! All changes made in this file will be lost! @@ -27,6 +27,13 @@ self.centralwidget.setEnabled(True) self.centralwidget.setObjectName("centralwidget") + self.label = QtGui.QLabel(self.centralwidget) + self.label.setGeometry(QtCore.QRect(15,10,430,58)) + self.label.setFrameShape(QtGui.QFrame.StyledPanel) + self.label.setFrameShadow(QtGui.QFrame.Sunken) + self.label.setPixmap(QtGui.QPixmap(":/resources/moul_logo.png")) + self.label.setObjectName("label") + self.horizontalLayout = QtGui.QWidget(self.centralwidget) self.horizontalLayout.setGeometry(QtCore.QRect(60,70,341,31)) self.horizontalLayout.setObjectName("horizontalLayout") @@ -58,13 +65,6 @@ self.pushButton.setObjectName("pushButton") self.hboxlayout.addWidget(self.pushButton) - self.label = QtGui.QLabel(self.centralwidget) - self.label.setGeometry(QtCore.QRect(15,10,430,58)) - self.label.setFrameShape(QtGui.QFrame.StyledPanel) - self.label.setFrameShadow(QtGui.QFrame.Sunken) - self.label.setPixmap(QtGui.QPixmap(":/resources/moul_logo.png")) - self.label.setObjectName("label") - self.tabWidget = QtGui.QTabWidget(self.centralwidget) self.tabWidget.setGeometry(QtCore.QRect(5,100,450,375)) self.tabWidget.setTabPosition(QtGui.QTabWidget.North) @@ -283,10 +283,6 @@ self.tab_time = QtGui.QWidget() self.tab_time.setObjectName("tab_time") - self.gb_dnitime = QtGui.QGroupBox(self.tab_time) - self.gb_dnitime.setGeometry(QtCore.QRect(10,130,431,211)) - self.gb_dnitime.setObjectName("gb_dnitime") - self.gb_caverntime = QtGui.QGroupBox(self.tab_time) self.gb_caverntime.setGeometry(QtCore.QRect(10,10,431,111)) self.gb_caverntime.setObjectName("gb_caverntime") @@ -301,6 +297,9 @@ self.gridlayout.setObjectName("gridlayout") self.dt_cavern = QtGui.QDateTimeEdit(self.gridLayout) + self.dt_cavern.setCursor(QtGui.QCursor(QtCore.Qt.CursorShape(0))) + self.dt_cavern.setFocusPolicy(QtCore.Qt.NoFocus) + self.dt_cavern.setContextMenuPolicy(QtCore.Qt.NoContextMenu) self.dt_cavern.setReadOnly(True) self.dt_cavern.setButtonSymbols(QtGui.QAbstractSpinBox.UpDownArrows) self.dt_cavern.setObjectName("dt_cavern") @@ -319,6 +318,8 @@ self.gridlayout.addWidget(self.label_5,1,0,1,1) self.dt_pacific = QtGui.QDateTimeEdit(self.gridLayout) + self.dt_pacific.setFocusPolicy(QtCore.Qt.NoFocus) + self.dt_pacific.setContextMenuPolicy(QtCore.Qt.NoContextMenu) self.dt_pacific.setReadOnly(True) self.dt_pacific.setButtonSymbols(QtGui.QAbstractSpinBox.UpDownArrows) self.dt_pacific.setObjectName("dt_pacific") @@ -327,8 +328,29 @@ self.lb_pacific_utc = QtGui.QLabel(self.gridLayout) self.lb_pacific_utc.setObjectName("lb_pacific_utc") self.gridlayout.addWidget(self.lb_pacific_utc,1,2,1,1) + + self.gb_dnitime = QtGui.QGroupBox(self.tab_time) + self.gb_dnitime.setGeometry(QtCore.QRect(10,130,431,211)) + self.gb_dnitime.setObjectName("gb_dnitime") self.tabWidget.addTab(self.tab_time,"") + self.tab = QtGui.QWidget() + self.tab.setObjectName("tab") + + self.gb_servers = QtGui.QGroupBox(self.tab) + self.gb_servers.setGeometry(QtCore.QRect(10,0,421,341)) + self.gb_servers.setObjectName("gb_servers") + + self.but_ping = QtGui.QPushButton(self.gb_servers) + self.but_ping.setGeometry(QtCore.QRect(330,310,75,24)) + self.but_ping.setObjectName("but_ping") + + self.text_ping = QtGui.QTextEdit(self.gb_servers) + self.text_ping.setGeometry(QtCore.QRect(10,20,401,271)) + self.text_ping.setReadOnly(True) + self.text_ping.setObjectName("text_ping") + self.tabWidget.addTab(self.tab,"") + self.tab_4 = QtGui.QWidget() self.tab_4.setObjectName("tab_4") @@ -350,7 +372,7 @@ MainWindow.setStatusBar(self.statusbar) self.retranslateUi(MainWindow) - self.tabWidget.setCurrentIndex(0) + self.tabWidget.setCurrentIndex(2) QtCore.QObject.connect(self.buttonbox_rresavcl,QtCore.SIGNAL("rejected()"),MainWindow.close) QtCore.QMetaObject.connectSlotsByName(MainWindow) @@ -376,13 +398,20 @@ self.label_7.setText(QtGui.QApplication.translate("MainWindow", "Ultra", None, QtGui.QApplication.UnicodeUTF8)) self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_graphics), QtGui.QApplication.translate("MainWindow", "Graphis", None, QtGui.QApplication.UnicodeUTF8)) self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_audio), QtGui.QApplication.translate("MainWindow", "Audio", None, QtGui.QApplication.UnicodeUTF8)) - self.gb_dnitime.setTitle(QtGui.QApplication.translate("MainWindow", "D\'ni time", None, QtGui.QApplication.UnicodeUTF8)) self.gb_caverntime.setTitle(QtGui.QApplication.translate("MainWindow", "Time zones", None, QtGui.QApplication.UnicodeUTF8)) self.label_4.setText(QtGui.QApplication.translate("MainWindow", "Cavern time:", None, QtGui.QApplication.UnicodeUTF8)) self.lb_cavern_utc.setText(QtGui.QApplication.translate("MainWindow", "UTC", None, QtGui.QApplication.UnicodeUTF8)) self.label_5.setText(QtGui.QApplication.translate("MainWindow", "Pacific time:", None, QtGui.QApplication.UnicodeUTF8)) self.lb_pacific_utc.setText(QtGui.QApplication.translate("MainWindow", "UTC", None, QtGui.QApplication.UnicodeUTF8)) + self.gb_dnitime.setTitle(QtGui.QApplication.translate("MainWindow", "D\'ni time", None, QtGui.QApplication.UnicodeUTF8)) self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_time), QtGui.QApplication.translate("MainWindow", "Time", None, QtGui.QApplication.UnicodeUTF8)) + self.gb_servers.setTitle(QtGui.QApplication.translate("MainWindow", "Ping servers", None, QtGui.QApplication.UnicodeUTF8)) + self.but_ping.setText(QtGui.QApplication.translate("MainWindow", "Ping", None, QtGui.QApplication.UnicodeUTF8)) + self.text_ping.setHtml(QtGui.QApplication.translate("MainWindow", "<html><head><meta name=\"qrichtext\" content=\"1\" /><style type=\"text/css\">\n" + "p, li { white-space: pre-wrap; }\n" + "</style></head><body style=\" font-family:\'MS Shell Dlg 2\'; font-size:8.25pt; font-weight:400; font-style:normal; text-decoration:none;\">\n" + "<p style=\"-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"></p></body></html>", None, QtGui.QApplication.UnicodeUTF8)) + self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab), QtGui.QApplication.translate("MainWindow", "Servers", None, QtGui.QApplication.UnicodeUTF8)) self.label_6.setText(QtGui.QApplication.translate("MainWindow", "pyMoul tools", None, QtGui.QApplication.UnicodeUTF8)) self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_4), QtGui.QApplication.translate("MainWindow", "About", None, QtGui.QApplication.UnicodeUTF8)) Modified: pymoul/trunk/src/moul/qt/ui/mainwindow.ui =================================================================== --- pymoul/trunk/src/moul/qt/ui/mainwindow.ui 2007-01-17 11:29:30 UTC (rev 40) +++ pymoul/trunk/src/moul/qt/ui/mainwindow.ui 2007-01-17 12:52:49 UTC (rev 41) @@ -31,6 +31,28 @@ <property name="enabled" > <bool>true</bool> </property> + <widget class="QLabel" name="label" > + <property name="geometry" > + <rect> + <x>15</x> + <y>10</y> + <width>430</width> + <height>58</height> + </rect> + </property> + <property name="frameShape" > + <enum>QFrame::StyledPanel</enum> + </property> + <property name="frameShadow" > + <enum>QFrame::Sunken</enum> + </property> + <property name="text" > + <string/> + </property> + <property name="pixmap" > + <pixmap resource="moulqt.qrc" >:/resources/moul_logo.png</pixmap> + </property> + </widget> <widget class="QWidget" name="horizontalLayout" > <property name="geometry" > <rect> @@ -78,28 +100,6 @@ </item> </layout> </widget> - <widget class="QLabel" name="label" > - <property name="geometry" > - <rect> - <x>15</x> - <y>10</y> - <width>430</width> - <height>58</height> - </rect> - </property> - <property name="frameShape" > - <enum>QFrame::StyledPanel</enum> - </property> - <property name="frameShadow" > - <enum>QFrame::Sunken</enum> - </property> - <property name="text" > - <string/> - </property> - <property name="pixmap" > - <pixmap resource="moulqt.qrc" >:/resources/moul_logo.png</pixmap> - </property> - </widget> <widget class="QTabWidget" name="tabWidget" > <property name="geometry" > <rect> @@ -113,7 +113,7 @@ <enum>QTabWidget::North</enum> </property> <property name="currentIndex" > - <number>0</number> + <number>2</number> </property> <widget class="QWidget" name="tab_graphics" > <attribute name="title" > @@ -545,19 +545,6 @@ <attribute name="title" > <string>Time</string> </attribute> - <widget class="QGroupBox" name="gb_dnitime" > - <property name="geometry" > - <rect> - <x>10</x> - <y>130</y> - <width>431</width> - <height>211</height> - </rect> - </property> - <property name="title" > - <string>D'ni time</string> - </property> - </widget> <widget class="QGroupBox" name="gb_caverntime" > <property name="geometry" > <rect> @@ -588,6 +575,15 @@ </property> <item row="0" column="1" > <widget class="QDateTimeEdit" name="dt_cavern" > + <property name="cursor" > + <cursor>0</cursor> + </property> + <property name="focusPolicy" > + <enum>Qt::NoFocus</enum> + </property> + <property name="contextMenuPolicy" > + <enum>Qt::NoContextMenu</enum> + </property> <property name="readOnly" > <bool>true</bool> </property> @@ -619,6 +615,12 @@ </item> <item row="1" column="1" > <widget class="QDateTimeEdit" name="dt_pacific" > + <property name="focusPolicy" > + <enum>Qt::NoFocus</enum> + </property> + <property name="contextMenuPolicy" > + <enum>Qt::NoContextMenu</enum> + </property> <property name="readOnly" > <bool>true</bool> </property> @@ -637,7 +639,70 @@ </layout> </widget> </widget> + <widget class="QGroupBox" name="gb_dnitime" > + <property name="geometry" > + <rect> + <x>10</x> + <y>130</y> + <width>431</width> + <height>211</height> + </rect> + </property> + <property name="title" > + <string>D'ni time</string> + </property> + </widget> </widget> + <widget class="QWidget" name="tab" > + <attribute name="title" > + <string>Servers</string> + </attribute> + <widget class="QGroupBox" name="gb_servers" > + <property name="geometry" > + <rect> + <x>10</x> + <y>0</y> + <width>421</width> + <height>341</height> + </rect> + </property> + <property name="title" > + <string>Ping servers</string> + </property> + <widget class="QPushButton" name="but_ping" > + <property name="geometry" > + <rect> + <x>330</x> + <y>310</y> + <width>75</width> + <height>24</height> + </rect> + </property> + <property name="text" > + <string>Ping</string> + </property> + </widget> + <widget class="QTextEdit" name="text_ping" > + <property name="geometry" > + <rect> + <x>10</x> + <y>20</y> + <width>401</width> + <height>271</height> + </rect> + </property> + <property name="readOnly" > + <bool>true</bool> + </property> + <property name="html" > + <string><html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal; text-decoration:none;"> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"></p></body></html></string> + </property> + </widget> + </widget> + </widget> <widget class="QWidget" name="tab_4" > <attribute name="title" > <string>About</string> Modified: pymoul/trunk/src/moul/server/ping.py =================================================================== --- pymoul/trunk/src/moul/server/ping.py 2007-01-17 11:29:30 UTC (rev 40) +++ pymoul/trunk/src/moul/server/ping.py 2007-01-17 12:52:49 UTC (rev 41) @@ -17,30 +17,6 @@ # """Server ping ->>> server = Server(SERVER_LIST[0], PORT) ->>> result = server.dns() ->>> isinstance(result, float) -True ->>> result = server.portping() ->>> isinstance(result, float) -True - ->>> server = Server('bogus.nonworking.example.foo', PORT) ->>> result = server.dns() ->>> isinstance(result, socket.gaierror) -True - ->>> server = Server(name=SERVER_LIST[0], port=12345, timeout=1.0) ->>> result = server.portping() ->>> isinstance(result, socket.timeout) -True - ->>> serverlist = ServerList(names=SERVER_LIST, port=PORT, timeout=1.0) ->>> for name, stat in serverlist.dns(): -... print name, stat ->>> for name, stat in serverlist.portping(): -... print name, stat - """ import socket from time import time @@ -88,7 +64,7 @@ if self._ip is None: self.dns() if self._ip is False: - return + return False sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) sock.settimeout(self._timeout) @@ -133,3 +109,9 @@ def portping(self): for server in self._servers: yield server.name, server.portping() + + def __iter__(self): + return iter(self._servers) + + def __len__(self): + return len(self._servers) Modified: pymoul/trunk/src/moul/server/tests/test_ping.py =================================================================== --- pymoul/trunk/src/moul/server/tests/test_ping.py 2007-01-17 11:29:30 UTC (rev 40) +++ pymoul/trunk/src/moul/server/tests/test_ping.py 2007-01-17 12:52:49 UTC (rev 41) @@ -24,10 +24,40 @@ import unittest from doctest import DocTestSuite -import moul.server.ping +from moul.server.ping import Server +from moul.server.ping import ServerList +from moul.server.ping import isError +from moul.server.serverlist import SERVER_LIST +from moul.server.serverlist import PORT +class PingServerTest(unittest.TestCase): + + def test_ping_working(self): + server = Server(SERVER_LIST[0], PORT) + result = server.dns() + self.failUnless(isinstance(result, float)) + result = server.portping() + self.failUnless(isinstance(result, float)) + + def test_ping_bogus(self): + server = Server('bogus.nonworking.example.foo', PORT) + result = server.dns() + self.failUnless(isError(result)) + result = server.portping() + self.failUnless(result is False) + + def test_iterlist(self): + names = ['server1', 'server2'] + sl = ServerList(names, PORT) + self.failUnlessEqual(len(sl), 2) + servers = [] + for server in sl: + servers.append(server.name) + self.failUnlessEqual(servers, names) + def test_suite(): return unittest.TestSuite(( + unittest.makeSuite(PingServerTest), DocTestSuite('moul.server.ping'), )) Modified: pymoul/trunk/src/moul/time/cavern.py =================================================================== --- pymoul/trunk/src/moul/time/cavern.py 2007-01-17 11:29:30 UTC (rev 40) +++ pymoul/trunk/src/moul/time/cavern.py 2007-01-17 12:52:49 UTC (rev 41) @@ -21,7 +21,7 @@ __version__ = "$Id$" __revision__ = "$Revision$" -__all__ = ['TIMEZONE_NAMES', 'CavernTime'] +__all__ = ['CavernTime'] from datetime import datetime @@ -30,43 +30,46 @@ from pytz import timezone from pytz import utc as UTC -SUPPORTED_TZ = ('America', 'Canada', 'Etc', 'Europe', 'US') -ADDITIONAL_TZ = ('GMT', 'UTC') +## not used in the current version +#SUPPORTED_TZ = ('America', 'Canada', 'Etc', 'Europe', 'US') +#ADDITIONAL_TZ = ('GMT', 'UTC') +# +#def _listSupported(tz_list): +# supported = [] +# unsupported = [] +# for tz in tz_list: +# if tz.find('/') == -1: +# if tz in ADDITIONAL_TZ: +# supported.append(tz) +# else: +# unsupported.append(tz) +# continue +# split = tz.split('/') +# if len(split) > 2: +# continue +# prefix, postfix = tz.split('/')[:2] +# if prefix in SUPPORTED_TZ: +# supported.append(tz) +# else: +# unsupported.append(tz) +# supported.sort() +# unsupported.sort() +# return supported, unsupported +# +## not used in the current version +#TIMEZONE_NAMES, UNSUPPORTED = _listSupported(all_timezones) -def _listSupported(tz_list): - supported = [] - unsupported = [] - for tz in tz_list: - if tz.find('/') == -1: - if tz in ADDITIONAL_TZ: - supported.append(tz) - else: - unsupported.append(tz) - continue - split = tz.split('/') - if len(split) > 2: - continue - prefix, postfix = tz.split('/')[:2] - if prefix in SUPPORTED_TZ: - supported.append(tz) - else: - unsupported.append(tz) - supported.sort() - unsupported.sort() - return supported, unsupported - -TIMEZONE_NAMES, UNSUPPORTED = _listSupported(all_timezones) - # Cyan HQ is near Spokane / Washington # Cavern time is Mountain Time Zone (MDT) with daylight savings (MST) CAVERN_TZ_NAME = 'US/Mountain' # MST / MDT CAVERN_TZ = timezone(CAVERN_TZ_NAME) +# The support is using PST (PDT) PACIFIC_TZ_NAME = 'US/Pacific' # PST / PDT PACIFIC_TZ = timezone(PACIFIC_TZ_NAME) def diffTD(td1, td2): - """Difference of two objects -> int + """Difference of two time delta objects -> int >>> from datetime import timedelta >>> type(diffTD(timedelta(0, 3600), timedelta(0, -3600))) @@ -150,12 +153,12 @@ True >>> del pst - >>> 'UTC' in CavernTime.timezones - True - >>> 'UTC' in ct.timezones - True + #>>> 'UTC' in CavernTime.timezones + #True + #>>> 'UTC' in ct.timezones + #True """ - timezones = TIMEZONE_NAMES + # timezones = TIMEZONE_NAMES _cavern = CAVERN_TZ _pacific = PACIFIC_TZ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ti...@us...> - 2007-01-18 17:02:00
|
Revision: 45 http://pymoul.svn.sourceforge.net/pymoul/?rev=45&view=rev Author: tiran Date: 2007-01-18 09:01:49 -0800 (Thu, 18 Jan 2007) Log Message: ----------- * Fixed compileui.py to create files * Added AUTHORS.txt * Add txt files to dist Modified Paths: -------------- pymoul/trunk/compileui.py pymoul/trunk/setup.py Added Paths: ----------- pymoul/trunk/AUTHORS.txt Added: pymoul/trunk/AUTHORS.txt =================================================================== --- pymoul/trunk/AUTHORS.txt (rev 0) +++ pymoul/trunk/AUTHORS.txt 2007-01-18 17:01:49 UTC (rev 45) @@ -0,0 +1,13 @@ +Authors +------- + +Christian Heimes (maintainer, software design, QT ui) + +Others +------ + +ELF crypt code based on Marack's C++ code. + +Whatdoyousee crypt code based on the C++ code from Joseph D. and Anonymous54321. + +miniwinshell is a stripped down version of Tim Golden's winshell. Property changes on: pymoul/trunk/AUTHORS.txt ___________________________________________________________________ Name: svn:eol-style + native Modified: pymoul/trunk/compileui.py =================================================================== --- pymoul/trunk/compileui.py 2007-01-18 17:00:13 UTC (rev 44) +++ pymoul/trunk/compileui.py 2007-01-18 17:01:49 UTC (rev 45) @@ -22,7 +22,11 @@ UI_MODULE = "moul.qt.ui" def _newer(orig, py): - return os.stat(orig)[ST_MTIME] > os.stat(py)[ST_MTIME] + try: + return os.stat(orig)[ST_MTIME] > os.stat(py)[ST_MTIME] + except Exception: + return True + def previewUi(uifname): """Copied from PyQt.uic.pyuic Modified: pymoul/trunk/setup.py =================================================================== --- pymoul/trunk/setup.py 2007-01-18 17:00:13 UTC (rev 44) +++ pymoul/trunk/setup.py 2007-01-18 17:01:49 UTC (rev 45) @@ -10,10 +10,13 @@ import sys import os import time +from glob import glob + # boot strap easy setup SETUPTOOLS_VERSION = "0.6c1" from ez_setup import use_setuptools use_setuptools(version=SETUPTOOLS_VERSION) + from setuptools import setup from setuptools import find_packages from compileui import compileUi @@ -50,7 +53,7 @@ setup_options = dict( setup_requires = ["setuptools>="+SETUPTOOLS_VERSION,], install_requires = [], - data_files = [], + data_files = list(glob('*.txt')), package_dir = {'' : 'src'}, packages = find_packages('src', exclude="moul.qt"), include_package_data = True, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ti...@us...> - 2007-01-20 15:28:53
|
Revision: 52 http://pymoul.svn.sourceforge.net/pymoul/?rev=52&view=rev Author: tiran Date: 2007-01-20 07:28:50 -0800 (Sat, 20 Jan 2007) Log Message: ----------- Updated installation information for Windows and Unix Modified Paths: -------------- pymoul/trunk/INSTALL.txt Removed Paths: ------------- pymoul/trunk/README.qt.txt Modified: pymoul/trunk/INSTALL.txt =================================================================== --- pymoul/trunk/INSTALL.txt 2007-01-19 16:32:53 UTC (rev 51) +++ pymoul/trunk/INSTALL.txt 2007-01-20 15:28:50 UTC (rev 52) @@ -1,30 +1,171 @@ +============ Requirements ============ - * Python 2.5.x + * Python 2.5.x http://www.python.org/ + * easy_install http://peak.telecommunity.com/DevCenter/EasyInstall + * setuptools (via easy install) + * PyTz (via $ easy_install pytz) + * Qt4 GPL 4.2+ http://www.trolltech.com/developer/downloads/qt/ + * PyQt4 4.1.1+ http://www.riverbankcomputing.co.uk/pyqt/ - Also read README.qt.txt - Windows ------- * pywin32 http://sourceforge.net/projects/pywin32/ + * py2exe http://www.py2exe.org/ + * MinGW32 compiler (bundled with Qt4) -Development ------------ - - * py2exe http://www.py2exe.org/ (Windows only) - - Tools ----- * UPX http://upx.sourceforge.net/#download - * Nullsoft Installer http://nsis.sourceforge.net/ +==================== +Windows Installation +==================== + +Installation +------------ + + * Download Qt/Windows Open Source Edition from + http://www.trolltech.com/developer/downloads/qt/index + + * Download PyQt4 GPL from http://www.riverbankcomputing.co.uk/pyqt/ + If you want to use eric4 as editor install sip and PyQt4 from sources! + + * Install Qt4 + MinGW. I suggest installing both to C:\Program Files instead + of C:\ (C:\Programme or whatever your program files folder is) + + * Install PyQt4 + +http://www.riverbankcomputing.com/Downloads/PyQt4/GPL/ +http://wftp.tu-chemnitz.de/pub/Qt/qt/source/qt-win-opensource-4.2.2-mingw.exe + +Adjust your environment for Qt/PyQt +----------------------------------- + +You have to create / adjust some environment variables in order to make +Qt and PyQt work well. I had to create the variables manually. The article at +http://vlaurie.com/computers2/Articles/environment.htm#editing explains how +to set user specific env vars. + +PATH = %PATH%;%ProgramFiles%\Python25;%ProgramFiles%\Python25\Scripts;%ProgramFiles%\Qt\4.2.2\bin;%ProgramFile +s%\MinGW\bin +PATHEXT = %PATHEXT%;.PY;.PYW +QMAKESPEC = win32-g++ +QT4DIR = %ProgramFiles%\Qt\4.2.2 + +You may also set PYTHONPATH to the root of pyMoul/src: +PYTHONPATH = %PYTHONPATH%;%USERPROFILE%\My Documents\dev\pymoul\src + +Source installation of sip, PyQt4 and QScintilla2 +------------------------------------------------- + + * Install Qt4 GPL + MinGW32 as described + + * Adust the environment variables as described + + * Download the following packages and unzip them to C:\tmp\ or another + folder without (!) spaces or special character. + + o sip 4.5+ http://www.riverbankcomputing.co.uk/sip/index.php + o QScintilla2 snapshot http://www.riverbankcomputing.com/Downloads/Snapshots/QScintilla2/ + o PyQt4-win-gpl-4.X (not binary) http://www.riverbankcomputing.co.uk/pyqt/download.php + + * Compile and install sip with: + + o c:\tmp\sip...>python configure.py -p win32-g++ + o c:\tmp\sip...>mingw32-make + o c:\tmp\sip...>mingw32-make install + + * Compile and install QScintilla2 for Qt4 + + o c:\tmp\QScintilla2...\Qt4>qmake qscintilla.pro + o c:\tmp\QScintilla2...\Qt4>mingw32-make + o c:\tmp\QScintilla2...\Qt4>mingw32-make install + + * Compile and install PyQt4 + + o c:\tmp\PyQt4...>python configure.py + o c:\tmp\PyQt4...\Qt4>mingw32-make + o c:\tmp\PyQt4...\Qt4>mingw32-make install + + * Install QScintilla2 for Python + + o c:\tmp\QScintilla2...\Python>python configure.py + o c:\tmp\QScintilla2...\Python>mingw32-make + o c:\tmp\QScintilla2...\Python>mingw32-make install + + py2exe error -============ +------------ If you are getting an AttributeError on zlib_file.read() replace py2exe's build_exe.py with misc/build_exe.py. The file is located somewhere in Python25\Lib\site-packages\py2exe\ + +================== +Linux Installation +================== + +For Ubuntu and Debian. SuSE, RedHat and Mac OS X should work similar + +NOTE: The latest version of Ubuntu has no support for Qt4 under Python2.5. + You have to compile the stuff on your own. + + * Install Python 2.5 with development packages + + o sudo apt-get install python2.5 python2.5-dev + + * Install Qt4 with development packages + + o sudo apt-get install libqt4 libqt4-dev qt4-designer qt4-dev-tools qt4-doc + + * Download and unpack sip, PyQt4 and QScintilla2 snapshot + + o sip 4.5+ http://www.riverbankcomputing.co.uk/sip/index.php + o QScintilla2 snapshot http://www.riverbankcomputing.com/Downloads/Snapshots/QScintilla2/ + o PyQt4-x11-gpl-4.X http://www.riverbankcomputing.co.uk/pyqt/download.php + + * compile and install sip + + o $ cd sip-XXX + o $ python2.5 configure.py && make + o $ sudo make install + + * The current make install command is buggy. You have to adjust the + permissions of all installed files manually. I recommand to run the + following command line after each install step. a+rX means all users + readable, all users directory executable + + o sudo chmod a+rx /usr/bin/sip + o sudo chmod -R a+rX /usr/lib/python2.5/ /usr/include/python2.5 \ + /usr/include/qt4 /usr/share/qt4/ /usr/share/sip/ + + * Install QScintilla for Qt4 + + o $ cd QScintilla.../Qt4 + o $ qmake-qt4 + o $ make + o $ sudo make install + o Adjust permissions + + * Install PyQt4 + + o $ cd PyQt4-x11-gpl... + o $ python2.5 configure.py -q /usr/bin/qmake-qt4 + o $ make + o $ sudo make install + o Adjust permissions + + * Install QScintilla2 for Python + + o $ cd QScintilla.../Python + o $ python2.5 configure.py + o $ make + o $ make install + o Adjust permissions + + + Deleted: pymoul/trunk/README.qt.txt =================================================================== --- pymoul/trunk/README.qt.txt 2007-01-19 16:32:53 UTC (rev 51) +++ pymoul/trunk/README.qt.txt 2007-01-20 15:28:50 UTC (rev 52) @@ -1,35 +0,0 @@ -Installation ------------- - - * Download Qt/Windows Open Source Edition from - http://www.trolltech.com/developer/downloads/qt/index - * Download PyQT4 GPL from http://www.riverbankcomputing.co.uk/pyqt/ - * Install QT4 + MinGW. I suggest installing both to C:\Program Files instead - of C:\ (C:\Programme or whatever your program files folder is) - * Install PyQT4 - * Download and install elementtree http://effbot.org/downloads/#elementtree - or use the "easy_install elementtree" command -http://www.riverbankcomputing.com/Downloads/PyQt4/GPL/PyQt-gpl-4.1.1-Py2.5-Qt4.2.2.exe -http://wftp.tu-chemnitz.de/pub/Qt/qt/source/qt-win-opensource-4.2.2-mingw.exe - -Adjust your environment for Qt/PyQt ------------------------------------ - -You have to create / adjust some environment variables in order to make -Qt and PyQt work well. I had to create the variables manually. The article at -http://vlaurie.com/computers2/Articles/environment.htm#editing explains how -to set user specific env vars. - -PATH = %PATH%;%ProgramFiles%\Python25;%ProgramFiles%\Python25\Scripts;%ProgramFiles%\Qt\4.2.2\bin;%ProgramFiles%\MinGW\bin -PATHEXT = %PATHEXT%;.PY;.PYW -QMAKESPEC = win32-g++ -QTDIR = %ProgramFiles%\Qt\4.2.2 - -You may also set PYTHONPATH to the root of pyMoul/src: -PYTHONPATH = %PYTHONPATH%;%USERPROFILE%\My Documents\dev\pymoul\src - -Notes (do not install) ----------------------- - -http://effbot.org/downloads/#cElementTree -python setup.py build -c mingw32 install \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ti...@us...> - 2007-01-20 20:00:57
|
Revision: 54 http://pymoul.svn.sourceforge.net/pymoul/?rev=54&view=rev Author: tiran Date: 2007-01-20 12:00:57 -0800 (Sat, 20 Jan 2007) Log Message: ----------- Removed stupid tabs Modified Paths: -------------- pymoul/trunk/GPL.txt pymoul/trunk/src/moul/file/kiimage.py pymoul/trunk/src/moul/file/localization.py pymoul/trunk/src/moul/file/tests/test_kiimage.py Modified: pymoul/trunk/GPL.txt =================================================================== --- pymoul/trunk/GPL.txt 2007-01-20 16:32:00 UTC (rev 53) +++ pymoul/trunk/GPL.txt 2007-01-20 20:00:57 UTC (rev 54) @@ -1,12 +1,12 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 Copyright (C) 1989, 1990, 1991, 1992 Free Software Foundation, Inc. 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. - Preamble + Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public @@ -56,7 +56,7 @@ The precise terms and conditions for copying, distribution and modification follow. - GNU GENERAL PUBLIC LICENSE + GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains @@ -255,7 +255,7 @@ of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. - NO WARRANTY + NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN @@ -277,9 +277,9 @@ PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - END OF TERMS AND CONDITIONS + END OF TERMS AND CONDITIONS - Appendix: How to Apply These Terms to Your New Programs + Appendix: How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it Modified: pymoul/trunk/src/moul/file/kiimage.py =================================================================== --- pymoul/trunk/src/moul/file/kiimage.py 2007-01-20 16:32:00 UTC (rev 53) +++ pymoul/trunk/src/moul/file/kiimage.py 2007-01-20 20:00:57 UTC (rev 54) @@ -27,6 +27,9 @@ JPEG_HEADER = "\377\330\377" +class KiImageError(ValueError): + pass + class KiImage(object): """Ki image handler @@ -36,15 +39,15 @@ def __init__(self, fd_name): if isinstance(fd_name, basestring): - name = fd_name - fd = open(fd_name, 'rb') + name = fd_name + fd = open(fd_name, 'rb') else: - name = getattr(fd_name, 'name', '<UNKNOWN>') - fd = fd_name - + name = getattr(fd_name, 'name', '<UNKNOWN>') + fd = fd_name + self._filename = name self._fd = fd - self._size = None + self._size = None def close(self): if self._fd: @@ -53,7 +56,7 @@ def getSize(self): if self._size is not None: - return self._size + return self._size fd = self._fd opos = fd.tell() size = 0 @@ -62,15 +65,15 @@ size = fd.tell() finally: fd.seek(opos) - self._size = size + self._size = size return size def moulHeaderToSize(self, header=None): # XXX use struct if header is None: - fd = self._fd - fd.seek(0) - header = fd.read(4) + fd = self._fd + fd.seek(0) + header = fd.read(4) size = 0 for i, l in enumerate(header): size += ord(l) << 8*i @@ -79,7 +82,7 @@ def sizeToMoulHeader(self, size=None): # XXX use struct if size is None: - size = self.getSize() + 4 # XXX +4 ? + size = self.getSize() leading = 4* [None] for i in (3,2,1,0): l = size >> 8*i @@ -113,18 +116,19 @@ def removeMoulHeader(self): if not self.isMoulImage(): - raise ValueError('Image has no MOUL header') + raise KiImageError('Image has no MOUL header') out = tempfile.TemporaryFile() fd = self._fd fd.seek(4) out.write(fd.read()) + out.seek(0) return out def addMoulHeader(self): if self.isMoulImage(): - raise ValueError('Image has already a MOUL header') + raise KiImageError('Image has already a MOUL header') if not self.isJpeg(): - raise ValueError('File is not a JPEG') + raise KiImageError('File is not a JPEG') out = tempfile.TemporaryFile() header = self.sizeToMoulHeader() fd = self._fd @@ -132,4 +136,5 @@ out.write(header) fd.seek(0) out.write(fd.read()) + out.seek(0) return out Modified: pymoul/trunk/src/moul/file/localization.py =================================================================== --- pymoul/trunk/src/moul/file/localization.py 2007-01-20 16:32:00 UTC (rev 53) +++ pymoul/trunk/src/moul/file/localization.py 2007-01-20 20:00:57 UTC (rev 54) @@ -36,12 +36,22 @@ from moul.config import getMoulDir from moul.log import LOG +def _add(d, key, value): + lst = d.setdefault(key, []) + lst.append(value) + class TranslationRegistry(dict): """Registry for Translation objects""" + __slot__ = ('_bylanguage', '_byage', '_byset', '_byelement') + def __new__(cls, *args, **kwargs): - inst = dict.__new__(cls, *args, **kwargs) - return inst + self = dict.__new__(cls, *args, **kwargs) + self._bylanguage = {} + self._byage = {} + self._byset = {} + self._byelement = {} + return self def register(self, translation): key = translation.key() @@ -50,6 +60,10 @@ (translation.fname, str(key))) LOG.error("TranslationRegistry: %s" % msg) raise KeyError(msg) + _add(self._bylanguage, translation.language, key) + _add(self._byage, translation.age, key) + _add(self._byset, translation.set, key) + _add(self._byelement, translation.element, key) self[key] = translation def __setitem__(self, key, translation): @@ -59,24 +73,34 @@ translationRegistry = TranslationRegistry() registerTranslation = translationRegistry.register -class Translation(object): - """Translation object""" +class Translation(unicode): + """Translation object - def __init__(self, age, set, element, language, content, fname=''): + >>> Translation(u"earth", u"journal", u"mybook", u"english", u"text", "file") + u'text' + """ + __slots__ = ('_age', '_set', '_element', '_language', '_fname') + + def __new__(cls, age, set, element, language, content, fname=''): + self = unicode.__new__(cls, content) for attr in age, set, element, language: assert attr - self.age = age - self.set = set - self.element = element - self.language = language - self.content = content - - self.fname = fname + self._age = age + self._set = set + self._element = element + self._language = language LOG.debug("New translation file(%s): %s" % (fname, self.key)) + return self def key(self): - return (self.age, self.set, self.element, self.language) + return (self._age, self._set, self._element, self._language) + @property + def language(self): return self._language + + @property + def age(self): return self._age + def __str__(self): return self.content Modified: pymoul/trunk/src/moul/file/tests/test_kiimage.py =================================================================== --- pymoul/trunk/src/moul/file/tests/test_kiimage.py 2007-01-20 16:32:00 UTC (rev 53) +++ pymoul/trunk/src/moul/file/tests/test_kiimage.py 2007-01-20 20:00:57 UTC (rev 54) @@ -27,6 +27,8 @@ from doctest import DocTestSuite from moul.file.kiimage import KiImage +from moul.file.kiimage import KiImageError +from moul.file.kiimage import JPEG_HEADER base = os.path.dirname(__file__) kiimg = os.path.join(base, 'avatar.jpg') @@ -36,7 +38,7 @@ def setUp(self): self._ki = open(kiimg, 'rb') - self._clean = open(kiclean, 'rb') + self._clean = open(kiclean, 'rb') def tearDown(self): self._ki.close() @@ -44,23 +46,44 @@ def test_openname(self): k = KiImage(kiimg) - self.failUnless(k.isMoulImage()) - self.failIf(k.isJpeg()) - - k = KiImage(kiclean) - self.failIf(k.isMoulImage()) - self.failUnless(k.isJpeg()) + self.failUnless(k.verifyMoulHeader()) + self.failUnless(k.isMoulImage()) + self.failIf(k.isJpeg()) + + k = KiImage(kiclean) + self.failIf(k.verifyMoulHeader()) + self.failIf(k.isMoulImage()) + self.failUnless(k.isJpeg()) def test_openfd(self): k = KiImage(self._ki) - self.failUnless(k.isMoulImage()) - self.failIf(k.isJpeg()) - - k = KiImage(self._clean) - self.failIf(k.isMoulImage()) - self.failUnless(k.isJpeg()) + self.failUnless(k.verifyMoulHeader()) + self.failUnless(k.isMoulImage()) + self.failIf(k.isJpeg()) + + k = KiImage(self._clean) + self.failIf(k.verifyMoulHeader()) + self.failIf(k.isMoulImage()) + self.failUnless(k.isJpeg()) - + def test_removeheader(self): + k = KiImage(self._ki) + fd = k.removeMoulHeader() + data = fd.read() + cleandata = self._clean.read() + self.failUnlessEqual(len(data), len(cleandata)) + self.failUnlessEqual(data, cleandata, + "file mismatch %r:%r" % (data[:8], cleandata[:8])) + + def test_addheader(self): + k = KiImage(self._clean) + fd = k.addMoulHeader() + data = fd.read() + kidata = self._ki.read() + self.failUnlessEqual(len(data), len(kidata)) + self.failUnlessEqual(data, kidata, + "file mismatch %r:%r" % (data[:8], kidata[:8])) + def test_suite(): return unittest.TestSuite(( unittest.makeSuite(KiImageTest), This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ti...@us...> - 2007-01-23 11:06:59
|
Revision: 58 http://pymoul.svn.sourceforge.net/pymoul/?rev=58&view=rev Author: tiran Date: 2007-01-23 03:06:58 -0800 (Tue, 23 Jan 2007) Log Message: ----------- Renamed misc to contrib Added distutils_upx file with UpxCommand class Fixed typo in config.darwin Added epydoc support doc Makefile Modified Paths: -------------- pymoul/trunk/Makefile pymoul/trunk/setup.py pymoul/trunk/setup_win32.py pymoul/trunk/src/moul/config/darwin.py Added Paths: ----------- pymoul/trunk/contrib/ pymoul/trunk/distutils_upx.py pymoul/trunk/doc/ Removed Paths: ------------- pymoul/trunk/misc/ Modified: pymoul/trunk/Makefile =================================================================== --- pymoul/trunk/Makefile 2007-01-22 19:09:49 UTC (rev 57) +++ pymoul/trunk/Makefile 2007-01-23 11:06:58 UTC (rev 58) @@ -1,4 +1,5 @@ -PYTHON?=python2.5 +PYTHON?=python +EPYDOC=$(PYTHON) -c "import epydoc.cli; epydoc.cli.cli()" TESTFLAGS=-v TESTOPTS= SETUPFLAGS= @@ -7,16 +8,16 @@ # Build in-place inplace: - $(PYTHON) setup.py $(SETUPFLAGS) build_ext -i + PYTHONPATH="src" $(PYTHON) setup.py $(SETUPFLAGS) build_ext -i build: compileui - $(PYTHON) setup.py $(SETUPFLAGS) build + PYTHONPATH="src" $(PYTHON) setup.py $(SETUPFLAGS) build py2exe: - $(PYTHON) setup.py $(SETUPFLAGS) py2exe + PYTHONPATH="src" $(PYTHON) setup.py $(SETUPFLAGS) py2exe bdist_egg: - $(PYTHON) setup.py $(SETUPFLAGS) bdist_egg + PYTHONPATH="src" $(PYTHON) setup.py $(SETUPFLAGS) bdist_egg run: compileui PYTHONPATH="src" $(PYTHON) src/moul/qt/moulqt.py @@ -30,6 +31,9 @@ test_inplace: compileui PYTHONPATH="src" $(PYTHON) test.py $(TESTFLAGS) $(TESTOPTS) +doc_html: + PYTHONPATH="src" $(EPYDOC) -v --html --output="doc/html" moul + # What should the default be? test: test_inplace Copied: pymoul/trunk/contrib (from rev 57, pymoul/trunk/misc) Added: pymoul/trunk/distutils_upx.py =================================================================== --- pymoul/trunk/distutils_upx.py (rev 0) +++ pymoul/trunk/distutils_upx.py 2007-01-23 11:06:58 UTC (rev 58) @@ -0,0 +1,130 @@ +"""Patched distutils Command +""" +__author__ = "Christian Heimes" +__version__ = "$Id" +__revision__ = "$Revision$" + +import os +import sys +from inspect import getmro +from tempfile import TemporaryFile +from subprocess import call +from distutils import log +from stat import ST_SIZE + +def inEnvPath(name): + result = [] + for path in os.environ['PATH'].split(';'): + upx = os.path.join(path, name) + if os.path.isfile(upx): + result.append(upx) + if result: + return result[0] + +def _call(cmd, silent=False, *args, **kwargs): + """Call silently - redirect stdout to dump + """ + data = None + if silent: + stdout = TemporaryFile() + else: + stdout = None + try: + retcode = call(cmd, stdout=stdout, *args, **kwargs) + finally: + if stdout: + data = stdout.read() + stdout.close() + return retcode, data + +def _has_upx(upx): + """Search for UPX in search path + """ + try: + retcode, stdout = _call("%s --version" % upx, silent=True) + except OSError: + log.debug('UPX not found') + return False + else: + if retcode == 0: + log.debug('UPX found') + return True + else: + log.debug('UPX: an error occured %i' % retcode) + return False + +def _upx_compress(upx, args, fname): + """Check file + """ + retcode, stdout = _call('upx %s "%s"' % (args, fname), silent=False) + if retcode == 0: # file packed + pass + elif retcode == 2: # file already packed + pass + else: # something bad has happend + sys.exit(retcode) + +def otherclass(mycls): + for cls in getmro(mycls): + if not issubclass(cls, UpxCommand): + return cls + raise ValueError(mycls) + +class UpxCommand: + def initialize_options(self): + result = otherclass(self.__class__).initialize_options(self) + self.upx = True + self.upx_args = '--no-color --best' + self.upx_path = 'upx' + self.upx_extensions = ( + 'pyd', 'dll', 'exe', # Windows + '', 'so', # Linux + 'dylib', # Mac OS X + ) + return result + + def finalize_options(self): + result = otherclass(self.__class__).finalize_options(self) + self.has_upx = _has_upx(self.upx_path) + self.upx_packed = [] + return result + + def copy_file(self, *args, **kwargs): + # Override to UPX copied binaries. + result = otherclass(self.__class__).copy_file(self, *args, **kwargs) + self._upx_compress(result) + return result + + def _upx_compress(self, result): + fname, copied = result + if not self.has_upx or not self.upx or not copied: + return + + basename = os.path.basename(fname) + tmp, ext = os.path.splitext(basename) + ext = ext[1:] # strip leading dot + origsize = os.stat(fname)[ST_SIZE] + if ext in self.upx_extensions: + _upx_compress(self.upx_path, self.upx_args, os.path.normpath(fname)) + newsize = os.stat(fname)[ST_SIZE] + ratio = newsize*100 / origsize + self.upx_packed.append((basename, origsize, newsize, ratio)) + return result + + def run(self, *args, **kwargs): + result = otherclass(self.__class__).run(self, *args, **kwargs) + if self.has_upx and self.upx: + print "\n*** UPX result ***" + for basename, origsize, newsize, ratio in self.upx_packed: + print " %s packed to %i%%" % (basename, ratio) + print "\n" + return result + + +try: + from py2exe.build_exe import py2exe +except ImportError: + pass +else: + class UpxPy2exe(UpxCommand, py2exe): + pass Property changes on: pymoul/trunk/distutils_upx.py ___________________________________________________________________ Name: svn:eol-style + native Property changes on: pymoul/trunk/doc ___________________________________________________________________ Name: svn:ignore + html Modified: pymoul/trunk/setup.py =================================================================== --- pymoul/trunk/setup.py 2007-01-22 19:09:49 UTC (rev 57) +++ pymoul/trunk/setup.py 2007-01-23 11:06:58 UTC (rev 58) @@ -23,6 +23,7 @@ # import the rest from setuptools import setup from setuptools import find_packages + from compileui import compileUi VERSION = "0.0" @@ -93,14 +94,9 @@ if sys.platform.startswith('win32'): from setup_win32 import updateSetupOptions from setup_win32 import updateSetupOptionsQT - from setup_win32 import upxPack updateSetupOptions(kwargs) updateSetupOptionsQT(kwargs) elif sys.platform.startswith('linux2'): kwargs['packages'].append('moul.qt') setup(**kwargs) - -if sys.platform.startswith('win') and 'py2exe' in sys.argv: - pass - upxPack('dist') Modified: pymoul/trunk/setup_win32.py =================================================================== --- pymoul/trunk/setup_win32.py 2007-01-22 19:09:49 UTC (rev 57) +++ pymoul/trunk/setup_win32.py 2007-01-23 11:06:58 UTC (rev 58) @@ -12,8 +12,11 @@ import py2exe except ImportError: print >>sys.stderr, "py2exe missing, unable to create executables" + cmdclass = {} else: # If run without args, build executables, in quiet mode. + from distutils_upx import UpxPy2exe + cmdclass = {'py2exe': UpxPy2exe} if len(sys.argv) == 1: sys.argv.append("py2exe") @@ -50,31 +53,8 @@ # packages = ['pytz.%s.*' % pack for pack in packages] # return packages -def inEnvPath(name): - result = [] - for path in os.environ['PATH'].split(';'): - upx = os.path.join(path, name) - if os.path.isfile(upx): - result.append(upx) - if result: - return result[0] - -def upxPack(dst): - """Pack PE executables with UPX http://upx.sourceforge.net/ - - UPX can shrink dll, exe and pyd files 50 to 70% without disadvantage - """ - if not inEnvPath('upx.exe'): - print >>sys.stderr, "UPX not available - skipping" - upx_pack = [] - for root, dirs, files in os.walk(dst): - for file in files: - if file[-4:] in ('.pyd', '.dll', '.exe'): - upx_pack.append(os.path.join(root, file)) - # --best --all-methods --all-filters - os.system("upx -q --mono %s" % ' '.join(upx_pack)) - def updateSetupOptions(kw): + kw['cmdclass'] = cmdclass for req in ("py2exe >=0.6.5",): kw['setup_requires'].append(req) for req in (): Modified: pymoul/trunk/src/moul/config/darwin.py =================================================================== --- pymoul/trunk/src/moul/config/darwin.py 2007-01-22 19:09:49 UTC (rev 57) +++ pymoul/trunk/src/moul/config/darwin.py 2007-01-23 11:06:58 UTC (rev 58) @@ -30,7 +30,7 @@ MOUL_DIR = "Uru Live" INI_FILE = ('pyMoul', 'pymoul.ini') EXEC_NAME = "UruLauncher" -HOME = os.environ('HOME') +HOME = os.environ['HOME'] def getMoulUserDataDir(): """Get path of MOUL data directory This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ti...@us...> - 2007-01-23 22:52:09
|
Revision: 62 http://pymoul.svn.sourceforge.net/pymoul/?rev=62&view=rev Author: tiran Date: 2007-01-23 14:52:09 -0800 (Tue, 23 Jan 2007) Log Message: ----------- Cleaned up distutils_upx code Added support for InnoSetup installer Modified Paths: -------------- pymoul/trunk/INSTALL.txt pymoul/trunk/Makefile pymoul/trunk/distutils_upx.py pymoul/trunk/setup_win32.py Modified: pymoul/trunk/INSTALL.txt =================================================================== --- pymoul/trunk/INSTALL.txt 2007-01-23 17:51:37 UTC (rev 61) +++ pymoul/trunk/INSTALL.txt 2007-01-23 22:52:09 UTC (rev 62) @@ -20,6 +20,7 @@ ----- * UPX http://upx.sourceforge.net/#download + * InnoSetup http://www.jrsoftware.org/ ==================== Windows Installation Modified: pymoul/trunk/Makefile =================================================================== --- pymoul/trunk/Makefile 2007-01-23 17:51:37 UTC (rev 61) +++ pymoul/trunk/Makefile 2007-01-23 22:52:09 UTC (rev 62) @@ -41,6 +41,8 @@ egg: bdist_egg +doc: doc_html + clean: find . \( -name '*.o' -o -name '*.c' -o -name '*.so' -o -name '*.py[cod]' -o -name '*.dll' \) -exec rm -f {} \; rm -rf build Modified: pymoul/trunk/distutils_upx.py =================================================================== --- pymoul/trunk/distutils_upx.py 2007-01-23 17:51:37 UTC (rev 61) +++ pymoul/trunk/distutils_upx.py 2007-01-23 22:52:09 UTC (rev 62) @@ -13,22 +13,6 @@ from stat import ST_SIZE from fnmatch import fnmatch -def _call(cmd, silent=False, *args, **kwargs): - """Call silently - redirect stdout to dump - """ - data = None - if silent: - stdout = TemporaryFile() - else: - stdout = None - try: - retcode = subcall(cmd, stdout=stdout, *args, **kwargs) - finally: - if stdout: - data = stdout.read() - stdout.close() - return retcode, data - class UpxCommand: """Upx packer mixin class for distutils @@ -52,7 +36,7 @@ def initialize_options(self): result = self._otherclass().initialize_options(self) self.upx = True - self.upx_args = '--no-color --best' + self.upx_args = '--no-color' self.upx_path = 'upx' self.upx_extensions = [ 'pyd', 'dll', 'exe', # Windows @@ -60,6 +44,10 @@ 'dylib', # Mac OS X ] self.upx_ignore = [] + + self.app_name = '' + self.innosetup = False + return result def finalize_options(self): @@ -69,7 +57,6 @@ return result def copy_file(self, *args, **kwargs): - # Override to UPX copied binaries. result = self._otherclass().copy_file(self, *args, **kwargs) self.upx_packlist.append(result) return result @@ -77,9 +64,16 @@ def run(self, *args, **kwargs): result = self._otherclass().run(self, *args, **kwargs) self._upxPack() + self._createInnoSetup() return result def _upxPack(self): + """Pack files + + At last pack the files. I had some hard to debug errors as I tried to + pack the files inside the copy_file() method. Some dll and exe files + were broken. Perhaps some file handlers weren't closed? + """ if not self.has_upx or not self.upx: return @@ -116,7 +110,7 @@ def _upxPackFile(self, fname): """Pack a file """ - retcode, stdout = _call('%s %s "%s"' % (self.upx_path, self.upx_args, fname), silent=False) + retcode = subcall('%s %s "%s"' % (self.upx_path, self.upx_args, fname)) if retcode == 0: # OK, file packed pass elif retcode == 2: # OK, file already packed @@ -127,8 +121,13 @@ def _upxAvailable(self): """Search for UPX in search path """ + stdout = TemporaryFile() try: - retcode, stdout = _call("%s --version" % self.upx_path, silent=True) + try: + retcode = subcall("%s --version" % self.upx_path, stdout=stdout) + finally: + if stdout: + stdout.close() except OSError: log.debug('UPX not found') return False @@ -151,7 +150,99 @@ return c raise ValueError(cls) + def _createInnoSetup(self): + if not self.innosetup: + return + script = InnoScript(self.app_name, + self.lib_dir, + self.dist_dir, + self.windows_exe_files, + self.lib_files) + print "*** creating the inno setup script***" + script.create() + print "*** compiling the inno setup script***" + try: + script.compile() + except RuntimeError, msg: + print "Failed to create installer:\n%s" % msg + # Note: By default the final setup.exe will be in an Output subdirectory. + +class InnoScript: + """Based on py2exe/samples/extending/setup.py + + Requires http://www.jrsoftware.org + """ + def __init__(self, + name, + lib_dir, + dist_dir, + windows_exe_files = [], + lib_files = [], + version = "1.0"): + self.lib_dir = lib_dir + self.dist_dir = dist_dir + if not self.dist_dir[-1] in "\\/": + self.dist_dir += "\\" + self.name = name + self.version = version + self.windows_exe_files = [self.chop(p) for p in windows_exe_files] + self.lib_files = [self.chop(p) for p in lib_files] + + def chop(self, pathname): + assert pathname.startswith(self.dist_dir) + return pathname[len(self.dist_dir):] + + def create(self, pathname="dist\\test_wx.iss"): + self.pathname = pathname + ofi = self.file = open(pathname, "w") + print >> ofi, "; WARNING: This script has been created by py2exe. Changes to this script" + print >> ofi, "; will be overwritten the next time py2exe is run!" + print >> ofi, r"[Setup]" + print >> ofi, r"AppName=%s" % self.name + print >> ofi, r"AppVerName=%s %s" % (self.name, self.version) + print >> ofi, r"DefaultDirName={pf}\%s" % self.name + print >> ofi, r"DefaultGroupName=%s" % self.name + print >> ofi + + print >> ofi, r"[Files]" + for path in self.windows_exe_files + self.lib_files: + print >> ofi, r'Source: "%s"; DestDir: "{app}\%s"; Flags: ignoreversion' % (path, os.path.dirname(path)) + print >> ofi + + print >> ofi, r"[Icons]" + for path in self.windows_exe_files: + print >> ofi, r'Name: "{group}\%s"; Filename: "{app}\%s"' % \ + (self.name, path) + print >> ofi, 'Name: "{group}\Uninstall %s"; Filename: "{uninstallexe}"' % self.name + + def compile(self): + try: + import ctypes + except ImportError: + try: + import win32api + except ImportError: + import os + os.startfile(self.pathname) + else: + #print "Ok, using win32api." + win32api.ShellExecute(0, "compile", + self.pathname, + None, + None, + 0) + else: + #print "Cool, you have ctypes installed." + res = ctypes.windll.shell32.ShellExecuteA(0, "compile", + self.pathname, + None, + None, + 0) + if res < 32: + raise RuntimeError("ShellExecute failed, error %d" % res) + + try: from py2exe.build_exe import py2exe except ImportError: @@ -159,4 +250,3 @@ else: class UpxPy2exe(UpxCommand, py2exe): pass - Modified: pymoul/trunk/setup_win32.py =================================================================== --- pymoul/trunk/setup_win32.py 2007-01-23 17:51:37 UTC (rev 61) +++ pymoul/trunk/setup_win32.py 2007-01-23 22:52:09 UTC (rev 62) @@ -69,6 +69,12 @@ pexe['compressed'] = 100 # compress zip file pexe['optimize'] = 0 # 0,1,2 pexe['includes'] = ['sip', 'PyQt4', 'encodings', 'encodings.*'] + # UPX + pexe['upx'] = True + pexe['upx_args'] = '--mono --best' + # InnoSetup + pexe['innosetup'] = True + pexe['app_name'] = 'pyMoul' # not required at the moment pexe['includes'].extend(findPyTz()) kw['zipfile'] = 'library.zip' This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ti...@us...> - 2007-01-25 04:05:26
|
Revision: 73 http://pymoul.svn.sourceforge.net/pymoul/?rev=73&view=rev Author: tiran Date: 2007-01-24 20:05:27 -0800 (Wed, 24 Jan 2007) Log Message: ----------- Log some version infos Modified Paths: -------------- pymoul/trunk/INSTALL.txt pymoul/trunk/src/moul/config/__init__.py pymoul/trunk/src/moul/log.py pymoul/trunk/src/moul/qt/__init__.py Modified: pymoul/trunk/INSTALL.txt =================================================================== --- pymoul/trunk/INSTALL.txt 2007-01-24 23:17:08 UTC (rev 72) +++ pymoul/trunk/INSTALL.txt 2007-01-25 04:05:27 UTC (rev 73) @@ -165,7 +165,7 @@ o $ cd QScintilla.../Python o $ python2.5 configure.py o $ make - o $ make install + o $ sudo make install o Adjust permissions Modified: pymoul/trunk/src/moul/config/__init__.py =================================================================== --- pymoul/trunk/src/moul/config/__init__.py 2007-01-24 23:17:08 UTC (rev 72) +++ pymoul/trunk/src/moul/config/__init__.py 2007-01-25 04:05:27 UTC (rev 73) @@ -20,6 +20,8 @@ import os import sys +from moul.log import LOG + # a program under py2exe is sys.frozen __FROZEN__ = bool(getattr(sys, 'frozen', False)) # OS stuff @@ -28,6 +30,10 @@ __MACOSX__ = sys.platform.startswith('darwin') __UNIX__ = __LINUX__ or __MACOSX__ +LOG.debug("sys.frozen status: %s" % __FROZEN__) +LOG.debug("OS detected: win32: %s, Linux: %s, Mac: %s, Un*x: %s" % + (__WIN32__, __LINUX__, __MACOSX__, __UNIX__)) + _marker=object() # XXX: what about cygwin, bsd and others? if __WIN32__: Modified: pymoul/trunk/src/moul/log.py =================================================================== --- pymoul/trunk/src/moul/log.py 2007-01-24 23:17:08 UTC (rev 72) +++ pymoul/trunk/src/moul/log.py 2007-01-25 04:05:27 UTC (rev 73) @@ -24,7 +24,9 @@ __all__ = ['LOG', 'getLogger', 'signalLogDecorator'] import logging +import os import sys +from moul.metadata import __version__ as moul_version # copied from moul.config to prevent circular imports __FROZEN__ = bool(getattr(sys, 'frozen', False)) @@ -36,8 +38,9 @@ level = logging.DEBUG logging.basicConfig(level=level, - format='%(asctime)s %(levelname)-8s %(message)s', - datefmt='%a, %d %b %Y %H:%M:%S' + format='%(asctime)s %(name)-10s %(levelname)-7s %(message)s', + #datefmt='%a, %d %b %Y %H:%M:%S' + datefmt='%m-%d %H:%M:%S' ) LOG = logging.getLogger('pyMoul') getLogger = logging.getLogger @@ -62,3 +65,10 @@ else: return func return wrapper + +# DEBUG system infos +LOG.debug("pyMoul version: %s" % moul_version) +LOG.debug("Python: %s" % repr(sys.version_info)) +LOG.debug("Python: %s" % sys.version.replace('\n', ' ')) +LOG.debug("Platform: %s, OS name: %s" % (sys.platform, os.name)) + Modified: pymoul/trunk/src/moul/qt/__init__.py =================================================================== --- pymoul/trunk/src/moul/qt/__init__.py 2007-01-24 23:17:08 UTC (rev 72) +++ pymoul/trunk/src/moul/qt/__init__.py 2007-01-25 04:05:27 UTC (rev 73) @@ -20,3 +20,11 @@ __author__ = "Christian Heimes" __version__ = "$Id$" __revision__ = "$Revision$" + +import PyQt4.QtCore + +from moul.log import LOG + +# DEBUG system infos +LOG.debug("PyQt: %s" % PyQt4.QtCore.PYQT_VERSION_STR) + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ti...@us...> - 2007-01-25 15:25:34
|
Revision: 76 http://pymoul.svn.sourceforge.net/pymoul/?rev=76&view=rev Author: tiran Date: 2007-01-25 07:25:33 -0800 (Thu, 25 Jan 2007) Log Message: ----------- Some logging and Makefile tweaks. Redirect stdout/stderr if sys.frozen Modified Paths: -------------- pymoul/trunk/Makefile pymoul/trunk/setup_win32.py pymoul/trunk/src/moul/log.py Modified: pymoul/trunk/Makefile =================================================================== --- pymoul/trunk/Makefile 2007-01-25 14:21:20 UTC (rev 75) +++ pymoul/trunk/Makefile 2007-01-25 15:25:33 UTC (rev 76) @@ -16,12 +16,18 @@ py2exe: PYTHONPATH="src" $(PYTHON) setup.py $(SETUPFLAGS) py2exe +innosetup: + PYTHONPATH="src" INNOSETUP="yes" $(PYTHON) setup.py $(SETUPFLAGS) py2exe + bdist_egg: PYTHONPATH="src" $(PYTHON) setup.py $(SETUPFLAGS) bdist_egg run: compileui PYTHONPATH="src" $(PYTHON) src/moul/qt/moulqt.py +runexe: compileui py2exe + dist/moulqt.exe + compileui: $(PYTHON) compileui.py @@ -39,6 +45,8 @@ exe: py2exe +installer: innosetup + egg: bdist_egg doc: doc_html Modified: pymoul/trunk/setup_win32.py =================================================================== --- pymoul/trunk/setup_win32.py 2007-01-25 14:21:20 UTC (rev 75) +++ pymoul/trunk/setup_win32.py 2007-01-25 15:25:33 UTC (rev 76) @@ -71,11 +71,15 @@ pexe['includes'] = ['sip', 'PyQt4', 'encodings', 'encodings.*'] # SSL currently not in use but imported by socket pexe['excludes'] = ['_ssl'] + # added by platform but not yet required + pexe['excludes'].extend(('win32pipe', 'win32api', 'win32con', 'win32evtlog')) + # added by logging.handlers.SMTPHandler but not yet required + pexe['excludes'].append('smtplib') # UPX pexe['upx'] = True pexe['upx_args'] = '--mono --best' # InnoSetup - pexe['innosetup'] = True + pexe['innosetup'] = os.environ.get('INNOSETUP') # TODO: pexe['app_name'] = 'pyMoul' # not required at the moment pexe['includes'].extend(findPyTz()) Modified: pymoul/trunk/src/moul/log.py =================================================================== --- pymoul/trunk/src/moul/log.py 2007-01-25 14:21:20 UTC (rev 75) +++ pymoul/trunk/src/moul/log.py 2007-01-25 15:25:33 UTC (rev 76) @@ -37,30 +37,46 @@ # copied from moul.config to prevent circular imports __FROZEN__ = bool(getattr(sys, 'frozen', False)) __LOG_SIGNALS__ = not __FROZEN__ -if __FROZEN__: - level = logging.ERROR -else: - level = logging.DEBUG +class LoggingStdout(object): + """Replacement for stdout/stderr IO + """ + __slot__ = ('_logfunc',) + + def __init__(self, logfunc): + self._logfunc = logfunc + + def write(self, value): + while value.endswith('\n'): + value = value[:-1] + if value: + self._logfunc(value) + format = logging.Formatter('%(asctime)s %(name)-8s %(levelname)-7s %(message)s', #'%a, %d %b %Y %H:%M:%S' '%m-%d %H:%M:%S') root = getLogger() -root.setLevel(level) +root.setLevel(logging.DEBUG) -# Add streaming handler for sys.stderr -shdlr = logging.StreamHandler(sys.stderr) -shdlr.setFormatter(format) -shdlr.setLevel(level) -root.addHandler(shdlr) - # setup a memory handler to store records before we have the infrastructure # to log events to a file mhdlr = handlers.MemoryHandler(capacity=16*1024) # MemoryHandler doesn't flush w/o a target mhdlr.setFormatter(format) -mhdlr.setLevel(logging.DEBUG) root.addHandler(mhdlr) +if not __FROZEN__: + # Add streaming handler to sys.stderr. + # Only log to stderr when the program is not frozen! + shdlr = logging.StreamHandler(sys.stderr) + shdlr.setFormatter(format) + root.addHandler(shdlr) +else: + # Redirect stdout and stderr to logger when running as frozen app + sys.stdout = LoggingStdout(getLogger('stdout').info) + print "Stdout redirected" + sys.stderr = LoggingStdout(getLogger('stderr').error) + print >>sys.stderr, "Stderr redirected" + # DEBUG system infos LOG = getLogger('pyMoul') LOG.debug("pyMoul version: %s" % moul_version) @@ -77,11 +93,10 @@ LOG.debug("Adding file logger: %s" % logFile) fhdlr = handlers.RotatingFileHandler(logFile, backupCount=9) fhdlr.setFormatter(format) -fhdlr.setLevel(logging.DEBUG) root.addHandler(fhdlr) fhdlr.doRollover() -# flush and remove remove memory handler +# flush and remove memory handler mhdlr.setTarget(fhdlr) mhdlr.flush() root.removeHandler(mhdlr) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ti...@us...> - 2007-01-31 14:41:20
|
Revision: 107 http://pymoul.svn.sourceforge.net/pymoul/?rev=107&view=rev Author: tiran Date: 2007-01-31 06:41:17 -0800 (Wed, 31 Jan 2007) Log Message: ----------- Added genepydoc to add custom qtslot qtsignal fields Modified Paths: -------------- pymoul/trunk/Makefile.in pymoul/trunk/doc/CODING.txt Added Paths: ----------- pymoul/trunk/genepydoc.py Property Changed: ---------------- pymoul/trunk/doc/CODING.txt Modified: pymoul/trunk/Makefile.in =================================================================== --- pymoul/trunk/Makefile.in 2007-01-31 03:00:50 UTC (rev 106) +++ pymoul/trunk/Makefile.in 2007-01-31 14:41:17 UTC (rev 107) @@ -1,5 +1,5 @@ PYTHON?=python -EPYDOC=$(PYTHON) -c "import epydoc.cli; epydoc.cli.cli()" +EPYDOC=$(PYTHON) genepydoc.py NOTSVN=-a -not -wholename '*.svn*' FINDPYTXT=find src/moul \( -name '*.py' -o -name '*.txt' \) $(NOTSVN) FINDPY=find src/moul -name '*.py' $(NOTSVN) Modified: pymoul/trunk/doc/CODING.txt =================================================================== --- pymoul/trunk/doc/CODING.txt 2007-01-31 03:00:50 UTC (rev 106) +++ pymoul/trunk/doc/CODING.txt 2007-01-31 14:41:17 UTC (rev 107) @@ -1,3 +1,43 @@ +=========== +Python code +=========== + +Use the general coding style of Zope3: + +http://wiki.zope.org/zope3/CodingStyle +http://www.python.org/peps/pep-0008.html + +Naming convention Python objects in Zope +---------------------------------------- +by JimFulton + +1. Use leading underscores as described in the "Python Style Guide", + http://www.python.org/peps/pep-0008.html + + 2. Public global variables names are spelled with CapitalizedWords, + as in 'Folder' or 'RoleService'. + + Interface names always start with a capital 'I', followed by a + capital letter, as in 'IFactory'. + + An exception is made for global non-factory functions, which are + typically spelled with [mixedCase]. + + 3. Public attribute names are [mixedCase], as in "getService" or 'register'. + + 4. Local variables, including argument names + LowercaseWithUnderscores, as in 'permission_id', or 'service'. + + 5. Single-letter variable names should be avoided unless: + + - Their meaning is extremly obvious from the context, and + + - Brevity is desireable + + The most obviouse case for single-letter variables is for + iteration variables. + + ====== epydoc ====== @@ -75,10 +115,14 @@ New field --------- @newfield tag: label [, plural] -@newfield qtslot: Qt slot, Qt slots -@newfield qtsignal: emits Qt signal, emit Qt signals +Custom fields +------------- +Some custom fields are added by the custom genepydoc.py file +@qtslot name(args): connect(SIGNAL) +@qtsignal name(args): emit(SIGNAL) + epytext markup language ======================= Property changes on: pymoul/trunk/doc/CODING.txt ___________________________________________________________________ Name: svn:keywords + Id Revision Added: pymoul/trunk/genepydoc.py =================================================================== --- pymoul/trunk/genepydoc.py (rev 0) +++ pymoul/trunk/genepydoc.py 2007-01-31 14:41:17 UTC (rev 107) @@ -0,0 +1,31 @@ +#!/usr/bin/env python2.5 +"""Generate epydoc +""" +from epydoc.cli import cli +from epydoc.docstringparser import STANDARD_FIELDS +from epydoc.docstringparser import DocstringField +#from epydoc.docstringparser import _check +#from epydoc.docstringparser import register_field_handler + +STANDARD_FIELDS.append( + DocstringField(['slots', 'qtslots'], 'Qt Slot: %s', 'Qt Slots: %s', + short=False, multivalue=True, takes_arg=True) +) + +STANDARD_FIELDS.append( + DocstringField(['signal', 'qtsignal'], 'Emits Qt Signal: %s', + 'Emit Qt Signals: %s', short=False, multivalue=True, + takes_arg=True) +) + +#process_qtsignal_field(api_doc, docindex, tag, arg, descr): +# _check(api_doc, tag, arg, context=RoutineDoc, expect_arg='single') + + +if __name__ == '__main__': + try: + cli() + except: + print '\n\n' + raise + Property changes on: pymoul/trunk/genepydoc.py ___________________________________________________________________ Name: svn:executable + * Name: svn:keywords + Id Revision Name: svn:eol-style + native This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ti...@us...> - 2007-02-06 17:51:40
|
Revision: 150 http://pymoul.svn.sourceforge.net/pymoul/?rev=150&view=rev Author: tiran Date: 2007-02-06 09:51:25 -0800 (Tue, 06 Feb 2007) Log Message: ----------- Added run.bat to run the program under windows w/o build the py2exe version first Fixed error handler Fixed translation installer Modified Paths: -------------- pymoul/trunk/src/moul/qt/errorhandler.py pymoul/trunk/src/moul/qt/i18n/__init__.py pymoul/trunk/src/moul/qt/moulqt.py Added Paths: ----------- pymoul/trunk/run.bat Added: pymoul/trunk/run.bat =================================================================== --- pymoul/trunk/run.bat (rev 0) +++ pymoul/trunk/run.bat 2007-02-06 17:51:25 UTC (rev 150) @@ -0,0 +1,5 @@ +@echo off +cls +set PYTHONPATH=src +python src\moul\qt\moulqt.py +pause Modified: pymoul/trunk/src/moul/qt/errorhandler.py =================================================================== --- pymoul/trunk/src/moul/qt/errorhandler.py 2007-02-06 17:15:50 UTC (rev 149) +++ pymoul/trunk/src/moul/qt/errorhandler.py 2007-02-06 17:51:25 UTC (rev 150) @@ -32,7 +32,6 @@ from traceback import format_exception from moul.log import getLogger - from moul.qt.utils import criticalMB @@ -45,21 +44,20 @@ """ # TODO: translation aware LOG.critical("UNHANDLED ERROR", exc_info=(typ, value, traceback)) - if not getattr(sys, 'frozen', False): - return - try: - title= QApplication.translate("excepthook", - "An unhandled error has occured", - None, QQApplication.UnicodeUTF8) - msg = ("Please report the error:\n\n" + - '\n'.join([line.strip() for line in - format_exception(typ, value, traceback)]) - ) - mb = criticalMB(None, title, msg) - mb.exec_() - except Exception, msg: - print msg - #sys.exit(100) + if getattr(sys, 'frozen', False): + try: + title= QApplication.translate("excepthook", + "An unhandled error has occured", + None, QApplication.UnicodeUTF8) + msg = ("Please report the error:\n\n" + + '\n'.join([line.strip() for line in + format_exception(typ, value, traceback)]) + ) + mb = criticalMB(None, title, msg) + mb.exec_() + except Exception, msg: + print msg + sys.exit(100) def setupQtExceptHook(): """ Modified: pymoul/trunk/src/moul/qt/i18n/__init__.py =================================================================== --- pymoul/trunk/src/moul/qt/i18n/__init__.py 2007-02-06 17:15:50 UTC (rev 149) +++ pymoul/trunk/src/moul/qt/i18n/__init__.py 2007-02-06 17:51:25 UTC (rev 150) @@ -36,11 +36,11 @@ # pkg_resources is incompatible with os.listdir() LANGS = ('de', 'es', 'fr', 'it', 'nl') PREFIX = "pymoul" +TRANSLATIONS = {} if not __FROZEN__: # pkg_resources don't work under py2exe yet import pkg_resources - TRANSLATIONS = {} for lang in LANGS: name = "%s_%s" % (PREFIX, lang) qm = pkg_resources.resource_string(__name__, "%s.qm" % name) @@ -55,15 +55,21 @@ @return: binary file data or None @rtype: str or None """ - if __FROZEN__: - qm = os.path.join(sys.prefix, 'i18n', '%s.qm' % name) + global TRANSLATIONS + if True: #__FROZEN__: + basedir = os.path.dirname(os.path.abspath(sys.argv[0])) + #basedir = sys.prefix + qm = os.path.join(basedir, 'i18n', '%s.qm' % name) if os.path.isfile(qm): - return open(qm, 'rb').read() + # TRICKY: we have to make sure that the data is NEVER garbage + # collected! But the data in a global dict + data = open(qm, 'rb').read() + TRANSLATIONS[name] = data else: LOG.debug("QM file not found: %s" % qm) - else: - return TRANSLATIONS.get(name, None) + return TRANSLATIONS.get(name, None) + def installTranslator(app): """ Installs a translator for the ap @@ -91,6 +97,6 @@ LOG.info("Loading translation %s" % longname) if qm is not None: - #LOG.debug("len(qm) %i" % len(qm)) + LOG.debug("len(%i), type(%s)" % (len(qm), type(qm))) translator.load(qm, len(qm)) app.installTranslator(translator) Modified: pymoul/trunk/src/moul/qt/moulqt.py =================================================================== --- pymoul/trunk/src/moul/qt/moulqt.py 2007-02-06 17:15:50 UTC (rev 149) +++ pymoul/trunk/src/moul/qt/moulqt.py 2007-02-06 17:51:25 UTC (rev 150) @@ -58,7 +58,7 @@ singleapp = SimpleSingleApp('pymoulqt', path=getPyMoulDataDir(check=True)) try: singleapp.acquire() - createLogfile() + except OSError: mb = criticalMB(None, app.trUtf8("pyMoul QT already running"), @@ -67,6 +67,7 @@ mb.exec_() sys.exit(1) + createLogfile() setupQtExceptHook() installTranslator(app) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ti...@us...> - 2007-03-13 19:57:21
|
Revision: 252 http://pymoul.svn.sourceforge.net/pymoul/?rev=252&view=rev Author: tiran Date: 2007-03-13 12:57:19 -0700 (Tue, 13 Mar 2007) Log Message: ----------- Update XXX report and Makefile Fixed some comments in Dni time Modified Paths: -------------- pymoul/trunk/Makefile.in pymoul/trunk/doc/XXXreport.html pymoul/trunk/src/moul/qt/ui/mainwindow.py pymoul/trunk/src/moul/time/dni.py Modified: pymoul/trunk/Makefile.in =================================================================== --- pymoul/trunk/Makefile.in 2007-03-13 15:37:27 UTC (rev 251) +++ pymoul/trunk/Makefile.in 2007-03-13 19:57:19 UTC (rev 252) @@ -29,7 +29,7 @@ bdist_egg: PYTHONPATH="src" $(PYTHON) setup.py $(SETUPFLAGS) bdist_egg -run: ui +run: inplace ui PYTHONPATH="src" $(PYTHON) src/moul/qt/moulqt.py exerun: ui py2exe Modified: pymoul/trunk/doc/XXXreport.html =================================================================== --- pymoul/trunk/doc/XXXreport.html 2007-03-13 15:37:27 UTC (rev 251) +++ pymoul/trunk/doc/XXXreport.html 2007-03-13 19:57:19 UTC (rev 252) @@ -3,11 +3,11 @@ <body> <h1>pyMoul - Developer report tools: XXX/TODO/FIXME comments</h1> -<p>Generated on Fri, 09 Mar 2007 17:18:53 CET, based on Zope 3's XXX report</p> +<p>Generated on Mon, 12 Mar 2007 11:58:47 CET, based on Zope 3's XXX report</p> <hr> <h3>Summary</h3> <p> - There are currently 92 XXX/TODO/FIXME comments. + There are currently 88 XXX/TODO/FIXME comments. </p> <hr/> <h3>Listing</h3> @@ -317,14 +317,14 @@ base-47-base-158- pass base-48-base-159- base-49-base-160-class Constrain(object): -base:50:</pre></li><li><b>File: utilities/../src/moul/file/.svn/text-base/wdysini.py.svn-base:554</b><br/><pre> 'Audio.SetDeviceName' : (QuotedString, Constrain()), # TODO: add check -base-51-base-555- 'Audio.SetChannelVolume GUI' : (FloatString, MinMax(0.0, 1.0)), # 0-100%, no ui -base-52-base-556- # microphon missing -> OS mixer -base-53-base-557- } -base:54:</pre></li><li><b>File: utilities/../src/moul/file/.svn/text-base/wdysini.py.svn-base:642</b><br/><pre> # TODO: microphon needs an extra handler. The mic slider changes the OS mixer. -base-55-base-643- -base-56-base-644-class GraphicsIni(ConfFile): -base-57-base-645- _filename = 'graphics.ini' +base:50:</pre></li><li><b>File: utilities/../src/moul/file/.svn/text-base/wdysini.py.svn-base:556</b><br/><pre> 'Audio.SetDeviceName' : (QuotedString, Constrain()), # TODO: add check +base-51-base-557- 'Audio.SetChannelVolume GUI' : (FloatString, MinMax(0.0, 1.0)), # 0-100%, no ui +base-52-base-558- # microphon missing -> OS mixer +base-53-base-559- } +base:54:</pre></li><li><b>File: utilities/../src/moul/file/.svn/text-base/wdysini.py.svn-base:644</b><br/><pre> # TODO: microphon needs an extra handler. The mic slider changes the OS mixer. +base-55-base-645- +base-56-base-646-class GraphicsIni(ConfFile): +base-57-base-647- _filename = 'graphics.ini' base:58:</pre></li><li><b>File: utilities/../src/moul/file/.svn/text-base/directory.py.svn-base:59</b><br/><pre> # TODO: fnmatch base-59-base-60- return len([name for name in os.listdir(path) base-60-base-61- if os.path.isfile(os.path.join(path, name))]) @@ -338,7 +338,7 @@ base-68-base-116-class AudioIniTest(GenericIniTest): base-69-base-117- enc = aud_enc base:70:</pre></li><li><b>File: utilities/../src/moul/file/tests/.svn/text-base/test_wdysini.py.svn-base:152</b><br/><pre> #XXX self.failIf(p.isChanged()) -base-71-base-153- +base-71-base-153- base-72-base-154- p.screenres = 0 base-73-base-155- eq(p._get('Graphics.Width'), 800) base:74:</pre></li><li><b>File: utilities/../src/moul/file/tests/.svn/text-base/utils.py.svn-base:80</b><br/><pre> for fname in ('UruLauncher.exe', 'UruExplorer.exe'): # XXX: win32 @@ -354,1908 +354,2256 @@ base-84-class AudioIniTest(GenericIniTest): base-85- enc = aud_enc base:86:</pre></li><li><b>File: utilities/../src/moul/file/tests/test_wdysini.py:152</b><br/><pre> #XXX self.failIf(p.isChanged()) -base-87- +base-87- base-88- p.screenres = 0 base-89- eq(p._get('Graphics.Width'), 800) -base:90:</pre></li><li><b>File: utilities/../src/moul/file/tests/test_wdysini.py~:105</b><br/><pre> # TODO: more -base-91- -base-92- def test_publicapi_create(self): -base-93- inipath = os.path.join(self.tmpdir, os.path.basename(self.enc)) -base:94:</pre></li><li><b>File: utilities/../src/moul/file/tests/test_wdysini.py~:116</b><br/><pre> # TODO: more -base-95- -base-96-class AudioIniTest(GenericIniTest): -base-97- enc = aud_enc -base:98:</pre></li><li><b>File: utilities/../src/moul/file/tests/test_wdysini.py~:154</b><br/><pre> #XXX self.failIf(p.isChanged()) -base-99- -base-100- p.screenres = 0 -base-101- eq(p._get('Graphics.Width'), 800) -base:102:</pre></li><li><b>File: utilities/../src/moul/file/tests/utils.py:80</b><br/><pre> for fname in ('UruLauncher.exe', 'UruExplorer.exe'): # XXX: win32 -base-103- fd = open(os.path.join(path, fname), 'wb') -base-104- fd.write('dummy') -base-105- fd.close() -base:106:</pre></li><li><b>File: utilities/../src/moul/file/chatlog.py:216</b><br/><pre> # TODO: inefficient, compare list with directory content -base-107- if not os.path.isdir(self._archivedir): -base-108- LOG.warning("%s is not a directory" % self._archivedir) -base-109- return -base:110:</pre></li><li><b>File: utilities/../src/moul/file/kiimage.py:112</b><br/><pre> # XXX use struct -base-111- if header is None: -base-112- fd = self._fd -base-113- fd.seek(0) -base:114:</pre></li><li><b>File: utilities/../src/moul/file/kiimage.py:127</b><br/><pre> # XXX use struct -base-115- if size is None: -base-116- size = self.getFileSize() -base-117- leading = 4* [None] -base:118:</pre></li><li><b>File: utilities/../src/moul/file/kiimage.py:267</b><br/><pre> # XXX: move checks to copy method! -base-119- if not os.path.isfile(fixed): -base-120- self._tocheck.append((ki, fixed)) -base-121- continue -base:122:</pre></li><li><b>File: utilities/../src/moul/file/wdysini.py:157</b><br/><pre> # TODO: write me -base-123- pass -base-124- -base-125-class Constrain(object): -base:126:</pre></li><li><b>File: utilities/../src/moul/file/wdysini.py:554</b><br/><pre> 'Audio.SetDeviceName' : (QuotedString, Constrain()), # TODO: add check -base-127- 'Audio.SetChannelVolume GUI' : (FloatString, MinMax(0.0, 1.0)), # 0-100%, no ui -base-128- # microphon missing -> OS mixer -base-129- } -base:130:</pre></li><li><b>File: utilities/../src/moul/file/wdysini.py:642</b><br/><pre> # TODO: microphon needs an extra handler. The mic slider changes the OS mixer. -base-131- -base-132-class GraphicsIni(ConfFile): -base-133- _filename = 'graphics.ini' -base:134:</pre></li><li><b>File: utilities/../src/moul/file/kiimage.py~:112</b><br/><pre> # XXX use struct -base-135- if header is None: -base-136- fd = self._fd -base-137- fd.seek(0) -base:138:</pre></li><li><b>File: utilities/../src/moul/file/kiimage.py~:127</b><br/><pre> # XXX use struct -base-139- if size is None: -base-140- size = self.getFileSize() -base-141- leading = 4* [None] -base:142:</pre></li><li><b>File: utilities/../src/moul/file/kiimage.py~:267</b><br/><pre> # XXX: move checks to copy method! -base-143- if not os.path.isfile(fixed): -base-144- self._tocheck.append((ki, fixed)) -base-145- else: -base:146:</pre></li><li><b>File: utilities/../src/moul/file/wdysini.py~:157</b><br/><pre> # TODO: write me -base-147- pass -base-148- -base-149-class Constrain(object): -base:150:</pre></li><li><b>File: utilities/../src/moul/file/wdysini.py~:554</b><br/><pre> 'Audio.SetDeviceName' : (QuotedString, Constrain()), # TODO: add check -base-151- 'Audio.SetChannelVolume GUI' : (FloatString, MinMax(0.0, 1.0)), # 0-100%, no ui -base-152- # microphon missing -> OS mixer -base-153- } -base:154:</pre></li><li><b>File: utilities/../src/moul/file/wdysini.py~:642</b><br/><pre> # TODO: microphon needs an extra handler. The mic slider changes the OS mixer. -base-155- -base-156-class GraphicsIni(ConfFile): -base-157- _filename = 'graphics.ini' -base:158:</pre></li><li><b>File: utilities/../src/moul/file/chatlog.py~:216</b><br/><pre> # TODO: inefficient, compare list with directory content -base-159- if not os.path.isdir(self._archivedir): -base-160- LOG.warning("%s is not a directory" % self._archivedir) -base-161- return -base:162:</pre></li><li><b>File: utilities/../src/moul/file/directory.py:59</b><br/><pre> # TODO: fnmatch -base-163- return len([name for name in os.listdir(path) -base-164- if os.path.isfile(os.path.join(path, name))]) -base-165- -base:166:</pre></li><li><b>File: utilities/../src/moul/file/directory.py~:59</b><br/><pre> # TODO: fnmatch -base-167- return len([name for name in os.listdir(path) -base-168- if os.path.isfile(os.path.join(path, name))]) -base-169- -base:170:</pre></li><li><b>File: utilities/../src/moul/crypt/.svn/text-base/whatdoyousee.py.svn-base:76</b><br/><pre> # XXX: dos format -base-171-base-77- return data.replace("\r\n", "\n") -base-172-base-78- -base-173-base-79-def encryptWDYS(instr, fout): -base:174:</pre></li><li><b>File: utilities/../src/moul/crypt/.svn/text-base/whatdoyousee.py.svn-base:86</b><br/><pre> # XXX: dos format -base-175-base-87- instr = instr.replace("\n", "\r\n") -base-176-base-88- fout.seek(0) -base-177-base-89- fout.write(HEADER) -base:178:</pre></li><li><b>File: utilities/../src/moul/crypt/.svn/text-base/elf.py.svn-base:28</b><br/><pre># TODO: use BinaryFile -base-179-base-29- -base-180-base-30-def list2int(lst): -base-181-base-31- return [ord(s) for s in lst] -base:182:</pre></li><li><b>File: utilities/../src/moul/crypt/.svn/text-base/elf.py.svn-base:72</b><br/><pre> # XXX NotImplemented -base-183-base-73- raise NotImplementedError -base-184-base-74- -base-185-base-75-def decipher(crypt, size, key): -base:186:</pre></li><li><b>File: utilities/../src/moul/crypt/.svn/text-base/binary.py.svn-base:293</b><br/><pre> if size > 1024: # XXX: ??? -base-187-base-294- raise ValueError("string is too long: %i" % size) -base-188-base-295- if self.version == 5: -base-189-base-296- size |= 0xF000 -base:190:</pre></li><li><b>File: utilities/../src/moul/crypt/.svn/text-base/binary.py.svn-base:315</b><br/><pre> if size > 1024: # XXX: ??? -base-191-base-316- raise ValueError("size '%i' > 1024 at position %s(%s)" % -base-192-base-317- (size, fd.tell(), repr(fd))) -base-193-base-318- if self.version == 5: -base:194:base:319: # XXX: testme -base-195-base-320- # read data as tuple of integeres -base-196-base-321- data = fd.readPacked("<%iI" % size) -base-197-base-322- # OR integers with 0xff and write their char equivalent to string -base:198:</pre></li><li><b>File: utilities/../src/moul/crypt/tests/.svn/text-base/test_binary.py.svn-base:98</b><br/><pre> # XXX: no test data -base-199-base-99- pass -base-200-base-100- -base-201-base-101- def test_string0(self): -base:202:</pre></li><li><b>File: utilities/../src/moul/crypt/tests/test_binary.py:98</b><br/><pre> # XXX: no test data -base-203- pass -base-204- -base-205- def test_string0(self): -base:206:</pre></li><li><b>File: utilities/../src/moul/crypt/tests/test_binary.py~:98</b><br/><pre> # XXX: no test data -base-207- pass -base-208- -base-209- def test_string0(self): -base:210:</pre></li><li><b>File: utilities/../src/moul/crypt/whatdoyousee.py:76</b><br/><pre> # XXX: dos format -base-211- return data.replace("\r\n", "\n") -base-212- -base-213-def encryptWDYS(instr, fout): -base:214:</pre></li><li><b>File: utilities/../src/moul/crypt/whatdoyousee.py:86</b><br/><pre> # XXX: dos format -base-215- instr = instr.replace("\n", "\r\n") -base-216- fout.seek(0) -base-217- fout.write(HEADER) -base:218:</pre></li><li><b>File: utilities/../src/moul/crypt/binary.py~:293</b><br/><pre> if size > 1024: # XXX: ??? -base-219- raise ValueError("string is too long: %i" % size) -base-220- if self.version == 5: -base-221- size |= 0xF000 -base:222:</pre></li><li><b>File: utilities/../src/moul/crypt/binary.py~:315</b><br/><pre> if size > 1024: # XXX: ??? -base-223- raise ValueError("size '%i' > 1024 at position %s(%s)" % -base-224- (size, fd.tell(), repr(fd))) -base-225- if self.version == 5: -</pre></li><li><b>File: utilities/../doc/.svn/text-base/XXXreport.html.svn-base:229</b><br/><pre></pre></li><li><b>File: utilities/../src/moul/crypt/elf.py:28</b><br/><pre># TODO: use BinaryFile -base-230- -base-231-def list2int(lst): -base-232- return [ord(s) for s in lst] -base:233:</pre></li><li><b>File: utilities/../src/moul/crypt/elf.py:72</b><br/><pre> # XXX NotImplemented -base-234- raise NotImplementedError -base-235- -base-236-def decipher(crypt, size, key): -base:237:</pre></li><li><b>File: utilities/../src/moul/crypt/binary.py:293</b><br/><pre> if size > 1024: # XXX: ??? -base-238- raise ValueError("string is too long: %i" % size) -base-239- if self.version == 5: -base-240- size |= 0xF000 -base:241:</pre></li><li><b>File: utilities/../src/moul/crypt/binary.py:315</b><br/><pre> if size > 1024: # XXX: ??? -base-242- raise ValueError("size '%i' > 1024 at position %s(%s)" % -base-243- (size, fd.tell(), repr(fd))) -base-244- if self.version == 5: -</pre></li><li><b>File: utilities/../doc/.svn/text-base/XXXreport.html.svn-base:248</b><br/><pre></pre></li><li><b>File: utilities/../src/moul/qt/.svn/text-base/mainwindow.py.svn-base:154</b><br/><pre> # FIXME: signal doesn't do anything -base-249-base-155- self.emit(SIGNAL("close()")) -base-250-base-156- event.accept() -base-251-base-157- event.ignore() -base:252:</pre></li><li><b>File: utilities/../src/moul/qt/.svn/text-base/mainwindow.py.svn-base:293</b><br/><pre> del self._kiimage_threadlet# TODO: other message box -base-253-base-294- del self._kiimage_progressbar -base-254-base-295- self.pb_kiimage_repair.setEnabled(True) -base-255-base-296- mb = qtutils.infoMB(self, -base:256:</pre></li><li><b>File: utilities/../src/moul/qt/.svn/text-base/mainwindow.py.svn-base:392</b><br/><pre> # TODO: change timer from every second to every minute -base-257-base-393- self._timezone_timer = QtCore.QTimer(self) -base-258-base-394- self._timezone_timer.setInterval(1000) # 1 sec -base:259:base:395: # TODO: needs optimization? run only when timer tab is active -base-260-base-396- self.connect(self._timezone_timer, SIGNAL('timeout()'), -base-261-base-397- self.on_timezone_timer_timeout) -base-262-base-398- self._timezone_timer.start() -base:263:</pre></li><li><b>File: utilities/../src/moul/qt/.svn/text-base/mainwindow.py.svn-base:507</b><br/><pre> # TODO: thread safety! -base-264-base-508- self.servers = servers -base-265-base-509- if not self.isRunning(): -base-266-base-510- self.start() -base:267:</pre></li><li><b>File: utilities/../src/moul/qt/.svn/text-base/mainwindow.py.svn-base:513</b><br/><pre> # TODO: thread safety! -base-268-base-514- # emit a list of names first -base-269-base-515- for server in self.servers: -base-270-base-516- self.emit(SIGNAL("server(const QString&)"), server.name) -base:271:</pre></li><li><b>File: utilities/../src/moul/qt/.svn/text-base/mainwindow.py.svn-base:551</b><br/><pre> # TODO check this -base-272-base-552- self._running = False -base-273-base-553- self.condition.wakeAll() -base-274-base-554- -base:275:</pre></li><li><b>File: utilities/../src/moul/qt/.svn/text-base/errorhandler.py.svn-base:45</b><br/><pre> # TODO: translation aware -base-276-base-46- LOG.critical("UNHANDLED ERROR", exc_info=(typ, value, traceback)) -base-277-base-47- if getattr(sys, 'frozen', False): -base-278-base-48- try: -base:279:</pre></li><li><b>File: utilities/../src/moul/qt/mainwindow.py~:154</b><br/><pre> # FIXME: signal doesn't do anything -base-280- self.emit(SIGNAL("close()")) -base-281- event.accept() -base-282- event.ignore() -base:283:</pre></li><li><b>File: utilities/../src/moul/qt/mainwindow.py~:293</b><br/><pre> del self._kiimage_threadlet# TODO: other message box -base-284- del self._kiimage_progressbar -base-285- self.pb_kiimage_repair.setEnabled(True) -base-286- mb = qtutils.infoMB(self, -base:287:</pre></li><li><b>File: utilities/../src/moul/qt/mainwindow.py~:392</b><br/><pre> # TODO: change timer from every second to every minute -base-288- self._timezone_timer = QtCore.QTimer(self) -base-289- self._timezone_timer.setInterval(1000) # 1 sec -base-290- self.connect(self._timezone_timer, SIGNAL('timeout()'), -</pre></li><li><b>File: utilities/../doc/.svn/text-base/XXXreport.html.svn-base:293</b><br/><pre></pre></li><li><b>File: utilities/../src/moul/qt/mainwindow.py~:507</b><br/><pre> # TODO: thread safety! -base-294- self.servers = servers -base-295- if not self.isRunning(): -base-296- self.start() -base:297:</pre></li><li><b>File: utilities/../src/moul/qt/mainwindow.py~:513</b><br/><pre> # TODO: thread safety! -base-298- # emit a list of names first -base-299- for server in self.servers: -base-300- self.emit(SIGNAL("server(const QString&)"), server.name) -base:301:</pre></li><li><b>File: utilities/../src/moul/qt/mainwindow.py~:551</b><br/><pre> # TODO check this -base-302- self._running = False -base-303- self.condition.wakeAll() -base-304- -base:305:</pre></li><li><b>File: utilities/../src/moul/qt/mainwindow.py:154</b><br/><pre> # FIXME: signal doesn't do anything -base-306- self.emit(SIGNAL("close()")) -base-307- event.accept() -base-308- event.ignore() -base:309:</pre></li><li><b>File: utilities/../src/moul/qt/mainwindow.py:293</b><br/><pre> del self._kiimage_threadlet# TODO: other message box -base-310- del self._kiimage_progressbar -base-311- self.pb_kiimage_repair.setEnabled(True) -base-312- mb = qtutils.infoMB(self, -base:313:</pre></li><li><b>File: utilities/../src/moul/qt/mainwindow.py:392</b><br/><pre> # TODO: change timer from every second to every minute -base-314- self._timezone_timer = QtCore.QTimer(self) -base-315- self._timezone_timer.setInterval(1000) # 1 sec -base-316- self.connect(self._timezone_timer, SIGNAL('timeout()'), -</pre></li><li><b>File: utilities/../doc/.svn/text-base/XXXreport.html.svn-base:319</b><br/><pre></pre></li><li><b>File: utilities/../src/moul/qt/mainwindow.py:507</b><br/><pre> # TODO: thread safety! -base-320- self.servers = servers -base-321- if not self.isRunning(): -base-322- self.start() -base:323:</pre></li><li><b>File: utilities/../src/moul/qt/mainwindow.py:513</b><br/><pre> # TODO: thread safety! -base-324- # emit a list of names first -base-325- for server in self.servers: -base-326- self.emit(SIGNAL("server(const QString&)"), server.name) -base:327:</pre></li><li><b>File: utilities/../src/moul/qt/mainwindow.py:551</b><br/><pre> # TODO check this -base-328- self._running = False -base-329- self.condition.wakeAll() -base-330- -base:331:</pre></li><li><b>File: utilities/../src/moul/qt/errorhandler.py:45</b><br/><pre> # TODO: translation aware -base-332- LOG.critical("UNHANDLED ERROR", exc_info=(typ, value, traceback)) -base-333- if getattr(sys, 'frozen', False): -base-334- try: -base:335:</pre></li><li><b>File: utilities/../src/moul/osdependent/__init__.py:120</b><br/><pre># XXX: what about cygwin, bsd and others? -base-336-_thismodule = sys.modules[__name__] -base-337-if __WIN32__: -base-338- from moul.osdependent import win32 as osdep_win32 -base:339:</pre></li><li><b>File: utilities/../src/moul/osdependent/darwin/__init__.py:37</b><br/><pre>EXEC_NAME = "???" # XXX -base-340-UPDATER = "Uru Live.app/Contents/Resources/Game.app/Contents/Resources/URU Live Updater.app/Contents/MacOS/URU Live Updater" -base-341-LOCATIONS = [ -base-342- "/Applications", -base:343:</pre></li><li><b>File: utilities/../src/moul/osdependent/darwin/.svn/text-base/__init__.py.svn-base:37</b><br/><pre>EXEC_NAME = "???" # XXX -base-344-base-38-UPDATER = "Uru Live.app/Contents/Resources/Game.app/Contents/Resources/URU Live Updater.app/Contents/MacOS/URU Live Updater" -base-345-base-39-LOCATIONS = [ -base-346-base-40- "/Applications", -base:347:</pre></li><li><b>File: utilities/../src/moul/osdependent/darwin/__init__.py~:37</b><br/><pre>EXEC_NAME = "???" # XXX -base-348-UPDATER = "Uru Live.app/Contents/Resources/Game.app/Contents/Resources/URU Live Updater.app/Contents/MacOS/URU Live Updater" -base-349-LOCATIONS = [ -base-350- "/Applications", -base:351:</pre></li><li><b>File: utilities/../src/moul/osdependent/.svn/text-base/__init__.py.svn-base:120</b><br/><pre># XXX: what about cygwin, bsd and others? -base-352-base-121-_thismodule = sys.modules[__name__] -base-353-base-122-if __WIN32__: -base-354-base-123- from moul.osdependent import win32 as osdep_win32 -base:355:</pre></li><li><b>File: utilities/../doc/.svn/text-base/XXXreport.html.svn-base:14</b><br/><pre><ol><li><b>File: utilities/../.svn/text-base/test.py.svn-base:548</b><br/><pre> # XXX bug: doctest may report several failures in one test, they are -base-356-base-15-base-549- # separated by a horizontal dash line. Only the first one of -base-357-base-16-base-550- # them is now colorized properly. -base-358-base-17-base-551- header = lines[0] -base:359:base:18:</pre></li><li><b>File: utilities/../.svn/text-base/test.py.svn-base:603</b><br/><pre> # TODO: Scrape and colorize the traceback. -base-360-base-19-base-604- result.append(self.colorize('doctest_got', line)) -base-361-base-20-base-605- elif remaining[0] == 'Differences (ndiff with -expected +actual):': -base-362-base-21-base-606- result.append(self.colorize('doctest_title', remaining.pop(0))) # E. raised: -base:363:base:22:</pre></li><li><b>File: utilities/../.svn/text-base/test.py.svn-base:623</b><br/><pre> # TODO: We only deal with the output from Zope 3's doctest module. -base-364-base-23-base-624- # A colorizer for the Python's doctest module would be nice too. -base-365-base-24-base-625- if doctest: -base-366-base-25-base-626- # If we have a doctest, we do not care about this header. All the -base:367:base:26:</pre></li><li><b>File: utilities/../.svn/text-base/test.py.svn-base:690</b><br/><pre> # TODO these should be hookable -base-368-base-27-base-691- from zope.tales.tales import TALESTracebackSupplement -base-369-base-28-base-692- from zope.pagetemplate.pagetemplate \ -base-370-base-29-base-693- import PageTemplateTracebackSupplement -base:371:base:30:</pre></li><li><b>File: utilities/../src/moul/file/.svn/text-base/chatlog.py.svn-base:216</b><br/><pre> # TODO: inefficient, compare list with directory content -base-372-base-31-base-217- if not os.path.isdir(self._archivedir): -base-373-base-32-base-218- LOG.warning("%s is not a directory" % self._archivedir) -base-374-base-33-base-219- return -base:375:base:34:</pre></li><li><b>File: utilities/../src/moul/file/.svn/text-base/kiimage.py.svn-base:112</b><br/><pre> # XXX use struct -base-376-base-35-base-113- if header is None: -base-377-base-36-base-114- fd = self._fd -base-378-base-37-base-115- fd.seek(0) -base:379:base:38:</pre></li><li><b>File: utilities/../src/moul/file/.svn/text-base/kiimage.py.svn-base:127</b><br/><pre> # XXX use struct -base-380-base-39-base-128- if size is None: -base-381-base-40-base-129- size = self.getFileSize() -base-382-base-41-base-130- leading = 4* [None] -base:383:base:42:</pre></li><li><b>File: utilities/../src/moul/file/.svn/text-base/kiimage.py.svn-base:267</b><br/><pre> # XXX: move checks to copy method! -base-384-base-43-base-268- if not os.path.isfile(fixed): -base-385-base-44-base-269- self._tocheck.append((ki, fixed)) -base-386-base-45-base-270- continue -base:387:base:46:</pre></li><li><b>File: utilities/../src/moul/file/.svn/text-base/wdysini.py.svn-base:157</b><br/><pre> # TODO: write me -base-388-base-47-base-158- pass -base-389-base-48-base-159- -base-390-base-49-base-160-class Constrain(object): -base:391:base:50:</pre></li><li><b>File: utilities/../src/moul/file/.svn/text-base/wdysini.py.svn-base:554</b><br/><pre> 'Audio.SetDeviceName' : (QuotedString, Constrain()), # TODO: add check -base-392-base-51-base-555- 'Audio.SetChannelVolume GUI' : (FloatString, MinMax(0.0, 1.0)), # 0-100%, no ui -base-393-base-52-base-556- # microphon missing -> OS mixer -base-394-base-53-base-557- } -base:395:base:54:</pre></li><li><b>File: utilities/../src/moul/file/.svn/text-base/wdysini.py.svn-base:642</b><br/><pre> # TODO: microphon needs an extra handler. The mic slider changes the OS mixer. -base-396-base-55-base-643- -base-397-base-56-base-644-class GraphicsIni(ConfFile): -base-398-base-57-base-645- _filename = 'graphics.ini' -base:399:base:58:</pre></li><li><b>File: utilities/../src/moul/file/.svn/text-base/directory.py.svn-base:59</b><br/><pre> # TODO: fnmatch -base-400-base-59-base-60- return len([name for name in os.listdir(path) -base-401-base-60-base-61- if os.path.isfile(os.path.join(path, name))]) -base-402-base-61-base-62- -base:403:base:62:</pre></li><li><b>File: utilities/../src/moul/file/tests/.svn/text-base/test_wdysini.py.svn-base:105</b><br/><pre> # TODO: more -base-404-base-63-base-106- -base-405-base-64-base-107- def test_publicapi_create(self): -base-406-base-65-base-108- inipath = os.path.join(self.tmpdir, os.path.basename(self.enc)) -base:407:base:66:</pre></li><li><b>File: utilities/../src/moul/file/tests/.svn/text-base/test_wdysini.py.svn-base:116</b><br/><pre> # TODO: more -base-408-base-67-base-117- -base-409-base-68-base-118-class AudioIniTest(GenericIniTest): -base-410-base-69-base-119- enc = aud_enc -base:411:base:70:</pre></li><li><b>File: utilities/../src/moul/file/tests/.svn/text-base/test_wdysini.py.svn-base:154</b><br/><pre> #XXX self.failIf(p.isChanged()) -base-412-base-71-base-155- -base-413-base-72-base-156- p.screenres = 0 -base-414-base-73-base-157- eq(p._get('Graphics.Width'), 800) -base:415:base:74:</pre></li><li><b>File: utilities/../src/moul/file/tests/.svn/text-base/utils.py.svn-base:80</b><br/><pre> for fname in ('UruLauncher.exe', 'UruExplorer.exe'): # XXX: win32 -base-416-base-75-base-81- fd = open(os.path.join(path, fname), 'wb') -base-417-base-76-base-82- fd.write('dummy') -base-418-base-77-base-83- fd.close() -base:419:base:78:</pre></li><li><b>File: utilities/../src/moul/file/tests/test_wdysini.py:105</b><br/><pre> # TODO: more -base-420-base-79- -base-421-base-80- def test_publicapi_create(self): -base-422-base-81- inipath = os.path.join(self.tmpdir, os.path.basename(self.enc)) -base:423:base:82:</pre></li><li><b>File: utilities/../src/moul/file/tests/test_wdysini.py:116</b><br/><pre> # TODO: more -base-424-base-83- -base-425-base-84-class AudioIniTest(GenericIniTest): -base-426-base-85- enc = aud_enc -base:427:base:86:</pre></li><li><b>File: utilities/../src/moul/file/tests/test_wdysini.py:154</b><br/><pre> #XXX self.failIf(p.isChanged()) -base-428-base-87- -base-429-base-88- p.screenres = 0 -base-430-base-89- eq(p._get('Graphics.Width'), 800) -base:431:base:90:</pre></li><li><b>File: utilities/../src/moul/file/tests/utils.py:80</b><br/><pre> for fname in ('UruLauncher.exe', 'UruExplorer.exe'): # XXX: win32 -base-432-base-91- fd = open(os.path.join(path, fname), 'wb') -base-433-base-92- fd.write('dummy') -base-434-base-93- fd.close() -base:435:base:94:</pre></li><li><b>File: utilities/../src/moul/file/chatlog.py:216</b><br/><pre> # TODO: inefficient, compare list with directory content -base-436-base-95- if not os.path.isdir(self._archivedir): -base-437-base-96- LOG.warning("%s is not a directory" % self._archivedir) -base-438-base-97- return -base:439:base:98:</pre></li><li><b>File: utilities/../src/moul/file/kiimage.py:112</b><br/><pre> # XXX use struct -base-440-base-99- if header is None: -base-441-base-100- fd = self._fd -base-442-base-101- fd.seek(0) -base:443:base:102:</pre></li><li><b>File: utilities/../src/moul/file/kiimage.py:127</b><br/><pre> # XXX use struct -base-444-base-103- if size is None: -base-445-base-104- size = self.getFileSize() -base-446-base-105- leading = 4* [None] -base:447:base:106:</pre></li><li><b>File: utilities/../src/moul/file/kiimage.py:267</b><br/><pre> # XXX: move checks to copy method! -base-448-base-107- if not os.path.isfile(fixed): -base-449-base-108- self._tocheck.append((ki, fixed)) -base-450-base-109- continue -base:451:base:110:</pre></li><li><b>File: utilities/../src/moul/file/wdysini.py:157</b><br/><pre> # TODO: write me -base-452-base-111- pass -base-453-base-112- -base-454-base-113-class Constrain(object): -base:455:base:114:</pre></li><li><b>File: utilities/../src/moul/file/wdysini.py:554</b><br/><pre> 'Audio.SetDeviceName' : (QuotedString, Constrain()), # TODO: add check -base-456-base-115- 'Audio.SetChannelVolume GUI' : (FloatString, MinMax(0.0, 1.0)), # 0-100%, no ui -base-457-base-116- # microphon missing -> OS mixer -base-458-base-117- } -base:459:base:118:</pre></li><li><b>File: utilities/../src/moul/file/wdysini.py:642</b><br/><pre> # TODO: microphon needs an extra handler. The mic slider changes the OS mixer. -base-460-base-119- -base-461-base-120-class GraphicsIni(ConfFile): -base-462-base-121- _filename = 'graphics.ini' -base:463:base:122:</pre></li><li><b>File: utilities/../src/moul/file/kiimage.py~:112</b><br/><pre> # XXX use struct -base-464-base-123- if header is None: -base-465-base-124- fd = self._fd -base-466-base-125- fd.seek(0) -base:467:base:126:</pre></li><li><b>File: utilities/../src/moul/file/kiimage.py~:127</b><br/><pre> # XXX use struct -base-468-base-127- if size is None: -base-469-base-128- size = self.getFileSize() -base-470-base-129- leading = 4* [None] -base:471:base:130:</pre></li><li><b>File: utilities/../src/moul/file/kiimage.py~:267</b><br/><pre> # XXX: move checks to copy method! -base-472-base-131- if not os.path.isfile(fixed): -base-473-base-132- self._tocheck.append((ki, fixed)) -base-474-base-133- else: -base:475:base:134:</pre></li><li><b>File: utilities/../src/moul/file/wdysini.py~:157</b><br/><pre> # TODO: write me -base-476-base-135- pass -base-477-base-136- -base-478-base-137-class Constrain(object): -base:479:base:138:</pre></li><li><b>File: utilities/../src/moul/file/wdysini.py~:554</b><br/><pre> 'Audio.SetDeviceName' : (QuotedString, Constrain()), # TODO: add check -base-480-base-139- 'Audio.SetChannelVolume GUI' : (FloatString, MinMax(0.0, 1.0)), # 0-100%, no ui -base-481-base-140- # microphon missing -> OS mixer -base-482-base-141- } -base:483:base:142:</pre></li><li><b>File: utilities/../src/moul/file/wdysini.py~:642</b><br/><pre> # TODO: microphon needs an extra handler. The mic slider changes the OS mixer. -base-484-base-143- -base-485-base-144-class GraphicsIni(ConfFile): -base-486-base-145- _filename = 'graphics.ini' -base:487:base:146:</pre></li><li><b>File: utilities/../src/moul/file/chatlog.py~:216</b><br/><pre> # TODO: inefficient, compare list with directory content -base-488-base-147- if not os.path.isdir(self._archivedir): -base-489-base-148- LOG.warning("%s is not a directory" % self._archivedir) -base-490-base-149- return -base:491:base:150:</pre></li><li><b>File: utilities/../src/moul/file/directory.py:59</b><br/><pre> # TODO: fnmatch -base-492-base-151- return len([name for name in os.listdir(path) -base-493-base-152- if os.path.isfile(os.path.join(path, name))]) -base-494-base-153- -base:495:base:154:</pre></li><li><b>File: utilities/../src/moul/file/directory.py~:59</b><br/><pre> # TODO: fnmatch -base-496-base-155- return len([name for name in os.listdir(path) -base-497-base-156- if os.path.isfile(os.path.join(path, name))]) -base-498-base-157- -base:499:base:158:</pre></li><li><b>File: utilities/../src/moul/crypt/.svn/text-base/whatdoyousee.py.svn-base:77</b><br/><pre> # XXX: dos format -base-500-base-159-base-78- return data.replace("\r\n", "\n") -base-501-base-160-base-79- -base-502-base-161-base-80-def encryptWDYS(instr, fout): -base:503:base:162:</pre></li><li><b>File: utilities/../src/moul/crypt/.svn/text-base/whatdoyousee.py.svn-base:87</b><br/><pre> # XXX: dos format -base-504-base-163-base-88- instr = instr.replace("\n", "\r\n") -base-505-base-164-base-89- fout.seek(0) -base-506-base-165-base-90- fout.write(HEADER) -base:507:base:166:</pre></li><li><b>File: utilities/../src/moul/crypt/.svn/text-base/elf.py.svn-base:71</b><br/><pre> # XXX NotImplemented -base-508-base-167-base-72- raise NotImplementedError -base-509-base-168-base-73- -base-510-base-169-base-74-def decipher(crypt, size, key): -base:511:base:170:</pre></li><li><b>File: utilities/../src/moul/crypt/whatdoyousee.py:77</b><br/><pre> # XXX: dos format -base-512-base-171- return data.replace("\r\n", "\n") -base-513-base-172- -base-514-base-173-def encryptWDYS(instr, fout): -base:515:base:174:</pre></li><li><b>File: utilities/../src/moul/crypt/whatdoyousee.py:87</b><br/><pre> # XXX: dos format -base-516-base-175- instr = instr.replace("\n", "\r\n") -base-517-base-176- fout.seek(0) -base-518-base-177- fout.write(HEADER) -base:519:base:178:</pre></li><li><b>File: utilities/../src/moul/crypt/elf.py:71</b><br/><pre> # XXX NotImplemented -base-520-base-179- raise NotImplementedError -base-521-base-180- -base-522-base-181-def decipher(crypt, size, key): -base:523:base:182:</pre></li><li><b>File: utilities/../src/moul/qt/.svn/text-base/mainwindow.py.svn-base:152</b><br/><pre> # FIXME: signal doesn't do anything -base-524-base-183-base-153- self.emit(SIGNAL("close()")) -base-525-base-184-base-154- event.accept() -base-526-base-185-base-155- event.ignore() -base:527:base:186:</pre></li><li><b>File: utilities/../src/moul/qt/.svn/text-base/mainwindow.py.svn-base:291</b><br/><pre> del self._kiimage_threadlet# TODO: other message box -base-528-base-187-base-292- del self._kiimage_progressbar -base-529-base-188-base-293- self.pb_kiimage_repair.setEnabled(True) -base-530-base-189-base-294- mb = qtutils.infoMB(self, -base:531:base:190:</pre></li><li><b>File: utilities/../src/moul/qt/.svn/text-base/mainwindow.py.svn-base:390</b><br/><pre> # TODO: change timer from every second to every minute -base-532-base-191-base-391- self._timezone_timer = timer = QtCore.QTimer(self) -base-533-base-192-base-392- timer.setInterval(1000) # 1 sec -base:534:base:193:base:393: # TODO: needs optimization? run only when timer tab is active -base-535-base-194-base-394- self.connect(timer, SIGNAL('timeout()'), self.on_timezone_timer_timeout) -base-536-base-195-base-395- timer.start() -base-537-base-196-base-396- -base:538:base:197:</pre></li><li><b>File: utilities/../src/moul/qt/.svn/text-base/mainwindow.py.svn-base:487</b><br/><pre> # TODO: thread safety! -base-539-base-198-base-488- self.servers = servers -base-540-base-199-base-489- if not self.isRunning(): -base-541-base-200-base-490- self.start() -base:542:base:201:</pre></li><li><b>File: utilities/../src/moul/qt/.svn/text-base/mainwindow.py.svn-base:493</b><br/><pre> # TODO: thread safety! -base-543-base-202-base-494- # emit a list of names first -base-544-base-203-base-495- for server in self.servers: -base-545-base-204-base-496- self.emit(SIGNAL("server(const QString&)"), server.name) -base:546:base:205:</pre></li><li><b>File: utilities/../src/moul/qt/.svn/text-base/mainwindow.py.svn-base:531</b><br/><pre> # TODO check this -base-547-base-206-base-532- self._running = False -base-548-base-207-base-533- self.condition.wakeAll() -base-549-base-208-base-534- -base:550:base:209:</pre></li><li><b>File: utilities/../src/moul/qt/.svn/text-base/errorhandler.py.svn-base:45</b><br/><pre> # TODO: translation aware -base-551-base-210-base-46- LOG.critical("UNHANDLED ERROR", exc_info=(typ, value, traceback)) -base-552-base-211-base-47- if getattr(sys, 'frozen', False): -base-553-base-212-base-48- try: -base:554:base:213:</pre></li><li><b>File: utilities/../src/moul/qt/mainwindow.py~:151</b><br/><pre> # FIXME: signal doesn't do anything -base-555-base-214- self.emit(SIGNAL("close()")) -base-556-base-215- event.accept() -base-557-base-216- event.ignore() -base:558:base:217:</pre></li><li><b>File: utilities/../src/moul/qt/mainwindow.py~:290</b><br/><pre> del self._kiimage_threadlet# TODO: other message box -base-559-base-218- del self._kiimage_progressbar -base-560-base-219- self.pb_kiimage_repair.setEnabled(True) -base-561-base-220- mb = qtutils.infoMB(self, -base:562:base:221:</pre></li><li><b>File: utilities/../src/moul/qt/mainwindow.py~:389</b><br/><pre> # TODO: change timer from every second to every minute -base-563-base-222- self._timezone_timer = timer = QtCore.QTimer(self) -base-564-base-223- timer.setInterval(1000) # 1 sec -base-565-base-224- self.connect(timer, SIGNAL('timeout()'), self.on_timezone_timer_timeout) -base:566:</pre></li><li><b>File: utilities/../doc/.svn/text-base/XXXreport.html.svn-base:227</b><br/><pre></pre></li><li><b>File: utilities/../src/moul/qt/mainwindow.py~:486</b><br/><pre> # TODO: thread safety! -base-567-base-228- self.servers = servers -base-568-base-229- if not self.isRunning(): -base-569-base-230- self.start() -base:570:base:231:</pre></li><li><b>File: utilities/../src/moul/qt/mainwindow.py~:492</b><br/><pre> # TODO: thread safety! -base-571-base-232- # emit a list of names first -base-572-base-233- for server in self.servers: -base-573-base-234- self.emit(SIGNAL("server(const QString&)"), server.name) -base:574:base:235:</pre></li><li><b>File: utilities/../src/moul/qt/mainwindow.py~:530</b><br/><pre> # TODO check this -base-575-base-236- self._running = False -base-576-base-237- self.condition.wakeAll() -base-577-base-238- -base:578:base:239:</pre></li><li><b>File: utilities/../src/moul/qt/mainwindow.py:152</b><br/><pre> # FIXME: signal doesn't do anything -base-579-base-240- self.emit(SIGNAL("close()")) -base-580-base-241- event.accept() -base-581-base-242- event.ignore() -base:582:base:243:</pre></li><li><b>File: utilities/../src/moul/qt/mainwindow.py:291</b><br/><pre> del self._kiimage_threadlet# TODO: other message box -base-583-base-244- del self._kiimage_progressbar -base-584-base-245- self.pb_kiimage_repair.setEnabled(True) -base-585-base-246- mb = qtutils.infoMB(self, -base:586:base:247:</pre></li><li><b>File: utilities/../src/moul/qt/mainwindow.py:390</b><br/><pre> # TODO: change timer from every second to every minute -base-587-base-248- self._timezone_timer = timer = QtCore.QTimer(self) -base-588-base-249- timer.setInterval(1000) # 1 sec -base-589-base-250- self.connect(timer, SIGNAL('timeout()'), self.on_timezone_timer_timeout) -base:590:</pre></li><li><b>File: utilities/../doc/.svn/text-base/XXXreport.html.svn-base:253</b><br/><pre></pre></li><li><b>File: utilities/../src/moul/qt/mainwindow.py:487</b><br/><pre> # TODO: thread safety! -base-591-base-254- self.servers = servers -base-592-base-255- if not self.isRunning(): -base-593-base-256- self.start() -base:594:base:257:</pre></li><li><b>File: utilities/../src/moul/qt/mainwindow.py:493</b><br/><pre> # TODO: thread safety! -base-595-base-258- # emit a list of names first -base-596-base-259- for server in self.servers: -base-597-base-260- self.emit(SIGNAL("server(const QString&)"), server.name) -base:598:base:261:</pre></li><li><b>File: utilities/../src/moul/qt/mainwindow.py:531</b><br/><pre> # TODO check this -base-599-base-262- self._running = False -base-600-base-263- self.condition.wakeAll() -base-601-base-264- -base:602:base:265:</pre></li><li><b>File: utilities/../src/moul/qt/errorhandler.py:45</b><br/><pre> # TODO: translation aware -base-603-base-266- LOG.critical("UNHANDLED ERROR", exc_info=(typ, value, traceback)) -base-604-base-267- if getattr(sys, 'frozen', False): -base-605-base-268- try: -base:606:base:269:</pre></li><li><b>File: utilities/../src/moul/osdependent/__init__.py:120</b><br/><pre># XXX: what about cygwin, bsd and others? -base-607-base-270-_thismodule = sys.modules[__name__] -base-608-base-271-if __WIN32__: -base-609-base-272- from moul.osdependent import win32 as osdep_win32 -base:610:base:273:</pre></li><li><b>File: utilities/../src/moul/osdependent/.svn/text-base/__init__.py.svn-base:120</b><br/><pre># XXX: what about cygwin, bsd and others? -base-611-base-274-base-121-_thismodule = sys.modules[__name__] -base-612-base-275-base-122-if __WIN32__: -base-613-base-276-base-123- from moul.osdependent import win32 as osdep_win32 -base:614:base:277:</pre></li><li><b>File: utilities/../doc/.svn/text-base/XXXreport.html.svn-base:14</b><br/><pre><ol><li><b>File: utilities/../.svn/text-base/test.py.svn-base:548</b><br/><pre> # XXX bug: doctest may report several failures in one test, they are -base-615-base-278-base-15-base-549- # separated by a horizontal dash line. Only the first one of -base-616-base-279-base-16-base-550- # them is now colorized properly. -base-617-base-280-base-17-base-551- header = lines[0] -base:618:base:281:base:18:</pre></li><li><b>File: utilities/../.svn/text-base/test.py.svn-base:603</b><br/><pre> # TODO: Scrape and colorize the traceback. -base-619-base-282-base-19-base-604- result.append(self.colorize('doctest_got', line)) -base-620-base-283-base-20-base-605- elif remaining[0] == 'Differences (ndiff with -expected +actual):': -base-621-base-284-base-21-base-606- result.append(self.colorize('doctest_title', remaining.pop(0))) # E. raised: -base:622:base:285:base:22:</pre></li><li><b>File: utilities/../.svn/text-base/test.py.svn-base:623</b><br/><pre> # TODO: We only deal with the output from Zope 3's doctest module. -base-623-base-286-base-23-base-624- # A colorizer for the Python's doctest module would be nice too. -base-624-base-287-base-24-base-625- if doctest: -base-625-base-288-base-25-base-626- # If we have a doctest, we do not care about this header. All the -base:626:base:289:base:26:</pre></li><li><b>File: utilities/../.svn/text-base/test.py.svn-base:690</b><br/><pre> # TODO these should be hookable -base-627-base-290-base-27-base-691- from zope.tales.tales import TALESTracebackSupplement -base-628-base-291-base-28-base-692- from zope.pagetemplate.pagetemplate \ -base-629-base-292-base-29-base-693- import PageTemplateTracebackSupplement -base:630:base:293:base:30:</pre></li><li><b>File: utilities/../src/moul/file/.svn/text-base/chatlog.py.svn-base:208</b><br/><pre> # TODO: inefficient, compare list with directory content -base-631-base-294-base-31-base-209- if not os.path.isdir(self._logdir): -base-632-base-295-base-32-base-210- LOG.warning("%s is not a directory" % logdir) -base-633-base-296-base-33-base-211- return -base:634:base:297:base:34:</pre></li><li><b>File: utilities/../src/moul/file/.svn/text-base/kiimage.py.svn-base:112</b><br/><pre> # XXX use struct -base-635-base-298-base-35-base-113- if header is None: -base-636-base-299-base-36-base-114- fd = self._fd -base-637-base-300-base-37-base-115- fd.seek(0) -base:638:base:301:base:38:</pre></li><li><b>File: utilities/../src/moul/file/.svn/text-base/kiimage.py.svn-base:127</b><br/><pre> # XXX use struct -base-639-base-302-base-39-base-128- if size is None: -base-640-base-303-base-40-base-129- size = self.getFileSize() -base-641-base-304-base-41-base-130- leading = 4* [None] -base:642:base:305:base:42:</pre></li><li><b>File: utilities/../src/moul/file/.svn/text-base/kiimage.py.svn-base:267</b><br/><pre> # XXX: move checks to copy method! -base-643-base-306-base-43-base-268- if not os.path.isfile(fixed): -base-644-base-307-base-44-base-269- self._tocheck.append((ki, fixed)) -base-645-base-308-base-45-base-270- continue -base:646:base:309:base:46:</pre></li><li><b>File: utilities/../src/moul/file/.svn/text-base/wdysini.py.svn-base:157</b><br/><pre> # TODO: write me -base-647-base-310-base-47-base-158- pass -base-648-base-311-base-48-base-159- -base-649-base-312-base-49-base-160-class Constrain(object): -base:650:base:313:base:50:</pre></li><li><b>File: utilities/../src/moul/file/.svn/text-base/wdysini.py.svn-base:554</b><br/><pre> 'Audio.SetDeviceName' : (QuotedString, Constrain()), # TODO: add check -base-651-base-314-base-51-base-555- 'Audio.SetChannelVolume GUI' : (FloatString, MinMax(0.0, 1.0)), # 0-100%, no ui -base-652-base-315-base-52-base-556- # microphon missing -> OS mixer -base-653-base-316-base-53-base-557- } -base:654:base:317:base:54:</pre></li><li><b>File: utilities/../src/moul/file/.svn/text-base/wdysini.py.svn-base:642</b><br/><pre> # TODO: microphon needs an extra handler. The mic slider changes the OS mixer. -base-655-base-318-base-55-base-643- -base-656-base-319-base-56-base-644-class GraphicsIni(ConfFile): -base-657-base-320-base-57-base-645- _filename = 'graphics.ini' -base:658:base:321:base:58:</pre></li><li><b>File: utilities/../src/moul/file/.svn/text-base/directory.py.svn-base:59</b><br/><pre> # TODO: fnmatch -base-659-base-322-base-59-base-60- return len([name for name in os.listdir(path) -base-660-base-323-base-60-base-61- if os.path.isfile(os.path.join(path, name))]) -base-661-base-324-base-61-base-62- -base:662:base:325:base:62:</pre></li><li><b>File: utilities/../src/moul/file/tests/.svn/text-base/test_wdysini.py.svn-base:105</b><br/><pre> # TODO: more -base-663-base-326-base-63-base-106- -base-664-base-327-base-64-base-107- def test_publicapi_create(self): -base-665-base-328-base-65-base-108- inipath = os.path.join(self.tmpdir, os.path.basename(self.enc)) -base:666:base:329:base:66:</pre></li><li><b>File: utilities/../src/moul/file/tests/.svn/text-base/test_wdysini.py.svn-base:116</b><br/><pre> # TODO: more -base-667-base-330-base-67-base-117- -base-668-base-331-base-68-base-118-class AudioIniTest(GenericIniTest): -base-669-base-332-base-69-base-119- enc = aud_enc -base:670:base:333:base:70:</pre></li><li><b>File: utilities/../src/moul/file/tests/.svn/text-base/test_wdysini.py.svn-base:154</b><br/><pre> #XXX self.failIf(p.isChanged()) -base-671-base-334-base-71-base-155- -base-672-base-335-base-72-base-156- p.screenres = 0 -base-673-base-336-base-73-base-157- eq(p._get('Graphics.Width'), 800) -base:674:base:337:base:74:</pre></li><li><b>File: utilities/../src/moul/file/tests/.svn/text-base/utils.py.svn-base:80</b><br/><pre> for fname in ('UruLauncher.exe', 'UruExplorer.exe'): # XXX: win32 -base-675-base-338-base-75-base-81- fd = open(os.path.join(path, fname), 'wb') -base-676-base-339-base-76-base-82- fd.write('dummy') -base-677-base-340-base-77-base-83- fd.close() -base:678:base:341:base:78:</pre></li><li><b>File: utilities/../src/moul/file/tests/test_wdysini.py:105</b><br/><pre> # TODO: more -base-679-base-342-base-79- -base-680-base-343-base-80- def test_publicapi_create(self): -base-681-base-344-base-81- inipath = os.path.join(self.tmpdir, os.path.basename(self.enc)) -base:682:base:345:base:82:</pre></li><li><b>File: utilities/../src/moul/file/tests/test_wdysini.py:116</b><br/><pre> # TODO: more -base-683-base-346-base-83- -base-684-base-347-base-84-class AudioIniTest(GenericIniTest): -base-685-base-348-base-85- enc = aud_enc -base:686:base:349:base:86:</pre></li><li><b>File: utilities/../src/moul/file/tests/test_wdysini.py:154</b><br/><pre> #XXX self.failIf(p.isChanged()) -base-687-base-350-base-87- -base-688-base-351-base-88- p.screenres = 0 -base-689-base-352-base-89- eq(p._get('Graphics.Width'), 800) -base:690:base:353:base:90:</pre></li><li><b>File: utilities/../src/moul/file/tests/utils.py:80</b><br/><pre> for fname in ('UruLauncher.exe', 'UruExplorer.exe'): # XXX: win32 -base-691-base-354-base-91- fd = open(os.path.join(path, fname), 'wb') -base-692-base-355-base-92- fd.write('dummy') -base-693-base-356-base-93- fd.close() -base:694:base:357:base:94:</pre></li><li><b>File: utilities/../src/moul/file/chatlog.py:208</b><br/><pre> # TODO: inefficient, compare list with directory content -base-695-base-358-base-95- if not os.path.isdir(self._logdir): -base-696-base-359-base-96- LOG.warning("%s is not a directory" % logdir) -base-697-base-360-base-97- return -base:698:base:361:base:98:</pre></li><li><b>File: utilities/../src/moul/file/kiimage.py:112</b><br/><pre> # XXX use struct -base-699-base-362-base-99- if header is None: -base-700-base-363-base-100- fd = self._fd -base-701-base-364-base-101- fd.seek(0) -base:702:base:365:base:102:</pre></li><li><b>File: utilities/../src/moul/file/kiimage.py:127</b><br/><pre> # XXX use struct -base-703-base-366-base-103- if size is None: -base-704-base-367-base-104- size = self.getFileSize() -base-705-base-368-base-105- leading = 4* [None] -base:706:base:369:base:106:</pre></li><li><b>File: utilities/../src/moul/file/kiimage.py:267</b><br/><pre> # XXX: move checks to copy method! -base-707-base-370-base-107- if not os.path.isfile(fixed): -base-708-base-371-base-108- self._tocheck.append((ki, fixed)) -base-709-base-372-base-109- continue -base:710:base:373:base:110:</pre></li><li><b>File: utilities/../src/moul/file/wdysini.py:157</b><br/><pre> # TODO: write me -base-711-base-374-base-111- pass -base-712-base-375-base-112- -base-713-base-376-base-113-class Constrain(object): -base:714:base:377:base:114:</pre></li><li><b>File: utilities/../src/moul/file/wdysini.py:554</b><br/><pre> 'Audio.SetDeviceName' : (QuotedString, Constrain()), # TODO: add check -base-715-base-378-base-115- 'Audio.SetChannelVolume GUI' : (FloatString, MinMax(0.0, 1.0)), # 0-100%, no ui -base-716-base-379-base-116- # microphon missing -> OS mixer -base-717-base-380-base-117- } -base:718:base:381:base:118:</pre></li><li><b>File: utilities/../src/moul/file/wdysini.py:642</b><br/><pre> # TODO: microphon needs an extra handler. The mic slider changes the OS mixer. -base-719-base-382-base-119- -base-720-base-383-base-120-class GraphicsIni(ConfFile): -base-721-base-384-base-121- _filename = 'graphics.ini' -base:722:base:385:base:122:</pre></li><li><b>File: utilities/../src/moul/file/kiimage.py~:112</b><br/><pre> # XXX use struct -base-723-base-386-base-123- if header is None: -base-724-base-387-base-124- fd = self._fd -base-725-base-388-base-125- fd.seek(0) -base:726:base:389:base:126:</pre></li><li><b>File: utilities/../src/moul/file/kiimage.py~:127</b><br/><pre> # XXX use struct -base-727-base-390-base-127- if size is None: -base-728-base-391-base-128- size = self.getFileSize() -base-729-base-392-base-129- leading = 4* [None] -base:730:base:393:base:130:</pre></li><li><b>File: utilities/../src/moul/file/kiimage.py~:267</b><br/><pre> # XXX: move checks to copy method! -base-731-base-394-base-131- if not os.path.isfile(fixed): -base-732-base-395-base-132- self._tocheck.append((ki, fixed)) -base-733-base-396-base-133- else: -base:734:base:397:base:134:</pre></li><li><b>File: utilities/../src/moul/file/wdysini.py~:157</b><br/><pre> # TODO: write me -base-735-base-398-base-135- pass -base-736-base-399-base-136- -base-737-base-400-base-137-class Constrain(object): -base:738:base:401:base:138:</pre></li><li><b>File: utilities/../src/moul/file/wdysini.py~:554</b><br/><pre> 'Audio.SetDeviceName' : (QuotedString, Constrain()), # TODO: add check -base-739-base-402-base-139- 'Audio.SetChannelVolume GUI' : (FloatString, MinMax(0.0, 1.0)), # 0-100%, no ui -base-740-base-403-base-140- # microphon missing -> OS mixer -base-741-base-404-base-141- } -base:742:base:405:base:142:</pre></li><li><b>File: utilities/../src/moul/file/wdysini.py~:642</b><br/><pre> # TODO: microphon needs an extra handler. The mic slider changes the OS mixer. -base-743-base-406-base-143- -base-744-base-407-base-144-class GraphicsIni(ConfFile): -base-745-base-408-base-145- _filename = 'graphics.ini' -base:746:base:409:base:146:</pre></li><li><b>File: utilities/../src/moul/file/chatlog.py~:208</b><br/><pre> # TODO: inefficient, compare list with directory content -base-747-base-410-base-147- if not os.path.isdir(logdir): -base-748-base-411-base-148- LOG.warning("%s is not a directory" % logdir) -base-749-base-412-base-149- return -base:750:base:413:base:150:</pre></li><li><b>File: utilities/../src/moul/file/directory.py:59</b><br/><pre> # TODO: fnmatch -base-751-base-414-base-151- return len([name for name in os.listdir(path) -base-752-base-415-base-152- if os.path.isfile(os.path.join(path, name))]) -base-753-base-416-base-153- -base:754:base:417:base:154:</pre></li><li><b>File: utilities/../src/moul/file/directory.py~:59</b><br/><pre> # TODO: fnmatch -base-755-base-418-base-155- return len([name for name in os.listdir(path) -base-756-base-419-base-156- if os.path.isfile(os.path.join(path, name))]) -base-757-base-420-base-157- -base:758:base:421:base:158:</pre></li><li><b>File: utilities/../src/moul/crypt/.svn/text-base/whatdoyousee.py.svn-base:77</b><br/><pre> # XXX: dos format -base-759-base-422-base-159-base-78- return data.replace("\r\n", "\n") -base-760-base-423-base-160-base-79- -base-761-base-424-base-161-base-80-def encryptWDYS(instr, fout): -base:762:base:425:base:162:</pre></li><li><b>File: utilities/../src/moul/crypt/.svn/text-base/whatdoyousee.py.svn-base:87</b><br/><pre> # XXX: dos format -base-763-base-426-base-163-base-88- instr = instr.replace("\n", "\r\n") -base-764-base-427-base-164-base-89- fout.seek(0) -base-765-base-428-base-165-base-90- fout.write(HEADER) -base:766:base:429:base:166:</pre></li><li><b>File: utilities/../src/moul/crypt/.svn/text-base/elf.py.svn-base:71</b><br/><pre> # XXX NotImplemented -base-767-base-430-base-167-base-72- raise NotImplementedError -base-768-base-431-base-168-base-73- -base-769-base-432-base-169-base-74-def decipher(crypt, size, key): -base:770:base:433:base:170:</pre></li><li><b>File: utilities/../src/moul/crypt/whatdoyousee.py:77</b><br/><pre> # XXX: dos format -base-771-base-434-base-171- return data.replace("\r\n", "\n") -base-772-base-435-base-172- -base-773-base-436-base-173-def encryptWDYS(instr, fout): -base:774:base:437:base:174:</pre></li><li><b>File: utilities/../src/moul/crypt/whatdoyousee.py:87</b><br/><pre> # XXX: dos format -base-775-base-438-base-175- instr = instr.replace("\n", "\r\n") -base-776-base-439-base-176- fout.seek(0) -base-777-base-440-base-177- fout.write(HEADER) -base:778:base:441:base:178:</pre></li><li><b>File: utilities/../src/moul/crypt/elf.py:71</b><br/><pre> # XXX NotImplemented -base-779-base-442-base-179- raise NotImplementedError -base-780-base-443-base-180- -base-781-base-444-base-181-def decipher(crypt, size, key): -base:782:base:445:base:182:</pre></li><li><b>File: utilities/../src/moul/qt/.svn/text-base/mainwindow.py.svn-base:149</b><br/><pre> # FIXME: signal doesn't do anything -base-783-base-446-base-183-base-150- self.emit(SIGNAL("close()")) -base-784-base-447-base-184-base-151- event.accept() -base-785-base-448-base-185-base-152- event.ignore() -base:786:base:449:base:186:</pre></li><li><b>File: utilities/../src/moul/qt/.svn/text-base/mainwindow.py.svn-base:250</b><br/><pre> del self._kiimage_threadlet# TODO: other message box -base-787-base-450-base-187-base-251- del self._kiimage_progressbar -base-788-base-451-base-188-base-252- self.pb_kiimage_repair.setEnabled(True) -base-789-base-452-base-189-base-253- mb = qtutils.infoMB(self, -base:790:base:453:base:190:</pre></li><li><b>File: utilities/../src/moul/qt/.svn/text-base/mainwindow.py.svn-base:345</b><br/><pre> # TODO: change timer from every second to every minute -base-791-base-454-base-191-base-346- self._timezone_timer = timer = QtCore.QTimer(self) -base-792-base-455-base-192-base-347- timer.setInterval(1000) # 1 sec -base:793:base:456:base:193:base:348: # TODO: needs optimization? run only when timer tab is active -base-794-base-457-base-194-base-349- self.connect(timer, SIGNAL('timeout()'), self.on_timezone_timer_timeout) -base-795-base-458-base-195-base-350- timer.start() -base-796-base-459-base-196-base-351- -base:797:base:460:base:197:</pre></li><li><b>File: utilities/../src/moul/qt/.svn/text-base/mainwindow.py.svn-base:442</b><br/><pre> # TODO: thread safety! -base-798-base-461-base-198-base-443- self.servers = servers -base-799-base-462-base-199-base-444- if not self.isRunning(): -base-800-base-463-base-200-base-445- self.start() -base:801:base:464:base:201:</pre></li><li><b>File: utilities/../src/moul/qt/.svn/text-base/mainwindow.py.svn-base:448</b><br/><pre> # TODO: thread safety! -base-802-base-465-base-202-base-449- # emit a list of names first -base-803-base-466-base-203-base-450- for server in self.servers: -base-804-base-467-base-204-base-451- self.emit(SIGNAL("server(const QString&)"), server.name) -base:8... [truncated message content] |
From: <wal...@us...> - 2007-03-23 01:31:19
|
Revision: 277 http://pymoul.svn.sourceforge.net/pymoul/?rev=277&view=rev Author: walt_scrivens Date: 2007-03-22 17:50:23 -0700 (Thu, 22 Mar 2007) Log Message: ----------- Corrected MOUL_DIR in darwin/__init__.py Modified Paths: -------------- pymoul/trunk/setup.py pymoul/trunk/src/moul/osdependent/darwin/__init__.py pymoul/trunk/src/moul/qt/ui/mainwindow.py Modified: pymoul/trunk/setup.py =================================================================== --- pymoul/trunk/setup.py 2007-03-22 18:58:49 UTC (rev 276) +++ pymoul/trunk/setup.py 2007-03-23 00:50:23 UTC (rev 277) @@ -1,121 +1,19 @@ -#!/usr/bin/env python2.5 -"""pyMoul: Python tools for Myst Online - URU Live (MOUL) +""" +This is a setup.py script generated by py2applet -TODO: Long description of pyMoul +Usage: + python setup.py py2app """ -__author__ = "Christian Heimes" -__version__ = "$Id$" -__revision__ = "$Revision$" -import sys -import os -import time -from glob import glob - -if sys.version_info < (2,5): - raise RuntimeError("Python 2.5+ required:\n%s" % sys.version) - -# boot strap easy setup -SETUPTOOLS_VERSION = "0.6c1" -from utilities.ez_setup import use_setuptools -use_setuptools(version=SETUPTOOLS_VERSION) - -# import the rest from setuptools import setup -from setuptools import find_packages -from setuptools import Extension -from utilities.compileui import compileUi +APP = ['src/moul/qt/moulqt.py'] +DATA_FILES = [] +OPTIONS = {'argv_emulation': True} -VERSION = "0.0" - -ctea = Extension('crypttea._pyxtea', - ['src/crypttea/_pyxtea.pyx', 'src/crypttea/ctea.c'] - ) -ext_modules = [ctea] -#if os.name == 'posix': -# ext_modules.append(ctea) - -setup_infos = dict( - name = "pyMoul", - version = VERSION, - description = __doc__[:__doc__.find('\n')].strip(), - long_description = '\n'.join([line - for line in __doc__.split('\n')[1:]]), - author = "Christian Heimes", - author_email = "chr...@ch...", - url = "http://sourceforge.net/projects/pymoul/", - #download_url = "http://sourceforge.net/projects/pymoul/", - license = "GPL", - keywords = "myst online uru live moul cyan", - classifiers = ( - 'Development Status :: 2 - Alpha', - 'Environment :: Win32 (MS Windows)', - 'Intended Audience :: End Users/Desktop', - 'Intended Audience :: Developers', - 'License :: OSI Approved :: GNU General Public License (GPL)', - 'Natural Language :: English', - 'Operating System :: Microsoft :: Windows', - 'Operating System :: POSIX', - 'Programming Language :: Python', - 'Topic :: Games/Entertainment :: Multi-User Dungeons (MUD)', - ), +setup( + app=APP, + data_files=DATA_FILES, + options={'py2app': OPTIONS}, + setup_requires=['py2app'], ) - -setup_options = dict( - setup_requires = ["setuptools>="+SETUPTOOLS_VERSION,], - install_requires = ["pytz>=2006p"], - data_files = [ - ('docs', list(glob('*.txt'))), - ('i18n', list(glob('src/moul/qt/i18n/pymoul_*.qm'))), - ], - package_dir = {'' : 'src'}, - packages = find_packages('src', exclude="moul.qt"), - include_package_data = True, - zip_safe = False, - namespace_packages = ['moul'], - ext_modules = ext_modules, -) - -def writeMetadata(): - dirname = os.path.dirname(__file__) - ver = os.path.join(dirname, 'version.txt') - open(ver, 'w').write(VERSION) - meta = os.path.join(dirname, 'src', 'moul', 'metadata.py') - fd = open(meta, 'w') - fd.write("# pyMoul metadata informations\n") - fd.write("# THIS FILE IS AUTO GENERATED. DO NOT ALTER!\n\n") - fd.write("__version__ = '%s'\n\n" % VERSION) - for name, value in setup_infos.items(): - if not isinstance(value, basestring): - continue - fd.write("%s = '''%s'''\n" % (name, value)) - fd.write("\nREADME = '''%s'''\n" % open('README.txt', 'r').read()) - fd.write("\nLICENSE = '''%s'''\n" % open('GPL.txt', 'r').read()) - fd.close() - -### -# Write Metadata and compile UI files -writeMetadata() -compileUi() - -kwargs = {} -kwargs.update(setup_infos) -kwargs.update(setup_options) - -# Do some windows stuff -_plat = sys.platform.startswith -if _plat('win32'): - from utilities.setup_win32 import updateSetupOptions - from utilities.setup_win32 import updateSetupOptionsQT - updateSetupOptions(kwargs) - updateSetupOptionsQT(kwargs) -elif _plat('darwin'): - from utilities.setup_darwin import updateSetupOptions - updateSetupOptions(kwargs) -elif _plat('linux2'): - kwargs['packages'].append('moul.qt') -else: - raise OSError(sys.platform) - -setup(**kwargs) Modified: pymoul/trunk/src/moul/osdependent/darwin/__init__.py =================================================================== --- pymoul/trunk/src/moul/osdependent/darwin/__init__.py 2007-03-22 18:58:49 UTC (rev 276) +++ pymoul/trunk/src/moul/osdependent/darwin/__init__.py 2007-03-23 00:50:23 UTC (rev 277) @@ -31,7 +31,7 @@ LOG.warning('Mac/Darwin support is experimental') HOME = os.path.expanduser('~') -MOUL_DIR = "%s/Library/Preferences/UruLive Preferences/p_drive/My Documents/Uru Live" % HOME +MOUL_DIR = "%s/Library/Preferences/Myst Online Preferences/p_drive/My Documents/Uru Live" % HOME #APP_NAME = "Uru Live.app" APP_NAME = "Myst Online.app" DATA_DIR = "Contents/Resources/Myst Online.app/Contents/Resources/transgaming/c_drive/Program Files/Uru Live" Modified: pymoul/trunk/src/moul/qt/ui/mainwindow.py =================================================================== --- pymoul/trunk/src/moul/qt/ui/mainwindow.py 2007-03-22 18:58:49 UTC (rev 276) +++ pymoul/trunk/src/moul/qt/ui/mainwindow.py 2007-03-23 00:50:23 UTC (rev 277) @@ -2,7 +2,7 @@ # Form implementation generated from reading ui file './src/moul/qt/ui/mainwindow.ui' # -# Created: Wed Mar 21 13:00:59 2007 +# Created: Wed Mar 21 14:50:01 2007 # by: PyQt4 UI code generator 4.1.1 # # WARNING! All changes made in this file will be lost! This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ti...@us...> - 2007-01-25 18:50:40
|
Revision: 77 http://pymoul.svn.sourceforge.net/pymoul/?rev=77&view=rev Author: tiran Date: 2007-01-25 10:50:37 -0800 (Thu, 25 Jan 2007) Log Message: ----------- Added localization document browser Modified Paths: -------------- pymoul/trunk/Makefile pymoul/trunk/src/moul/file/localization.py pymoul/trunk/src/moul/qt/mainwindow.py pymoul/trunk/src/moul/qt/ui/mainwindow.py pymoul/trunk/src/moul/qt/ui/mainwindow.ui Added Paths: ----------- pymoul/trunk/src/moul/qt/localization.py Modified: pymoul/trunk/Makefile =================================================================== --- pymoul/trunk/Makefile 2007-01-25 15:25:33 UTC (rev 76) +++ pymoul/trunk/Makefile 2007-01-25 18:50:37 UTC (rev 77) @@ -25,7 +25,7 @@ run: compileui PYTHONPATH="src" $(PYTHON) src/moul/qt/moulqt.py -runexe: compileui py2exe +exerun: compileui py2exe dist/moulqt.exe compileui: Modified: pymoul/trunk/src/moul/file/localization.py =================================================================== --- pymoul/trunk/src/moul/file/localization.py 2007-01-25 15:25:33 UTC (rev 76) +++ pymoul/trunk/src/moul/file/localization.py 2007-01-25 18:50:37 UTC (rev 77) @@ -33,16 +33,24 @@ from xml.sax import make_parser from xml.sax.handler import feature_namespaces -from moul.log import LOG +from moul.log import getLogger +LOG = getLogger('moul loc') -def _add(d, key, value): +def _addList(d, key, value): lst = d.setdefault(key, []) lst.append(value) +def _addTree(d, lang, age, setname, element, key): + dlang = d.setdefault(lang, {}) + dage = dlang.setdefault(age, {}) + dset = dage.setdefault(setname, {}) + dset[element] = key + class TranslationRegistry(dict): """Registry for Translation objects""" - __slot__ = ('_bylanguage', '_byage', '_byset', '_byelement') + __slot__ = ('_bylanguage', '_byage', '_byset', '_byelement', '_tree', + '_ignore_age') def __new__(cls, *args, **kwargs): self = dict.__new__(cls, *args, **kwargs) @@ -50,6 +58,8 @@ self._byage = {} self._byset = {} self._byelement = {} + self._tree = {} + self._ignore_age = [u'OptionsMenu', u'ACA', u'Global', u'KI'] return self def register(self, translation): @@ -59,23 +69,46 @@ (translation.fname, str(key))) LOG.error("TranslationRegistry: %s" % msg) raise KeyError(msg) - _add(self._bylanguage, translation.language, key) - _add(self._byage, translation.age, key) - _add(self._byset, translation.set, key) - _add(self._byelement, translation.element, key) + if translation.age in self._ignore_age: + return + _addList(self._bylanguage, translation.language, key) + _addList(self._byage, translation.age, key) + _addList(self._byset, translation.set, key) + _addList(self._byelement, translation.element, key) + _addTree(self._tree, translation.language, translation.age, + translation.set, translation.element, key) self[key] = translation def __setitem__(self, key, translation): assert key == translation.key() dict.__setitem__(self, key, translation) + def __repr__(self): + return "<%s at %s with %i elements" % (self.__class__.__name__, + id(self), len(self)) + def clear(self): dict.clear(self) self._bylanguage.clear() self._byage.clear() self._byset.clear() self._byelement.clear() + + def languages(self): + return sorted(self._bylanguage.keys()) + def ages(self): + return sorted(self._byage.keys()) + + def sets(self): + return sorted(self._byset.keys()) + + def elements(self): + return sorted(self._byelement.keys()) + + def tree(self): + return self._tree + translationRegistry = TranslationRegistry() registerTranslation = translationRegistry.register @@ -95,11 +128,12 @@ self._set = set self._element = element self._language = language - LOG.debug("New translation file(%s): %s" % (fname, self.key)) + self._fname = fname + #LOG.debug("New translation file(%s): %s" % (fname, self.key)) return self def key(self): - return (self._age, self._set, self._element, self._language) + return (self._language, self._age, self._set, self._element) @property def language(self): return self._language @@ -113,6 +147,9 @@ @property def element(self): return self._element + @property + def fname(self): return self._fname + def __str__(self): return self.content @@ -207,3 +244,18 @@ files.append(fname) return {'files' : files, 'errors' : errors } + +def _test(path="D:/games/MystOnline/dat", out=False): + from pprint import pprint + files, errors = parseLocDirectory(path, clear=True) + if out: + print errors + tr = translationRegistry + print tr.languages() + print tr.ages() + print tr.sets() + print tr.elements() + pprint(tr.tree()) + +if __name__ == '__main__': + _test(out=True) Added: pymoul/trunk/src/moul/qt/localization.py =================================================================== --- pymoul/trunk/src/moul/qt/localization.py (rev 0) +++ pymoul/trunk/src/moul/qt/localization.py 2007-01-25 18:50:37 UTC (rev 77) @@ -0,0 +1,131 @@ +# 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 localization / documents +""" +__author__ = "Christian Heimes" +__version__ = "$Id$" +__revision__ = "$Revision$" + +import sys + +from PyQt4 import QtGui +from PyQt4 import QtCore +from PyQt4.QtCore import Qt +from PyQt4.QtCore import pyqtSignature +from PyQt4.QtCore import SIGNAL + +from moul.config import lookupDir +from moul.file.localization import translationRegistry as tr +from moul.file.localization import parseLocDirectory +from moul.log import getLogger +from moul.log import signalLogDecorator + +LOG = getLogger('moul.loc') + +def insertDummyQ(lst): + dummy = type(lst)(["<choose>"]) + return QtCore.QStringList(dummy+lst) + +class LocalizationMixin(object): + """Mixin for documents tab + """ + def _documents_init(self): + self.tab_documents.setEnabled(True) + locDir = lookupDir('loc') + parseLocDirectory(locDir) + + self._documents_state = {} + + self.connect(self.cb_doc_language, SIGNAL("currentIndexChanged(int)"), + self.on_cb_doc_language_currentIndexChanged) + self.connect(self.cb_doc_age, SIGNAL("currentIndexChanged(int)"), + self.on_cb_doc_age_currentIndexChanged) + self.connect(self.cb_doc_set, SIGNAL("currentIndexChanged(int)"), + self.on_cb_doc_set_currentIndexChanged) + #self.connect(self.cb_doc_element, SIGNAL("currentIndexChanged(int)"), + # self.on_cb_doc_element_currentIndexChanged) + + languages = sorted(tr.languages()) + self._documents_state['languages'] = languages + self.cb_doc_language.addItems(insertDummyQ(languages)) + self.cb_doc_language.setCurrentIndex(0) + + def _documents_clear(self, name): + names = ['language', 'age', 'set', 'element', 'doc'] + for name in names[names.index(name):]: + if name == 'doc': + qobj = self.te_doc_view + else: + qobj = getattr(self, 'cb_doc_%s' % name) + qobj.clear() + qobj.setEnabled(False) + + @pyqtSignature("int") + @signalLogDecorator(LOG) + def on_cb_doc_language_currentIndexChanged(self, idx): + self._documents_clear('age') + if idx <= 0: + return # <choose> + lang = self._documents_state['languages'][idx-1] + ages = sorted(tr._tree[lang].keys()) + self._documents_state['curlanguage'] = lang + self._documents_state['ages'] = ages + self.cb_doc_age.addItems(insertDummyQ(ages)) + self.cb_doc_age.setEnabled(True) + + @pyqtSignature("int") + @signalLogDecorator(LOG) + def on_cb_doc_age_currentIndexChanged(self, idx): + self._documents_clear('set') + if idx <= 0: + return # <choose> + lang = self._documents_state['curlanguage'] + age = self._documents_state['ages'][idx-1] + sets = sorted(tr._tree[lang][age].keys()) + self._documents_state['curage'] = (lang, age) + self._documents_state['sets'] = sets + self.cb_doc_set.addItems(insertDummyQ(sets)) + self.cb_doc_set.setEnabled(True) + + @pyqtSignature("int") + @signalLogDecorator(LOG) + def on_cb_doc_set_currentIndexChanged(self, idx): + self._documents_clear('element') + if idx <= 0: + return # <choose> + lang, age = self._documents_state['curage'] + set = self._documents_state['sets'][idx-1] + elements = sorted(tr._tree[lang][age][set].keys()) + self._documents_state['curset'] = (lang, age, set) + self._documents_state['elements'] = elements + self.cb_doc_element.addItems(insertDummyQ(elements)) + self.cb_doc_element.setEnabled(True) + + @pyqtSignature("int") + @signalLogDecorator(LOG) + def on_cb_doc_element_currentIndexChanged(self, idx): + self._documents_clear('doc') + if idx <= 0: + return # <choose> + lang, age, set = self._documents_state['curset'] + element = self._documents_state['elements'][idx-1] + translation = tr[(lang, age, set, element)] + qstr = QtCore.QString(translation) + self.te_doc_view.setPlainText(qstr) + self.te_doc_view.setEnabled(True) + Property changes on: pymoul/trunk/src/moul/qt/localization.py ___________________________________________________________________ Name: svn:eol-style + native Modified: pymoul/trunk/src/moul/qt/mainwindow.py =================================================================== --- pymoul/trunk/src/moul/qt/mainwindow.py 2007-01-25 15:25:33 UTC (rev 76) +++ pymoul/trunk/src/moul/qt/mainwindow.py 2007-01-25 18:50:37 UTC (rev 77) @@ -32,6 +32,7 @@ from PyQt4.QtCore import SIGNAL from moul.qt.ui.mainwindow import Ui_MainWindow +from moul.qt.localization import LocalizationMixin from moul.config import lookupDir from moul.file.wdysini import AudioIni from moul.file.wdysini import GraphicsIni @@ -44,7 +45,7 @@ LOG = getLogger('moul.qt') -class MainWindow(QtGui.QMainWindow, Ui_MainWindow): +class MainWindow(QtGui.QMainWindow, Ui_MainWindow, LocalizationMixin): def __init__(self): QtGui.QMainWindow.__init__(self) # Set up the user interface from Designer. @@ -66,6 +67,8 @@ self._audio_init() self._ping_init() self._systray_init() + self.tab_documents.setEnabled(False) + #self._documents_init() def _notimplemented(self): """TODO: remove me Modified: pymoul/trunk/src/moul/qt/ui/mainwindow.py =================================================================== --- pymoul/trunk/src/moul/qt/ui/mainwindow.py 2007-01-25 15:25:33 UTC (rev 76) +++ pymoul/trunk/src/moul/qt/ui/mainwindow.py 2007-01-25 18:50:37 UTC (rev 77) @@ -2,7 +2,7 @@ # Form implementation generated from reading ui file 'src\moul\qt\ui\mainwindow.ui' # -# Created: Wed Jan 24 19:26:57 2007 +# Created: Thu Jan 25 19:49:10 2007 # by: PyQt4 UI code generator 4.1.1 # # WARNING! All changes made in this file will be lost! @@ -682,6 +682,67 @@ self.text_ping.setObjectName("text_ping") self.tabwidget.addTab(self.tab_ping,"") + self.tab_documents = QtGui.QWidget() + self.tab_documents.setObjectName("tab_documents") + + self.gb_documents = QtGui.QGroupBox(self.tab_documents) + self.gb_documents.setGeometry(QtCore.QRect(10,0,431,341)) + self.gb_documents.setObjectName("gb_documents") + + self.gridLayout_2 = QtGui.QWidget(self.gb_documents) + self.gridLayout_2.setGeometry(QtCore.QRect(10,20,411,100)) + self.gridLayout_2.setObjectName("gridLayout_2") + + self.gridlayout1 = QtGui.QGridLayout(self.gridLayout_2) + self.gridlayout1.setMargin(0) + self.gridlayout1.setSpacing(6) + self.gridlayout1.setObjectName("gridlayout1") + + self.label_2 = QtGui.QLabel(self.gridLayout_2) + self.label_2.setObjectName("label_2") + self.gridlayout1.addWidget(self.label_2,1,0,1,1) + + self.label_7 = QtGui.QLabel(self.gridLayout_2) + self.label_7.setObjectName("label_7") + self.gridlayout1.addWidget(self.label_7,3,0,1,1) + + self.label = QtGui.QLabel(self.gridLayout_2) + self.label.setMinimumSize(QtCore.QSize(80,0)) + self.label.setObjectName("label") + self.gridlayout1.addWidget(self.label,0,0,1,1) + + self.label_3 = QtGui.QLabel(self.gridLayout_2) + self.label_3.setObjectName("label_3") + self.gridlayout1.addWidget(self.label_3,2,0,1,1) + + self.cb_doc_language = QtGui.QComboBox(self.gridLayout_2) + + sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Policy(7),QtGui.QSizePolicy.Policy(0)) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.cb_doc_language.sizePolicy().hasHeightForWidth()) + self.cb_doc_language.setSizePolicy(sizePolicy) + self.cb_doc_language.setObjectName("cb_doc_language") + self.gridlayout1.addWidget(self.cb_doc_language,0,1,1,1) + + self.cb_doc_age = QtGui.QComboBox(self.gridLayout_2) + self.cb_doc_age.setObjectName("cb_doc_age") + self.gridlayout1.addWidget(self.cb_doc_age,1,1,1,1) + + self.cb_doc_set = QtGui.QComboBox(self.gridLayout_2) + self.cb_doc_set.setObjectName("cb_doc_set") + self.gridlayout1.addWidget(self.cb_doc_set,2,1,1,1) + + self.cb_doc_element = QtGui.QComboBox(self.gridLayout_2) + self.cb_doc_element.setObjectName("cb_doc_element") + self.gridlayout1.addWidget(self.cb_doc_element,3,1,1,1) + + self.te_doc_view = QtGui.QTextEdit(self.gb_documents) + self.te_doc_view.setGeometry(QtCore.QRect(10,130,411,201)) + self.te_doc_view.setReadOnly(True) + self.te_doc_view.setObjectName("te_doc_view") + self.tabwidget.addTab(self.tab_documents,"") + self.tab_about = QtGui.QWidget() self.tab_about.setObjectName("tab_about") @@ -697,7 +758,7 @@ MainWindow.setStatusBar(self.statusbar) self.retranslateUi(MainWindow) - self.tabwidget.setCurrentIndex(0) + self.tabwidget.setCurrentIndex(4) QtCore.QObject.connect(self.main_buttonbox,QtCore.SIGNAL("rejected()"),MainWindow.close) QtCore.QMetaObject.connectSlotsByName(MainWindow) @@ -759,6 +820,12 @@ "</style></head><body style=\" font-family:\'MS Shell Dlg 2\'; font-size:8.25pt; font-weight:400; font-style:normal; text-decoration:none;\">\n" "<p style=\"-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:8pt;\"></p></body></html>", None, QtGui.QApplication.UnicodeUTF8)) self.tabwidget.setTabText(self.tabwidget.indexOf(self.tab_ping), QtGui.QApplication.translate("MainWindow", "Servers", None, QtGui.QApplication.UnicodeUTF8)) + self.gb_documents.setTitle(QtGui.QApplication.translate("MainWindow", "Browse in game documents", None, QtGui.QApplication.UnicodeUTF8)) + self.label_2.setText(QtGui.QApplication.translate("MainWindow", "Age", None, QtGui.QApplication.UnicodeUTF8)) + self.label_7.setText(QtGui.QApplication.translate("MainWindow", "Element", None, QtGui.QApplication.UnicodeUTF8)) + self.label.setText(QtGui.QApplication.translate("MainWindow", "Language", None, QtGui.QApplication.UnicodeUTF8)) + self.label_3.setText(QtGui.QApplication.translate("MainWindow", "Set", None, QtGui.QApplication.UnicodeUTF8)) + self.tabwidget.setTabText(self.tabwidget.indexOf(self.tab_documents), QtGui.QApplication.translate("MainWindow", "Documents", None, QtGui.QApplication.UnicodeUTF8)) self.label_6.setText(QtGui.QApplication.translate("MainWindow", "pyMoul tools", None, QtGui.QApplication.UnicodeUTF8)) self.tabwidget.setTabText(self.tabwidget.indexOf(self.tab_about), QtGui.QApplication.translate("MainWindow", "About", None, QtGui.QApplication.UnicodeUTF8)) Modified: pymoul/trunk/src/moul/qt/ui/mainwindow.ui =================================================================== --- pymoul/trunk/src/moul/qt/ui/mainwindow.ui 2007-01-25 15:25:33 UTC (rev 76) +++ pymoul/trunk/src/moul/qt/ui/mainwindow.ui 2007-01-25 18:50:37 UTC (rev 77) @@ -147,7 +147,7 @@ <enum>QTabWidget::North</enum> </property> <property name="currentIndex" > - <number>0</number> + <number>4</number> </property> <widget class="QWidget" name="tab_graphics" > <attribute name="title" > @@ -1454,6 +1454,110 @@ </widget> </widget> </widget> + <widget class="QWidget" name="tab_documents" > + <attribute name="title" > + <string>Documents</string> + </attribute> + <widget class="QGroupBox" name="gb_documents" > + <property name="geometry" > + <rect> + <x>10</x> + <y>0</y> + <width>431</width> + <height>341</height> + </rect> + </property> + <property name="title" > + <string>Browse in game documents</string> + </property> + <widget class="QWidget" name="gridLayout_2" > + <property name="geometry" > + <rect> + <x>10</x> + <y>20</y> + <width>411</width> + <height>100</height> + </rect> + </property> + <layout class="QGridLayout" > + <property name="margin" > + <number>0</number> + </property> + <property name="spacing" > + <number>6</number> + </property> + <item row="1" column="0" > + <widget class="QLabel" name="label_2" > + <property name="text" > + <string>Age</string> + </property> + </widget> + </item> + <item row="3" column="0" > + <widget class="QLabel" name="label_7" > + <property name="text" > + <string>Element</string> + </property> + </widget> + </item> + <item row="0" column="0" > + <widget class="QLabel" name="label" > + <property name="minimumSize" > + <size> + <width>80</width> + <height>0</height> + </size> + </property> + <property name="text" > + <string>Language</string> + </property> + </widget> + </item> + <item row="2" column="0" > + <widget class="QLabel" name="label_3" > + <property name="text" > + <string>Set</string> + </property> + </widget> + </item> + <item row="0" column="1" > + <widget class="QComboBox" name="cb_doc_language" > + <property name="sizePolicy" > + <sizepolicy> + <hsizetype>7</hsizetype> + <vsizetype>0</vsizetype> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + </widget> + </item> + <item row="1" column="1" > + <widget class="QComboBox" name="cb_doc_age" /> + </item> + <item row="2" column="1" > + <widget class="QComboBox" name="cb_doc_set" /> + </item> + <item row="3" column="1" > + <widget class="QComboBox" name="cb_doc_element" /> + </item> + </layout> + </widget> + <widget class="QTextEdit" name="te_doc_view" > + <property name="geometry" > + <rect> + <x>10</x> + <y>130</y> + <width>411</width> + <height>201</height> + </rect> + </property> + <property name="readOnly" > + <bool>true</bool> + </property> + </widget> + </widget> + </widget> <widget class="QWidget" name="tab_about" > <attribute name="title" > <string>About</string> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ti...@us...> - 2007-01-26 15:15:02
|
Revision: 82 http://pymoul.svn.sourceforge.net/pymoul/?rev=82&view=rev Author: tiran Date: 2007-01-26 07:15:00 -0800 (Fri, 26 Jan 2007) Log Message: ----------- Fixed exe build Check for isMoulRunning inside QT ui Modified Paths: -------------- pymoul/trunk/setup_win32.py pymoul/trunk/src/moul/log.py pymoul/trunk/src/moul/osdependent/__init__.py pymoul/trunk/src/moul/qt/moulqt.py Modified: pymoul/trunk/setup_win32.py =================================================================== --- pymoul/trunk/setup_win32.py 2007-01-26 14:55:52 UTC (rev 81) +++ pymoul/trunk/setup_win32.py 2007-01-26 15:15:00 UTC (rev 82) @@ -68,11 +68,12 @@ pexe = kw['options'].setdefault('py2exe', {}) pexe['compressed'] = 100 # compress zip file pexe['optimize'] = 0 # 0,1,2 - pexe['includes'] = ['sip', 'PyQt4', 'encodings', 'encodings.*'] + pexe['includes'] = ['sip', 'PyQt4', 'encodings', 'encodings.*', + 'moul.osdependent.win32', 'moul.osdependent.win32.*'] # SSL currently not in use but imported by socket pexe['excludes'] = ['_ssl'] # added by platform but not yet required - pexe['excludes'].extend(('win32pipe', 'win32api', 'win32con', 'win32evtlog')) + #pexe['excludes'].extend(('win32pipe', 'win32api', 'win32con', 'win32evtlog')) # added by logging.handlers.SMTPHandler but not yet required pexe['excludes'].append('smtplib') # UPX Modified: pymoul/trunk/src/moul/log.py =================================================================== --- pymoul/trunk/src/moul/log.py 2007-01-26 14:55:52 UTC (rev 81) +++ pymoul/trunk/src/moul/log.py 2007-01-26 15:15:00 UTC (rev 82) @@ -113,12 +113,12 @@ #_systemInfo() else: _installMemoryHdlr() - # Redirect stdout and stderr to logger when running as frozen app - sys.stdout = LoggingStdout(getLogger('stdout').info) - sys.stderr = LoggingStdout(getLogger('stderr').error) _systemInfo() _installFileHdlr() _removeMemoryHdlr() + # Redirect stdout and stderr to logger when running as frozen app + #sys.stdout = LoggingStdout(getLogger('stdout').info) + #sys.stderr = LoggingStdout(getLogger('stderr').error) __LOG_SIGNALS__ = not __FROZEN__ def signalLogDecorator(__logger__): Modified: pymoul/trunk/src/moul/osdependent/__init__.py =================================================================== --- pymoul/trunk/src/moul/osdependent/__init__.py 2007-01-26 14:55:52 UTC (rev 81) +++ pymoul/trunk/src/moul/osdependent/__init__.py 2007-01-26 15:15:00 UTC (rev 82) @@ -35,7 +35,10 @@ import os import sys +from moul.log import getLogger +LOG = getLogger('moul.osdependent') + # a program under py2exe is sys.frozen __FROZEN__ = bool(getattr(sys, 'frozen', False)) # OS stuff Modified: pymoul/trunk/src/moul/qt/moulqt.py =================================================================== --- pymoul/trunk/src/moul/qt/moulqt.py 2007-01-26 14:55:52 UTC (rev 81) +++ pymoul/trunk/src/moul/qt/moulqt.py 2007-01-26 15:15:00 UTC (rev 82) @@ -29,21 +29,34 @@ from moul.qt.mainwindow import MainWindow from moul.osdependent.singleapp import SimpleSingleApp from moul.config import getPyMoulDataDir +from moul.osdependent import isMoulRunning +def critical(self, title, text): + """Critical warning! + """ + mb = QtGui.QMessageBox() + mb.setWindowIcon(QtGui.QIcon(":/resources/uru_icon_32x32.png")) + mb.setIcon(QtGui.QMessageBox.Critical) + mb.setWindowTitle(self.trUtf8(title)) + mb.setText(self.trUtf8(text)) + mb.setStandardButtons(QtGui.QMessageBox.Close) + return mb + def main(*args): app = QtGui.QApplication(*args) singleapp = SimpleSingleApp('pymoulqt', path=getPyMoulDataDir()) try: singleapp.acquire() except OSError: - mb = QtGui.QMessageBox() - mb.setWindowIcon(QtGui.QIcon(":/resources/uru_icon_32x32.png")) - mb.setIcon(QtGui.QMessageBox.Critical) - mb.setWindowTitle(app.trUtf8("Already running")) - mb.setText(app.trUtf8("""An instance of pyMoul QT is already running!""")) - mb.setStandardButtons(QtGui.QMessageBox.Close) + mb = critical(app, "pyMoul QT already running", + """An instance of pyMoul QT is already running!""") mb.exec_() sys.exit(1) + if isMoulRunning(): + mb = critical(app, "URU is running", + """URU is running! Please close Uru or Uru Launcher first.""") + mb.exec_() + sys.exit(2) mainWindow = MainWindow() mainWindow.show() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |