pymoul-svn Mailing List for pyMoul (Page 8)
Status: Alpha
Brought to you by:
tiran
You can subscribe to this list here.
2007 |
Jan
(89) |
Feb
(108) |
Mar
(62) |
Apr
(8) |
May
(9) |
Jun
(2) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
---|
From: <ti...@us...> - 2007-02-02 17:45:44
|
Revision: 124 http://pymoul.svn.sourceforge.net/pymoul/?rev=124&view=rev Author: tiran Date: 2007-02-02 09:45:42 -0800 (Fri, 02 Feb 2007) Log Message: ----------- Fixed errors introduced by the run of importorder / importcheck Modified Paths: -------------- pymoul/trunk/src/moul/__init__.py 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/moulqt_rc.py pymoul/trunk/src/moul/qt/ui/simpleprogressbar.py pymoul/trunk/src/moul/time/cavern.py Modified: pymoul/trunk/src/moul/__init__.py =================================================================== --- pymoul/trunk/src/moul/__init__.py 2007-02-02 17:37:43 UTC (rev 123) +++ pymoul/trunk/src/moul/__init__.py 2007-02-02 17:45:42 UTC (rev 124) @@ -3,8 +3,6 @@ try: __import__('pkg_resources').declare_namespace(__name__) except ImportError: - from pkgutil import extend_p - -ath + from pkgutil import extend_path __path__ = extend_path(__path__, __name__) Modified: pymoul/trunk/src/moul/file/localization.py =================================================================== --- pymoul/trunk/src/moul/file/localization.py 2007-02-02 17:37:43 UTC (rev 123) +++ pymoul/trunk/src/moul/file/localization.py 2007-02-02 17:45:42 UTC (rev 124) @@ -17,9 +17,9 @@ # """LOC file parser """ +from __future__ import with_statement import glob import os -from __future__ import with_statement from xml.sax import ContentHandler from xml.sax import make_parser from xml.sax.handler import feature_namespaces Modified: pymoul/trunk/src/moul/qt/mainwindow.py =================================================================== --- pymoul/trunk/src/moul/qt/mainwindow.py 2007-02-02 17:37:43 UTC (rev 123) +++ pymoul/trunk/src/moul/qt/mainwindow.py 2007-02-02 17:45:42 UTC (rev 124) @@ -18,13 +18,14 @@ """Moul QT GUI main windows """ +from __future__ import with_statement + import sys from PyQt4 import QtCore from PyQt4 import QtGui from PyQt4.QtCore import Qt from PyQt4.QtCore import SIGNAL from PyQt4.QtCore import pyqtSignature -from __future__ import with_statement from moul import metadata from moul.config import lookupDir Modified: pymoul/trunk/src/moul/qt/ui/mainwindow.py =================================================================== --- pymoul/trunk/src/moul/qt/ui/mainwindow.py 2007-02-02 17:37:43 UTC (rev 123) +++ pymoul/trunk/src/moul/qt/ui/mainwindow.py 2007-02-02 17:45:42 UTC (rev 124) @@ -1,17 +1,15 @@ # -*- coding: utf-8 -*- -# Form implementation generated from reading ui file 'src/moul/qt/ui/mainwindow.ui' +# Form implementation generated from reading ui file './src/moul/qt/ui/mainwindow.ui' # -# Created: Fri Feb 2 17:26:46 2007 +# Created: Fri Feb 2 18:43:30 2007 # by: PyQt4 UI code generator 4.1.1 # -# WARNING! All changes made in this file will be losimport sys -from PyQt4 import QtCore, Qt +# WARNING! All changes made in this file will be lost! -t! +import sys +from PyQt4 import QtCore, QtGui -Gui - class Ui_MainWindow(object): def setupUi(self, MainWindow): MainWindow.setObjectName("MainWindow") Modified: pymoul/trunk/src/moul/qt/ui/moulqt_rc.py =================================================================== --- pymoul/trunk/src/moul/qt/ui/moulqt_rc.py 2007-02-02 17:37:43 UTC (rev 123) +++ pymoul/trunk/src/moul/qt/ui/moulqt_rc.py 2007-02-02 17:45:42 UTC (rev 124) @@ -2,15 +2,13 @@ # Resource object code # -# Created: So Jan 28 18:10:39 2007 +# Created: Fr Feb 2 18:43:48 2007 # by: The Resource Compiler for PyQt (Qt v4.2.0) # -# WARNING! All changes made in this file will be losfrom PyQt4 import QtC +# WARNING! All changes made in this file will be lost! -t! +from PyQt4 import QtCore -ore - qt_resource_data = "\ \x00\x00\x07\xea\ \x89\ Modified: pymoul/trunk/src/moul/qt/ui/simpleprogressbar.py =================================================================== --- pymoul/trunk/src/moul/qt/ui/simpleprogressbar.py 2007-02-02 17:37:43 UTC (rev 123) +++ pymoul/trunk/src/moul/qt/ui/simpleprogressbar.py 2007-02-02 17:45:42 UTC (rev 124) @@ -1,17 +1,15 @@ # -*- coding: utf-8 -*- -# Form implementation generated from reading ui file 'src/moul/qt/ui/simpleprogressbar.ui' +# Form implementation generated from reading ui file './src/moul/qt/ui/simpleprogressbar.ui' # -# Created: Fri Feb 2 15:36:30 2007 +# Created: Fri Feb 2 18:43:31 2007 # by: PyQt4 UI code generator 4.1.1 # -# WARNING! All changes made in this file will be losimport sys -from PyQt4 import QtCore, Qt +# WARNING! All changes made in this file will be lost! -t! +import sys +from PyQt4 import QtCore, QtGui -Gui - class Ui_SimpleProgressbar(object): def setupUi(self, SimpleProgressbar): SimpleProgressbar.setObjectName("SimpleProgressbar") Modified: pymoul/trunk/src/moul/time/cavern.py =================================================================== --- pymoul/trunk/src/moul/time/cavern.py 2007-02-02 17:37:43 UTC (rev 123) +++ pymoul/trunk/src/moul/time/cavern.py 2007-02-02 17:45:42 UTC (rev 124) @@ -24,20 +24,17 @@ __all__ = ['CavernTime'] from datetime import datetime -from pytz import all_timezones -from pytz import timezone -from pytz import utc as UTC from moul.osdependent import __FROZEN__ - # pytz is an egg if not __FROZEN__: import pkg_resources pkg_resources.require("pytz>=2006p") -#from pytz import common_timezones +from pytz import all_timezones +from pytz import timezone +from pytz import utc as UTC - ## not used in the current version #SUPPORTED_TZ = ('America', 'Canada', 'Etc', 'Europe', 'US') #ADDITIONAL_TZ = ('GMT', 'UTC') This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ti...@us...> - 2007-02-02 17:37:44
|
Revision: 123 http://pymoul.svn.sourceforge.net/pymoul/?rev=123&view=rev Author: tiran Date: 2007-02-02 09:37:43 -0800 (Fri, 02 Feb 2007) Log Message: ----------- Ups - forgot to check in __init__.py Added Paths: ----------- pymoul/trunk/utilities/__init__.py Added: pymoul/trunk/utilities/__init__.py =================================================================== --- pymoul/trunk/utilities/__init__.py (rev 0) +++ pymoul/trunk/utilities/__init__.py 2007-02-02 17:37:43 UTC (rev 123) @@ -0,0 +1,2 @@ +# package + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ti...@us...> - 2007-02-02 17:34:18
|
Revision: 122 http://pymoul.svn.sourceforge.net/pymoul/?rev=122&view=rev Author: tiran Date: 2007-02-02 09:34:06 -0800 (Fri, 02 Feb 2007) Log Message: ----------- Added importorder.py from Zope3 Rearranged import order Modified Paths: -------------- pymoul/trunk/src/moul/__init__.py pymoul/trunk/src/moul/cli/moullauncher.py pymoul/trunk/src/moul/config/__init__.py pymoul/trunk/src/moul/config/tests/test_config.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/directory.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/test_chatlog.py pymoul/trunk/src/moul/file/tests/test_directory.py pymoul/trunk/src/moul/file/tests/test_kiimage.py pymoul/trunk/src/moul/file/tests/test_localization.py pymoul/trunk/src/moul/file/tests/test_plasmalog.py pymoul/trunk/src/moul/file/tests/test_wdysini.py pymoul/trunk/src/moul/file/tests/utils.py pymoul/trunk/src/moul/file/wdysini.py pymoul/trunk/src/moul/i18n.py pymoul/trunk/src/moul/log.py pymoul/trunk/src/moul/osdependent/__init__.py pymoul/trunk/src/moul/osdependent/darwin/__init__.py pymoul/trunk/src/moul/osdependent/linux/__init__.py pymoul/trunk/src/moul/osdependent/processinfo.py pymoul/trunk/src/moul/osdependent/singleapp.py pymoul/trunk/src/moul/osdependent/tests/test_osdependent.py pymoul/trunk/src/moul/osdependent/tests/test_processinfo.py pymoul/trunk/src/moul/osdependent/tests/test_singleapp.py pymoul/trunk/src/moul/osdependent/win32/__init__.py pymoul/trunk/src/moul/osdependent/win32/registry.py pymoul/trunk/src/moul/osdependent/win32/winpath.py pymoul/trunk/src/moul/qt/__init__.py pymoul/trunk/src/moul/qt/errorhandler.py pymoul/trunk/src/moul/qt/localization.py pymoul/trunk/src/moul/qt/mainwindow.py pymoul/trunk/src/moul/qt/moulqt.py pymoul/trunk/src/moul/qt/simpleprogressbar.py pymoul/trunk/src/moul/qt/threadlet.py pymoul/trunk/src/moul/qt/ui/mainwindow.py pymoul/trunk/src/moul/qt/ui/moulqt_rc.py pymoul/trunk/src/moul/qt/ui/simpleprogressbar.py pymoul/trunk/src/moul/server/ping.py pymoul/trunk/src/moul/server/tests/test_ping.py pymoul/trunk/src/moul/server/tests/test_serverlist.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/test_cavern.py pymoul/trunk/src/moul/time/tests/test_dni.py Added Paths: ----------- pymoul/trunk/utilities/importorder.py Modified: pymoul/trunk/src/moul/__init__.py =================================================================== --- pymoul/trunk/src/moul/__init__.py 2007-02-02 17:22:22 UTC (rev 121) +++ pymoul/trunk/src/moul/__init__.py 2007-02-02 17:34:06 UTC (rev 122) @@ -3,6 +3,8 @@ try: __import__('pkg_resources').declare_namespace(__name__) except ImportError: - from pkgutil import extend_path + from pkgutil import extend_p + +ath __path__ = extend_path(__path__, __name__) Modified: pymoul/trunk/src/moul/cli/moullauncher.py =================================================================== --- pymoul/trunk/src/moul/cli/moullauncher.py 2007-02-02 17:22:22 UTC (rev 121) +++ pymoul/trunk/src/moul/cli/moullauncher.py 2007-02-02 17:34:06 UTC (rev 122) @@ -27,11 +27,12 @@ from optparse import OptionParser from optparse import OptionValueError -from moul.file import plasmalog -from moul.file import chatlog from moul import config from moul import metadata +from moul.file import chatlog +from moul.file import plasmalog + class MoulLauncher(object): _parser = None _options = None Modified: pymoul/trunk/src/moul/config/__init__.py =================================================================== --- pymoul/trunk/src/moul/config/__init__.py 2007-02-02 17:22:22 UTC (rev 121) +++ pymoul/trunk/src/moul/config/__init__.py 2007-02-02 17:34:06 UTC (rev 122) @@ -46,6 +46,7 @@ from moul.osdependent import getMoulUserDataDir from moul.osdependent import getPyMoulDataDir + _marker=object() # configuration Modified: pymoul/trunk/src/moul/config/tests/test_config.py =================================================================== --- pymoul/trunk/src/moul/config/tests/test_config.py 2007-02-02 17:22:22 UTC (rev 121) +++ pymoul/trunk/src/moul/config/tests/test_config.py 2007-02-02 17:34:06 UTC (rev 122) @@ -26,6 +26,7 @@ import moul.config + def test_suite(): return unittest.TestSuite(( DocTestSuite('moul.config') Modified: pymoul/trunk/src/moul/crypt/elf.py =================================================================== --- pymoul/trunk/src/moul/crypt/elf.py 2007-02-02 17:22:22 UTC (rev 121) +++ pymoul/trunk/src/moul/crypt/elf.py 2007-02-02 17:34:06 UTC (rev 122) @@ -25,6 +25,7 @@ import struct + def list2int(lst): return [ord(s) for s in lst] Modified: pymoul/trunk/src/moul/crypt/tests/test_elf.py =================================================================== --- pymoul/trunk/src/moul/crypt/tests/test_elf.py 2007-02-02 17:22:22 UTC (rev 121) +++ pymoul/trunk/src/moul/crypt/tests/test_elf.py 2007-02-02 17:34:06 UTC (rev 122) @@ -28,6 +28,7 @@ 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') Modified: pymoul/trunk/src/moul/crypt/tests/test_wdys.py =================================================================== --- pymoul/trunk/src/moul/crypt/tests/test_wdys.py 2007-02-02 17:22:22 UTC (rev 121) +++ pymoul/trunk/src/moul/crypt/tests/test_wdys.py 2007-02-02 17:34:06 UTC (rev 122) @@ -29,6 +29,7 @@ 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') Modified: pymoul/trunk/src/moul/crypt/whatdoyousee.py =================================================================== --- pymoul/trunk/src/moul/crypt/whatdoyousee.py 2007-02-02 17:22:22 UTC (rev 121) +++ pymoul/trunk/src/moul/crypt/whatdoyousee.py 2007-02-02 17:34:06 UTC (rev 122) @@ -34,6 +34,7 @@ from moul.crypt.xtea import xtea_encrypt from moul.log import getLogger + HEADER = "whatdoyousee" CROSS_REF = (0x6c0a5452, 0x03827d0f, 0x3a170b92, 0x16db7fc2) CROSS_KEY = struct.pack("<4L", *CROSS_REF) Modified: pymoul/trunk/src/moul/file/chatlog.py =================================================================== --- pymoul/trunk/src/moul/file/chatlog.py 2007-02-02 17:22:22 UTC (rev 121) +++ pymoul/trunk/src/moul/file/chatlog.py 2007-02-02 17:34:06 UTC (rev 122) @@ -35,12 +35,13 @@ import os import re from fnmatch import fnmatch +from shutil import move from stat import ST_MTIME -from shutil import move from time import localtime from moul.log import getLogger + RE_FLAGS = re.LOCALE CHAT_RE = re.compile( r"^\((?P<M>\d{1,2})/(?P<D>\d{1,2})\ " # MM/DD Modified: pymoul/trunk/src/moul/file/directory.py =================================================================== --- pymoul/trunk/src/moul/file/directory.py 2007-02-02 17:22:22 UTC (rev 121) +++ pymoul/trunk/src/moul/file/directory.py 2007-02-02 17:34:06 UTC (rev 122) @@ -23,15 +23,16 @@ import os -from moul.log import getLogger +from moul.file.chatlog import ChatlogDirectoryView from moul.file.chatlog import ChatlogMover -from moul.file.chatlog import ChatlogDirectoryView +from moul.file.kiimage import KIImageFixer +from moul.file.localization import parseLocDirectory from moul.file.plasmalog import PlasmalogZipper -from moul.file.kiimage import KIImageFixer +from moul.file.wdysini import AudioIni from moul.file.wdysini import GraphicsIni -from moul.file.wdysini import AudioIni -from moul.file.localization import parseLocDirectory +from moul.log import getLogger + LOG = getLogger('moul.file.directory') class DirectoryCount(object): Modified: pymoul/trunk/src/moul/file/kiimage.py =================================================================== --- pymoul/trunk/src/moul/file/kiimage.py 2007-02-02 17:22:22 UTC (rev 121) +++ pymoul/trunk/src/moul/file/kiimage.py 2007-02-02 17:34:06 UTC (rev 122) @@ -22,14 +22,15 @@ __revision__ = "$Revision$" import os +import struct import tempfile -import struct +from fnmatch import fnmatch +from stat import ST_MTIME from stat import ST_SIZE -from stat import ST_MTIME -from fnmatch import fnmatch from moul.log import getLogger + JPEG_HEADER = "\377\330\377" LOG = getLogger("moul.kiimage") Modified: pymoul/trunk/src/moul/file/localization.py =================================================================== --- pymoul/trunk/src/moul/file/localization.py 2007-02-02 17:22:22 UTC (rev 121) +++ pymoul/trunk/src/moul/file/localization.py 2007-02-02 17:34:06 UTC (rev 122) @@ -17,8 +17,15 @@ # """LOC file parser """ +import glob +import os from __future__ import with_statement +from xml.sax import ContentHandler +from xml.sax import make_parser +from xml.sax.handler import feature_namespaces +from moul.log import getLogger + __author__ = "Christian Heimes" __version__ = "$Id$" __revision__ = "$Revision$" @@ -26,14 +33,6 @@ __all__ = ('translationRegistry', 'parseLocDirectory') -import os -import glob - -from xml.sax import ContentHandler -from xml.sax import make_parser -from xml.sax.handler import feature_namespaces - -from moul.log import getLogger LOG = getLogger('moul loc') IGNORE_AGES = [u'OptionsMenu', u'ACA', u'Global', u'KI', u'Heek'] Modified: pymoul/trunk/src/moul/file/plasmalog.py =================================================================== --- pymoul/trunk/src/moul/file/plasmalog.py 2007-02-02 17:22:22 UTC (rev 121) +++ pymoul/trunk/src/moul/file/plasmalog.py 2007-02-02 17:34:06 UTC (rev 122) @@ -22,14 +22,15 @@ __revision__ = "$Revision$" import os -from stat import ST_MTIME import time import zipfile from fnmatch import fnmatch +from stat import ST_MTIME from moul.crypt.elf import decryptElf from moul.log import getLogger + PLASMA_LOG = "plasmalog.txt" LOG = getLogger('moul.plasma') Modified: pymoul/trunk/src/moul/file/tests/test_chatlog.py =================================================================== --- pymoul/trunk/src/moul/file/tests/test_chatlog.py 2007-02-02 17:22:22 UTC (rev 121) +++ pymoul/trunk/src/moul/file/tests/test_chatlog.py 2007-02-02 17:34:06 UTC (rev 122) @@ -26,6 +26,7 @@ import moul.file.chatlog + def test_suite(): return unittest.TestSuite(( DocTestSuite('moul.file.chatlog') Modified: pymoul/trunk/src/moul/file/tests/test_directory.py =================================================================== --- pymoul/trunk/src/moul/file/tests/test_directory.py 2007-02-02 17:22:22 UTC (rev 121) +++ pymoul/trunk/src/moul/file/tests/test_directory.py 2007-02-02 17:34:06 UTC (rev 122) @@ -27,13 +27,13 @@ from moul.file.directory import UruGameDataDirectory from moul.file.directory import UruPersonalDataDirectory - +from moul.file.tests.utils import base +from moul.file.tests.utils import fakeUruGameDir from moul.file.tests.utils import fakeUruPersonalDataDir -from moul.file.tests.utils import fakeUruGameDir from moul.file.tests.utils import mkTempdir from moul.file.tests.utils import rmTempdir -from moul.file.tests.utils import base + class AbstractTest(unittest.TestCase): klass = None Modified: pymoul/trunk/src/moul/file/tests/test_kiimage.py =================================================================== --- pymoul/trunk/src/moul/file/tests/test_kiimage.py 2007-02-02 17:22:22 UTC (rev 121) +++ pymoul/trunk/src/moul/file/tests/test_kiimage.py 2007-02-02 17:34:06 UTC (rev 122) @@ -22,14 +22,15 @@ __revision__ = "$Revision$" import os +import unittest from StringIO import StringIO -import unittest from doctest import DocTestSuite +from moul.file.kiimage import JPEG_HEADER 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') kiclean = os.path.join(base, 'avatar_clean.jpg') Modified: pymoul/trunk/src/moul/file/tests/test_localization.py =================================================================== --- pymoul/trunk/src/moul/file/tests/test_localization.py 2007-02-02 17:22:22 UTC (rev 121) +++ pymoul/trunk/src/moul/file/tests/test_localization.py 2007-02-02 17:34:06 UTC (rev 122) @@ -25,10 +25,11 @@ import unittest from doctest import DocTestSuite +from moul.file.localization import parseLoc from moul.file.localization import parseLocDirectory -from moul.file.localization import parseLoc from moul.file.localization import translationRegistry + base = os.path.dirname(__file__) class LocalizationTest(unittest.TestCase): Modified: pymoul/trunk/src/moul/file/tests/test_plasmalog.py =================================================================== --- pymoul/trunk/src/moul/file/tests/test_plasmalog.py 2007-02-02 17:22:22 UTC (rev 121) +++ pymoul/trunk/src/moul/file/tests/test_plasmalog.py 2007-02-02 17:34:06 UTC (rev 122) @@ -21,26 +21,25 @@ __version__ = "$Id$" __revision__ = "$Revision$" -import unittest -from doctest import DocTestSuite - import os import shutil +import unittest +from doctest import DocTestSuite from tempfile import mkdtemp -from moul.file.plasmalog import PlasmalogZipper -from moul.file.chatlog import ChatlogMover from moul.file.chatlog import ChatlogDirectoryView +from moul.file.chatlog import ChatlogMover from moul.file.chatlog import ChatlogView -from moul.file.kiimage import KIImageFixer from moul.file.kiimage import KIImage - -from moul.file.tests.utils import fakeUruPersonalDataDir +from moul.file.kiimage import KIImageFixer +from moul.file.plasmalog import PlasmalogZipper +from moul.file.tests.utils import base from moul.file.tests.utils import fakeUruGameDir +from moul.file.tests.utils import fakeUruPersonalDataDir from moul.file.tests.utils import mkTempdir from moul.file.tests.utils import rmTempdir -from moul.file.tests.utils import base + class PlasmaChatTest(unittest.TestCase): def setUp(self): self._tmpdir = mkTempdir() Modified: pymoul/trunk/src/moul/file/tests/test_wdysini.py =================================================================== --- pymoul/trunk/src/moul/file/tests/test_wdysini.py 2007-02-02 17:22:22 UTC (rev 121) +++ pymoul/trunk/src/moul/file/tests/test_wdysini.py 2007-02-02 17:34:06 UTC (rev 122) @@ -22,17 +22,18 @@ __revision__ = "$Revision$" import os +import shutil import string +import unittest from StringIO import StringIO -import unittest from doctest import DocTestSuite from tempfile import mkdtemp -import shutil from moul.crypt.whatdoyousee import decryptWDYS from moul.file.wdysini import AudioIni from moul.file.wdysini import GraphicsIni + base = os.path.dirname(__file__) gra_enc = os.path.join(base, 'graphics.ini') gra_dec = os.path.join(base, 'graphics.txt') Modified: pymoul/trunk/src/moul/file/tests/utils.py =================================================================== --- pymoul/trunk/src/moul/file/tests/utils.py 2007-02-02 17:22:22 UTC (rev 121) +++ pymoul/trunk/src/moul/file/tests/utils.py 2007-02-02 17:34:06 UTC (rev 122) @@ -25,6 +25,7 @@ import shutil from tempfile import mkdtemp + FILE_LIST = ['audio.0.elf', 'audiocaps.0.elf', 'audioTimes.0.elf', 'Avatar.0.elf', 'impacts.0.elf', 'LocalizationDataMgr.0.elf', 'Marker.0.elf', 'NetScreener.0.elf', 'patcher.0.elf', 'pipeline.0.elf', Modified: pymoul/trunk/src/moul/file/wdysini.py =================================================================== --- pymoul/trunk/src/moul/file/wdysini.py 2007-02-02 17:22:22 UTC (rev 121) +++ pymoul/trunk/src/moul/file/wdysini.py 2007-02-02 17:34:06 UTC (rev 122) @@ -28,6 +28,7 @@ from moul.crypt.whatdoyousee import encryptWDYS from moul.log import getLogger + LOG = getLogger('moul.file.wdysini') class BoolStringError(ValueError): Modified: pymoul/trunk/src/moul/i18n.py =================================================================== --- pymoul/trunk/src/moul/i18n.py 2007-02-02 17:22:22 UTC (rev 121) +++ pymoul/trunk/src/moul/i18n.py 2007-02-02 17:34:06 UTC (rev 122) @@ -56,6 +56,7 @@ from string import Template + __all__ = ['_', 'PymoulMessageFactory', 'MessageFactory'] class Message(unicode, Template): Modified: pymoul/trunk/src/moul/log.py =================================================================== --- pymoul/trunk/src/moul/log.py 2007-02-02 17:22:22 UTC (rev 121) +++ pymoul/trunk/src/moul/log.py 2007-02-02 17:34:06 UTC (rev 122) @@ -23,14 +23,16 @@ __all__ = ['LOG', 'getLogger', 'signalLogDecorator'] +import logging import os +import platform import sys -import platform -import logging from logging import Formatter from logging import handlers + from moul.metadata import __version__ as moul_version + getLogger = logging.getLogger __FROZEN__ = bool(getattr(sys, 'frozen', False)) Modified: pymoul/trunk/src/moul/osdependent/__init__.py =================================================================== --- pymoul/trunk/src/moul/osdependent/__init__.py 2007-02-02 17:22:22 UTC (rev 121) +++ pymoul/trunk/src/moul/osdependent/__init__.py 2007-02-02 17:34:06 UTC (rev 122) @@ -38,9 +38,10 @@ from types import ModuleType from moul.log import getLogger +from moul.osdependent.processinfo import getPidNames from moul.osdependent.processinfo import getPids -from moul.osdependent.processinfo import getPidNames + LOG = getLogger('moul.osdependent') # a program under py2exe is sys.frozen Modified: pymoul/trunk/src/moul/osdependent/darwin/__init__.py =================================================================== --- pymoul/trunk/src/moul/osdependent/darwin/__init__.py 2007-02-02 17:22:22 UTC (rev 121) +++ pymoul/trunk/src/moul/osdependent/darwin/__init__.py 2007-02-02 17:34:06 UTC (rev 122) @@ -23,8 +23,10 @@ import os from subprocess import Popen + from moul.log import getLogger + LOG = getLogger('moul.darwin') LOG.critical('Darwin/Mac support is not tested') Modified: pymoul/trunk/src/moul/osdependent/linux/__init__.py =================================================================== --- pymoul/trunk/src/moul/osdependent/linux/__init__.py 2007-02-02 17:22:22 UTC (rev 121) +++ pymoul/trunk/src/moul/osdependent/linux/__init__.py 2007-02-02 17:34:06 UTC (rev 122) @@ -23,8 +23,10 @@ import os from subprocess import Popen + from moul.log import getLogger + LOG = getLogger('moul.linux') LOG.critical('Linux support is not tested') Modified: pymoul/trunk/src/moul/osdependent/processinfo.py =================================================================== --- pymoul/trunk/src/moul/osdependent/processinfo.py 2007-02-02 17:22:22 UTC (rev 121) +++ pymoul/trunk/src/moul/osdependent/processinfo.py 2007-02-02 17:34:06 UTC (rev 122) @@ -59,6 +59,7 @@ elif _plat('win') or _plat('cygwin'): PLAT = 'win' from ctypes import windll, c_ulong, sizeof, c_buffer, byref + PSAPI = windll.psapi KERNEL = windll.kernel32 PROCESS_QUERY_INFORMATION = 0x0400 Modified: pymoul/trunk/src/moul/osdependent/singleapp.py =================================================================== --- pymoul/trunk/src/moul/osdependent/singleapp.py 2007-02-02 17:22:22 UTC (rev 121) +++ pymoul/trunk/src/moul/osdependent/singleapp.py 2007-02-02 17:34:06 UTC (rev 122) @@ -44,10 +44,10 @@ __revision__ = "$Revision$" import atexit +import getpass import os -import getpass +import tempfile from logging import getLogger -import tempfile LOG = getLogger('singleapp') @@ -68,6 +68,7 @@ LOCK = "dummy" elif os.name == 'posix': import fcntl + LOCK_EX = fcntl.LOCK_EX LOCK_SH = fcntl.LOCK_SH LOCK_NB = fcntl.LOCK_NB Modified: pymoul/trunk/src/moul/osdependent/tests/test_osdependent.py =================================================================== --- pymoul/trunk/src/moul/osdependent/tests/test_osdependent.py 2007-02-02 17:22:22 UTC (rev 121) +++ pymoul/trunk/src/moul/osdependent/tests/test_osdependent.py 2007-02-02 17:34:06 UTC (rev 122) @@ -26,6 +26,7 @@ import moul.osdependent + def test_suite(): return unittest.TestSuite(( DocTestSuite('moul.osdependent'), Modified: pymoul/trunk/src/moul/osdependent/tests/test_processinfo.py =================================================================== --- pymoul/trunk/src/moul/osdependent/tests/test_processinfo.py 2007-02-02 17:22:22 UTC (rev 121) +++ pymoul/trunk/src/moul/osdependent/tests/test_processinfo.py 2007-02-02 17:34:06 UTC (rev 122) @@ -26,6 +26,7 @@ import moul.osdependent.processinfo + def test_suite(): return unittest.TestSuite(( DocTestSuite('moul.osdependent.processinfo'), Modified: pymoul/trunk/src/moul/osdependent/tests/test_singleapp.py =================================================================== --- pymoul/trunk/src/moul/osdependent/tests/test_singleapp.py 2007-02-02 17:22:22 UTC (rev 121) +++ pymoul/trunk/src/moul/osdependent/tests/test_singleapp.py 2007-02-02 17:34:06 UTC (rev 122) @@ -21,20 +21,20 @@ __version__ = "$Id$" __revision__ = "$Revision$" +import os +import sys +import tempfile import unittest +from StringIO import StringIO from doctest import DocTestSuite +from shutil import rmtree +from subprocess import Popen +from moul.osdependent.singleapp import LOCK_SH, LOCK_NB from moul.osdependent.singleapp import SimpleSingleApp from moul.osdependent.singleapp import lock from moul.osdependent.singleapp import unlock -from moul.osdependent.singleapp import LOCK_SH, LOCK_NB -import sys -import os -import tempfile -from shutil import rmtree -from subprocess import Popen -from StringIO import StringIO tmpdir = tempfile.mkdtemp() testfile = os.path.join(tmpdir, 'test.lck') Modified: pymoul/trunk/src/moul/osdependent/win32/__init__.py =================================================================== --- pymoul/trunk/src/moul/osdependent/win32/__init__.py 2007-02-02 17:22:22 UTC (rev 121) +++ pymoul/trunk/src/moul/osdependent/win32/__init__.py 2007-02-02 17:34:06 UTC (rev 122) @@ -24,11 +24,12 @@ import os from subprocess import Popen -from moul.osdependent.win32.winpath import get_homedir as getMyDocuments -from moul.osdependent.win32.winpath import get_appdata as getAppdata from moul.log import getLogger from moul.osdependent.processinfo import getPidNames +from moul.osdependent.win32.winpath import get_appdata as getAppdata +from moul.osdependent.win32.winpath import get_homedir as getMyDocuments + LOG = getLogger('moul.win') MOUL_DIR = "Uru Live" Modified: pymoul/trunk/src/moul/osdependent/win32/registry.py =================================================================== --- pymoul/trunk/src/moul/osdependent/win32/registry.py 2007-02-02 17:22:22 UTC (rev 121) +++ pymoul/trunk/src/moul/osdependent/win32/registry.py 2007-02-02 17:34:06 UTC (rev 122) @@ -1,6 +1,7 @@ """Based on http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/146305 """ import _winreg as wreg + #import cPickle as pickle class WindowsRegistry: Modified: pymoul/trunk/src/moul/osdependent/win32/winpath.py =================================================================== --- pymoul/trunk/src/moul/osdependent/win32/winpath.py 2007-02-02 17:22:22 UTC (rev 121) +++ pymoul/trunk/src/moul/osdependent/win32/winpath.py 2007-02-02 17:34:06 UTC (rev 122) @@ -29,6 +29,7 @@ # standard library modules import _winreg, os + SHELL_FOLDERS = \ r'Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders' USER_SHELL_FOLDERS = \ Modified: pymoul/trunk/src/moul/qt/__init__.py =================================================================== --- pymoul/trunk/src/moul/qt/__init__.py 2007-02-02 17:22:22 UTC (rev 121) +++ pymoul/trunk/src/moul/qt/__init__.py 2007-02-02 17:34:06 UTC (rev 122) @@ -28,6 +28,7 @@ from moul.log import LOG + # DEBUG system infos LOG.debug("PyQt: %s" % PyQt4.QtCore.PYQT_VERSION_STR) Modified: pymoul/trunk/src/moul/qt/errorhandler.py =================================================================== --- pymoul/trunk/src/moul/qt/errorhandler.py 2007-02-02 17:22:22 UTC (rev 121) +++ pymoul/trunk/src/moul/qt/errorhandler.py 2007-02-02 17:34:06 UTC (rev 122) @@ -26,16 +26,16 @@ __version__ = "$Id" __revision__ = "$Revision$" +import os import sys -import os -from traceback import format_exception - +from PyQt4 import QtCore from PyQt4 import QtGui -from PyQt4 import QtCore from PyQt4.QtCore import Qt +from traceback import format_exception from moul.log import getLogger + LOG = getLogger('moul.qt.error') Modified: pymoul/trunk/src/moul/qt/localization.py =================================================================== --- pymoul/trunk/src/moul/qt/localization.py 2007-02-02 17:22:22 UTC (rev 121) +++ pymoul/trunk/src/moul/qt/localization.py 2007-02-02 17:34:06 UTC (rev 122) @@ -22,23 +22,24 @@ __version__ = "$Id$" __revision__ = "$Revision$" +import os import sys -import os - +from PyQt4 import QtCore from PyQt4 import QtGui -from PyQt4 import QtCore from PyQt4.QtCore import Qt +from PyQt4.QtCore import SIGNAL from PyQt4.QtCore import pyqtSignature -from PyQt4.QtCore import SIGNAL from moul.config import lookupDir +from moul.file.directory import UruGameDataDirectory from moul.file.localization import translationRegistry as tr -from moul.file.directory import UruGameDataDirectory from moul.log import getLogger from moul.log import signalLogDecorator + +from moul.qt.simpleprogressbar import SimpleProgressbar from moul.qt.threadlet import Threadlet -from moul.qt.simpleprogressbar import SimpleProgressbar + LOG = getLogger('moul.loc') def insertDummyQ(lst): Modified: pymoul/trunk/src/moul/qt/mainwindow.py =================================================================== --- pymoul/trunk/src/moul/qt/mainwindow.py 2007-02-02 17:22:22 UTC (rev 121) +++ pymoul/trunk/src/moul/qt/mainwindow.py 2007-02-02 17:34:06 UTC (rev 122) @@ -18,40 +18,43 @@ """Moul QT GUI main windows """ -from __future__ import with_statement - -__author__ = "Christian Heimes" -__version__ = "$Id$" -__revision__ = "$Revision$" - import sys - +from PyQt4 import QtCore from PyQt4 import QtGui -from PyQt4 import QtCore from PyQt4.QtCore import Qt +from PyQt4.QtCore import SIGNAL from PyQt4.QtCore import pyqtSignature -from PyQt4.QtCore import SIGNAL +from __future__ import with_statement -from moul.qt.ui.mainwindow import Ui_MainWindow -from moul.qt.localization import LocalizationMixin -from moul.osdependent import isMoulRunning +from moul import metadata from moul.config import lookupDir from moul.file.directory import UruGameDataDirectory from moul.file.directory import UruPersonalDataDirectory +from moul.file.wdysini import AudioIni +from moul.file.wdysini import GraphicsIni from moul.file.wdysini import videoModes from moul.log import getLogger from moul.log import signalLogDecorator +from moul.osdependent import isMoulRunning from moul.server.ping import ServerList from moul.server.ping import isSocketError from moul.time.cavern import CavernTime + +from moul.qt.localization import LocalizationMixin +from moul.qt.simpleprogressbar import SimpleProgressbar from moul.qt.threadlet import YieldingThreadlet -from moul.qt.simpleprogressbar import SimpleProgressbar -from moul import metadata +from moul.qt.ui.mainwindow import Ui_MainWindow +__author__ = "Christian Heimes" +__version__ = "$Id$" +__revision__ = "$Revision$" + + + + # TBR -from moul.file.wdysini import AudioIni -from moul.file.wdysini import GraphicsIni + LOG = getLogger('moul.qt') class MainWindow(QtGui.QMainWindow, Ui_MainWindow, LocalizationMixin): Modified: pymoul/trunk/src/moul/qt/moulqt.py =================================================================== --- pymoul/trunk/src/moul/qt/moulqt.py 2007-02-02 17:22:22 UTC (rev 121) +++ pymoul/trunk/src/moul/qt/moulqt.py 2007-02-02 17:34:06 UTC (rev 122) @@ -24,19 +24,20 @@ __revision__ = "$Revision$" import sys - from PyQt4 import QtGui -from moul.qt.mainwindow import MainWindow -from moul.qt.errorhandler import criticalMB -from moul.qt.errorhandler import setupQtExceptHook -from moul.qt.errorhandler import removeQtExceptHook -from moul.osdependent.singleapp import SimpleSingleApp from moul.config import getPyMoulDataDir -from moul.osdependent import isMoulRunning from moul.log import createLogfile from moul.log import getLogger +from moul.osdependent import isMoulRunning +from moul.osdependent.singleapp import SimpleSingleApp +from moul.qt.errorhandler import criticalMB +from moul.qt.errorhandler import removeQtExceptHook +from moul.qt.errorhandler import setupQtExceptHook +from moul.qt.mainwindow import MainWindow + + LOG = getLogger('moul.qt') def main(*args): Modified: pymoul/trunk/src/moul/qt/simpleprogressbar.py =================================================================== --- pymoul/trunk/src/moul/qt/simpleprogressbar.py 2007-02-02 17:22:22 UTC (rev 121) +++ pymoul/trunk/src/moul/qt/simpleprogressbar.py 2007-02-02 17:34:06 UTC (rev 122) @@ -29,6 +29,7 @@ from moul.qt.ui.simpleprogressbar import Ui_SimpleProgressbar + class SimpleProgressbar(QtGui.QDialog, Ui_SimpleProgressbar): """A simple progress bar dialog Modified: pymoul/trunk/src/moul/qt/threadlet.py =================================================================== --- pymoul/trunk/src/moul/qt/threadlet.py 2007-02-02 17:22:22 UTC (rev 121) +++ pymoul/trunk/src/moul/qt/threadlet.py 2007-02-02 17:34:06 UTC (rev 122) @@ -24,11 +24,12 @@ __revision__ = "$Revision: 110 $" import sys - from PyQt4 import QtCore -from moul.log import getLogger from PyQt4.QtCore import SIGNAL +from moul.log import getLogger + + LOG = getLogger('moul.tasklet') class Threadlet(QtCore.QThread): Modified: pymoul/trunk/src/moul/qt/ui/mainwindow.py =================================================================== --- pymoul/trunk/src/moul/qt/ui/mainwindow.py 2007-02-02 17:22:22 UTC (rev 121) +++ pymoul/trunk/src/moul/qt/ui/mainwindow.py 2007-02-02 17:34:06 UTC (rev 122) @@ -5,11 +5,13 @@ # Created: Fri Feb 2 17:26:46 2007 # by: PyQt4 UI code generator 4.1.1 # -# WARNING! All changes made in this file will be lost! +# WARNING! All changes made in this file will be losimport sys +from PyQt4 import QtCore, Qt -import sys -from PyQt4 import QtCore, QtGui +t! +Gui + class Ui_MainWindow(object): def setupUi(self, MainWindow): MainWindow.setObjectName("MainWindow") Modified: pymoul/trunk/src/moul/qt/ui/moulqt_rc.py =================================================================== --- pymoul/trunk/src/moul/qt/ui/moulqt_rc.py 2007-02-02 17:22:22 UTC (rev 121) +++ pymoul/trunk/src/moul/qt/ui/moulqt_rc.py 2007-02-02 17:34:06 UTC (rev 122) @@ -5,10 +5,12 @@ # Created: So Jan 28 18:10:39 2007 # by: The Resource Compiler for PyQt (Qt v4.2.0) # -# WARNING! All changes made in this file will be lost! +# WARNING! All changes made in this file will be losfrom PyQt4 import QtC -from PyQt4 import QtCore +t! +ore + qt_resource_data = "\ \x00\x00\x07\xea\ \x89\ Modified: pymoul/trunk/src/moul/qt/ui/simpleprogressbar.py =================================================================== --- pymoul/trunk/src/moul/qt/ui/simpleprogressbar.py 2007-02-02 17:22:22 UTC (rev 121) +++ pymoul/trunk/src/moul/qt/ui/simpleprogressbar.py 2007-02-02 17:34:06 UTC (rev 122) @@ -5,11 +5,13 @@ # Created: Fri Feb 2 15:36:30 2007 # by: PyQt4 UI code generator 4.1.1 # -# WARNING! All changes made in this file will be lost! +# WARNING! All changes made in this file will be losimport sys +from PyQt4 import QtCore, Qt -import sys -from PyQt4 import QtCore, QtGui +t! +Gui + class Ui_SimpleProgressbar(object): def setupUi(self, SimpleProgressbar): SimpleProgressbar.setObjectName("SimpleProgressbar") Modified: pymoul/trunk/src/moul/server/ping.py =================================================================== --- pymoul/trunk/src/moul/server/ping.py 2007-02-02 17:22:22 UTC (rev 121) +++ pymoul/trunk/src/moul/server/ping.py 2007-02-02 17:34:06 UTC (rev 122) @@ -24,6 +24,7 @@ from moul.server.serverlist import PORT from moul.server.serverlist import SERVER_LIST + def isSocketError(stat): return isinstance(stat, socket.error) Modified: pymoul/trunk/src/moul/server/tests/test_ping.py =================================================================== --- pymoul/trunk/src/moul/server/tests/test_ping.py 2007-02-02 17:22:22 UTC (rev 121) +++ pymoul/trunk/src/moul/server/tests/test_ping.py 2007-02-02 17:34:06 UTC (rev 122) @@ -27,9 +27,10 @@ from moul.server.ping import Server from moul.server.ping import ServerList from moul.server.ping import isSocketError +from moul.server.serverlist import PORT from moul.server.serverlist import SERVER_LIST -from moul.server.serverlist import PORT + class PingServerTest(unittest.TestCase): def test_ping_working(self): Modified: pymoul/trunk/src/moul/server/tests/test_serverlist.py =================================================================== --- pymoul/trunk/src/moul/server/tests/test_serverlist.py 2007-02-02 17:22:22 UTC (rev 121) +++ pymoul/trunk/src/moul/server/tests/test_serverlist.py 2007-02-02 17:34:06 UTC (rev 122) @@ -26,6 +26,7 @@ import moul.server.serverlist + def test_suite(): return unittest.TestSuite(( DocTestSuite('moul.server.serverlist'), Modified: pymoul/trunk/src/moul/tests/test_i18n.py =================================================================== --- pymoul/trunk/src/moul/tests/test_i18n.py 2007-02-02 17:22:22 UTC (rev 121) +++ pymoul/trunk/src/moul/tests/test_i18n.py 2007-02-02 17:34:06 UTC (rev 122) @@ -26,6 +26,7 @@ import moul.i18n + def test_suite(): return unittest.TestSuite(( DocTestSuite('moul.i18n'), Modified: pymoul/trunk/src/moul/time/cavern.py =================================================================== --- pymoul/trunk/src/moul/time/cavern.py 2007-02-02 17:22:22 UTC (rev 121) +++ pymoul/trunk/src/moul/time/cavern.py 2007-02-02 17:34:06 UTC (rev 122) @@ -24,18 +24,20 @@ __all__ = ['CavernTime'] from datetime import datetime +from pytz import all_timezones +from pytz import timezone +from pytz import utc as UTC +from moul.osdependent import __FROZEN__ + # pytz is an egg -from moul.osdependent import __FROZEN__ if not __FROZEN__: import pkg_resources pkg_resources.require("pytz>=2006p") #from pytz import common_timezones -from pytz import all_timezones -from pytz import timezone -from pytz import utc as UTC + ## not used in the current version #SUPPORTED_TZ = ('America', 'Canada', 'Etc', 'Europe', 'US') #ADDITIONAL_TZ = ('GMT', 'UTC') Modified: pymoul/trunk/src/moul/time/dni.py =================================================================== --- pymoul/trunk/src/moul/time/dni.py 2007-02-02 17:22:22 UTC (rev 121) +++ pymoul/trunk/src/moul/time/dni.py 2007-02-02 17:34:06 UTC (rev 122) @@ -23,6 +23,7 @@ from operator import mul + FARAH_1 = -7656 # hahrtee fahrah 1 starts at April 21st 7656 B.C DNI_FACTORS = ( ('hahrtee fahrah', 625), Modified: pymoul/trunk/src/moul/time/tests/test_cavern.py =================================================================== --- pymoul/trunk/src/moul/time/tests/test_cavern.py 2007-02-02 17:22:22 UTC (rev 121) +++ pymoul/trunk/src/moul/time/tests/test_cavern.py 2007-02-02 17:34:06 UTC (rev 122) @@ -27,6 +27,7 @@ import moul.time.cavern + def test_suite(): return unittest.TestSuite(( DocTestSuite('moul.time.cavern'), Modified: pymoul/trunk/src/moul/time/tests/test_dni.py =================================================================== --- pymoul/trunk/src/moul/time/tests/test_dni.py 2007-02-02 17:22:22 UTC (rev 121) +++ pymoul/trunk/src/moul/time/tests/test_dni.py 2007-02-02 17:34:06 UTC (rev 122) @@ -27,6 +27,7 @@ import moul.time.dni + def test_suite(): return unittest.TestSuite(( DocTestSuite('moul.time.dni'), Added: pymoul/trunk/utilities/importorder.py =================================================================== --- pymoul/trunk/utilities/importorder.py (rev 0) +++ pymoul/trunk/utilities/importorder.py 2007-02-02 17:34:06 UTC (rev 122) @@ -0,0 +1,386 @@ +#!/usr/bin/env python2.4 +############################################################################## +# +# Copyright (c) 2001, 2002 Zope Corporation and Contributors. +# All Rights Reserved. +# +# This software is subject to the provisions of the Zope Public License, +# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. +# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED +# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS +# FOR A PARTICULAR PURPOSE. +# +############################################################################## +""" +This tool basically can be used to rearrange and order imported +python packages in a particular format for .py files. + +Import Order:- + 1. import modules from standard python library/global packages + 2. import modules from the moul package + 3. import modules from the moul.qt package + +.py [-dfhst] [file/directory] + +-d / --dir + It will sort all the .py files imported python packages in the + entire directory . + +-D / --display + Displays Import order for all .py files in the specified path. + +-f / --file + It will order all imported python packages in a file. + +-s / --split + It splits up multiple import modules in a single import statement + into multiple import statements. + + +-t / --test + It Displays Import order for all py files in the specified path and + doesn't write importorder into .py file. + +$Id: order.py 38688 2005-09-29 16:33:36Z fdrake $ +""" + +import getopt +import glob +import os +import string +import sys +import tokenize + + +PYTHONFILE_FILTER = '*.py' +FROMIMPORT = 'from ' +IMPORT = 'import ' +FROMIMPORT_ZOPE = 'from moul' +IMPORT_ZOPE = 'import moul' +FROMIMPORT_ZOPE_APP = 'from moul.qt' +IMPORT_ZOPE_APP = 'import moul.qt' +NO_CHARACTERS = 80 + + +def getPythonFiles(path): + """returns list of .py files in the specified path""" + pyfiles = [] + if not os.path.exists(path): + print >> sys.stderr, '** Error: '+ path +' not a valid path **' + sys.exit(0) + + #checking path is file + if os.path.isfile(path): + pyfiles.append(path) + + #checking path is a directory + elif os.path.isdir(path): + path = os.path.join(path, PYTHONFILE_FILTER) + path, filter = os.path.split(path) + pyfiles.extend(glob.glob(os.path.join(path, filter))) + + #checking in sub directories + for root, dirs, files in os.walk(path): + for dir in dirs: + pyfiles.extend(glob.glob(\ + os.path.join(root, dir, filter))) + + return pyfiles + + +def importOrderProcessing(path, display=None, write=None, split=None): + """process import order for all .py files in the specified path.""" + pyfiles = getPythonFiles(path) + + print '*****************************************************************' + for file in pyfiles: + print '** File : %s **\n' % (file) + import_block = getFileImportOrder(file, split) + import_order = import_block['import_order'] + non_import_order = import_block['non_import_order'] + if display: + print non_import_order + print '**.......................................................**' + print import_order + if write: + writeFormatedContent(file, import_order, non_import_order) + + + print '*****************************************************************' + + +def getFileImportOrder(file, split=None): + """returns formatted imported packages content""" + import_content = getFileImportContent(file) + import_list = appendImportsToList(import_content) + + #separating from and import statements + imp_list = filterList(import_list, 'import ') + from_list = filterList(import_list, 'from ') + + #extracting non import content + non_import_block = removeList(import_list, imp_list) + non_import_block = removeList(non_import_block, from_list) + non_import_block_fmt = formateBlock(non_import_block) + + #comma separated imports into individual import statements + if split: + imp_list = individualImportLines(imp_list) + from_list = individualImportLines(from_list) + + #extracting zope.app package imports + zope_app_imp_list = filterList(imp_list, IMPORT_ZOPE_APP) + zope_app_from_list = filterList(from_list, FROMIMPORT_ZOPE_APP) + + rem_imp_list1 = removeList(imp_list, zope_app_imp_list) + rem_from_list1 = removeList(from_list, zope_app_from_list) + + #extracting zope package imports + zope_imp_list = filterList(rem_imp_list1, IMPORT_ZOPE) + zope_from_list = filterList(rem_from_list1, FROMIMPORT_ZOPE) + + #extracting global package imports + global_imp_list = removeList(rem_imp_list1, zope_imp_list) + global_from_list = removeList(rem_from_list1, zope_from_list) + + #formating the global, zope and zope.app package imports + format_import_content = mergeAllBlocks(global_imp_list, + zope_imp_list, + zope_app_imp_list, + global_from_list, + zope_from_list, + zope_app_from_list) + + #merging import block and non import block + non_import_block_fmt = string.strip(non_import_block_fmt) + if len(non_import_block_fmt) > 0: + non_import_block_fmt += '\n\n' + + fmt_content = format_import_content + non_import_block_fmt + + return {'import_order':fmt_content, + 'non_import_order':import_content} + + +def getFileImportContent(file): + """returns the imports content available at the top in the .py file""" + import_list = [] + lines = [] + import_block_start_indx = 0 + import_block_end_indx = 0 + index = 0 + for t in tokenize.generate_tokens(open(file, 'rU').readline): + type, string, start, end, line = t + line_no = start[0] + line_len = len(line) + + if line_no not in lines: + lines.append(line_no) + index += line_len + if string in ['from','import'] and line not in import_list: + if len(import_list) == 0: + import_block_start_indx = (index - line_len) + import_list.append(line) + import_block_end_indx = index + elif string in ['def', 'class']: + break + + fc = open(file, 'r').read() + return fc[import_block_start_indx-4:import_block_end_indx-4] + + +def appendImportsToList(import_content): + """returns list of imports of the file""" + import_list = import_content.split('\\') + if len(import_list) > 1: + import_list = concatinateBreakImports(import_list) + else: + import_list = import_content.split('\n') + + return import_list + + +def concatinateBreakImports(import_list): + """concatinate imports into single item in a list""" + indx = 1 + concate_list = [] + for item in import_list: + if indx == 1: + concate_list += item.split('\n') + else: + concate_item = [] + item = string.lstrip(item) + item_list = item.split('\n') + concate_litem = concate_list[-1:][0] + item_list_fitem = item_list[:1][0] + concate_item.append(concate_litem + item_list_fitem) + concate_list = concate_list[:-1] + concate_item + item_list[1:] + indx += 1 + + return concate_list + + +def filterList(list, filter): + """returns filtered list""" + filter_list = [item for item in list + if item.startswith(filter)] + filter_list.sort() + return filter_list + +def individualImportLines(import_list): + """changes comma separated imports to individual import lines""" + import_str = 'import ' + new_import_list = [] + for item in import_list: + if item.find(',') > -1 and (item.startswith('from ') or + item.startswith('import ')): + import_item_split = item.split('import ') + from_import_item = import_item_split[0] + comma_imports = import_item_split[1].split(',') + new_list = [] + for mod_item in comma_imports: + mod_item = string.lstrip(mod_item) + new_list.append(from_import_item + import_str + mod_item) + new_import_list += new_list + else: + new_import_list.append(item) + + return new_import_list + + +def removeList(list, rem_list): + return [item for item in list + if item not in rem_list] + +def mergeAllBlocks(global_imp_list, zope_imp_list, zope_app_imp_list, + global_from_list, zope_from_list, zope_app_from_list): + """merges global, zope and zope.app imports """ + import_block = '' + global_imp_block = formateBlock(global_imp_list) + global_from_block = formateBlock(global_from_list) + zope_imp_block = formateBlock(zope_imp_list) + zope_from_block = formateBlock(zope_from_list) + zope_app_imp_block = formateBlock(zope_app_imp_list) + zope_app_from_block = formateBlock(zope_app_from_list) + + import_block += formatsFromAndImportBlock(global_imp_block, + global_from_block) + + import_block += formatsFromAndImportBlock(zope_imp_block, + zope_from_block) + + import_block += formatsFromAndImportBlock(zope_app_imp_block, + zope_app_from_block) + + return import_block + + +def formatsFromAndImportBlock(imp_block, from_block): + """formats from and import block""" + import_block = '' + if imp_block is not '' or from_block is not '': + import_block += imp_block + import_block += from_block + import_block += '\n' + return import_block + + +def formateBlock(imp_list): + """formats import blocks""" + import_block = '' + if imp_list is not None: + for item in imp_list: + if len(item) > NO_CHARACTERS: + import_block += formatingLargerImports(item) + else: + import_block += str(item) + '\n' + return import_block + +def formatingLargerImports(import_content): + """formates if imports greater than 80 character""" + formatted_line = '' + import_fline = import_content[:NO_CHARACTERS] + + dot_indx = import_fline.rfind('.') + blank_space_indx = import_fline.rfind(' ') + + split_line_indx = 0 + if dot_indx > -1: + split_line_indx = dot_indx + if blank_space_indx > -1 and blank_space_indx < dot_indx: + split_line_indx = blank_space_indx + elif blank_space_indx > -1: + split_line_indx = blank_space_indx + if dot_indx > -1 and dot_indx < blank_space_indx: + split_line_indx = blank_space_indx + + split_line_indx += 1 + + formatted_line += import_content[:split_line_indx] +'\\\n' + if import_content.startswith(IMPORT): + formatted_line += (' ' + + import_content[split_line_indx:] + '\n') + elif import_content.startswith(FROMIMPORT): + formatted_line += (' ' + + import_content[split_line_indx:] + '\n') + + return formatted_line + + +def writeFormatedContent(file, fmt_content, non_fmt_content): + """writes formatted content into the file""" + + fp = open(file, 'r') + file_content = fp.read() + fp.close() + + fp = open(file, 'w') + rep_content = string.replace(file_content, non_fmt_content, + fmt_content) + fp.write(rep_content) + fp.close() + + +def main(argv=None): + if argv is None: + argv = sys.argv + try: + opts, args = getopt.getopt(sys.argv[1:], "dDfhst", + ["help", "dir", "file", "display", + "split", "test"]) + except getopt.error, msg: + print msg + print "Try `python %s -h' for more information." % argv[0] + return 2 + + path = None + display = None + write = True + split = None + + for k, v in opts: + if k in ("-h", "--help"): + print __doc__ + sys.exit(0) + elif k in ("-d", "--dir"): + path = args[0] + elif k in ("-f", "--file"): + path = args[0] + elif k in ("-D", "--display"): + path = args[0] + display = True + elif k in ("-s", "--split"): + path = args[0] + split = True + elif k in ("-t", "--test"): + path = args[0] + display = True + write = False + + importOrderProcessing(path, display, write, split) + return 0 + +if __name__ == '__main__': + main() + Property changes on: pymoul/trunk/utilities/importorder.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-02-02 17:22:25
|
Revision: 121 http://pymoul.svn.sourceforge.net/pymoul/?rev=121&view=rev Author: tiran Date: 2007-02-02 09:22:22 -0800 (Fri, 02 Feb 2007) Log Message: ----------- Moved utils to utilities/ Added some useful stuff from Zope3 Modified Paths: -------------- pymoul/trunk/Makefile.in pymoul/trunk/setup.py Added Paths: ----------- pymoul/trunk/doc/XXXreport.html pymoul/trunk/utilities/ pymoul/trunk/utilities/XXXreport pymoul/trunk/utilities/XXXreport2html.py pymoul/trunk/utilities/compileui.py pymoul/trunk/utilities/distutils_iss.py pymoul/trunk/utilities/distutils_upx.py pymoul/trunk/utilities/ez_setup.py pymoul/trunk/utilities/genepydoc.py pymoul/trunk/utilities/importchecker.py pymoul/trunk/utilities/setup_win32.py Removed Paths: ------------- pymoul/trunk/compileui.py pymoul/trunk/distutils_iss.py pymoul/trunk/distutils_upx.py pymoul/trunk/ez_setup.py pymoul/trunk/genepydoc.py pymoul/trunk/setup_win32.py Modified: pymoul/trunk/Makefile.in =================================================================== --- pymoul/trunk/Makefile.in 2007-02-02 17:13:40 UTC (rev 120) +++ pymoul/trunk/Makefile.in 2007-02-02 17:22:22 UTC (rev 121) @@ -1,5 +1,5 @@ -PYTHON?=python -EPYDOC=$(PYTHON) genepydoc.py +PYTHON?=python2.5 +EPYDOC=$(PYTHON) utilities/genepydoc.py NOTSVN=-a -not -wholename '*.svn*' FINDPYTXT=find src/moul \( -name '*.py' -o -name '*.txt' \) $(NOTSVN) FINDPY=find src/moul -name '*.py' $(NOTSVN) @@ -36,7 +36,7 @@ dist/moulqt.exe ui: - $(PYTHON) compileui.py + $(PYTHON) utilities/compileui.py ./src/moul/ test_build: build ui PYTHONPATH="src" $(PYTHON) test.py $(TESTFLAGS) $(TESTOPTS) @@ -91,3 +91,9 @@ cd dist && $(FINDHASH) | xargs sha1sum >sha1.txt cd dist && $(FINDHASH) | xargs gpg --detach-sign -a +xxxreport: + utilities/XXXreport + +importchecker: + $(PYTHON) utilities/importchecker.py ./src/moul/ + Deleted: pymoul/trunk/compileui.py =================================================================== --- pymoul/trunk/compileui.py 2007-02-02 17:13:40 UTC (rev 120) +++ pymoul/trunk/compileui.py 2007-02-02 17:22:22 UTC (rev 121) @@ -1,115 +0,0 @@ -#!/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 - -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" -QRC_PACKAGE = "moul.qt.ui" - -def _newer(orig, py): - try: - return os.stat(orig)[ST_MTIME] > os.stat(py)[ST_MTIME] - except Exception: - return True - - -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) - if not _newer(ui_path, py_path): - continue - 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>" % QRC_PACKAGE) - 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) - if not _newer(kw['qrc'], kw['py']): - continue - 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) Deleted: pymoul/trunk/distutils_iss.py =================================================================== --- pymoul/trunk/distutils_iss.py 2007-02-02 17:13:40 UTC (rev 120) +++ pymoul/trunk/distutils_iss.py 2007-02-02 17:22:22 UTC (rev 121) @@ -1,514 +0,0 @@ -"""Distutils helper for creating and running InnoSetup Script files -""" -__author__ = "Christian Heimes" -__version__ = "$Id" -__revision__ = "$Revision$" - -import os -import sys -import re -from distutils import log -from fnmatch import fnmatch -from subprocess import call as subcall -from ConfigParser import SafeConfigParser -from ConfigParser import NoSectionError -from ConfigParser import DEFAULTSECT -from string import ascii_letters - -class ISSConfigParser(SafeConfigParser): - """Config parser with some extensions for ISS - - new methods: - add_header(string) - Adds comments to the header - set_raw(section, string) - Adds a raw entry to a section - add_sectionif(section) - setif(section, option, value) - - changed behavior: - doesn't write [default] section to file - interpolates "%(...)s" when writing to file - doesn't parse key: value - parses "Key: "value"; ..." to raw - writes sections in the order they are created - - >>> from StringIO import StringIO - >>> defaults = {'appname' : 'Test App'} - >>> cfg = ISSConfigParser(defaults) - >>> cfg.add_header("header") - - >>> cfg.add_section("testsection") - >>> cfg.set("testsection", "key", "value %(appname)s") - >>> cfg.set_raw("testsection", 'Rawline: "%(appname)s";') - - >>> out = StringIO() - >>> cfg.write(out) - >>> out.seek(0) - >>> data = out.read() - >>> print data - ; header - [testsection] - key = value Test App - Rawline: "Test App"; - <BLANKLINE> - - >>> template = StringIO(data) - >>> del cfg, out, data - >>> cfg = ISSConfigParser(defaults) - >>> cfg.readfp(template) - >>> cfg._sections - {'testsection': {'__name__': 'testsection', 'key': 'value Test App'}} - >>> cfg._raw - {'testsection': ['Rawline: "Test App";']} - - >>> out = StringIO() - >>> cfg.write(out) - >>> out.seek(0) - >>> data = out.read() - >>> print data - [testsection] - key = value Test App - Rawline: "Test App"; - <BLANKLINE> - - >>> - """ - def __init__(self, defaults=None): - SafeConfigParser.__init__(self, defaults) - self._raw = {} - self._header = [] - self._order = [] - - def add_header(self, value): - """Add a header comment - """ - self._header.append(value) - - def add_section(self, section): - """Create a new section in the configuration. - """ - SafeConfigParser.add_section(self, section) - self._raw[section]= [] - self._order.append(section) - - def add_sectionif(self, section): - """Create a new section in the configuration if section doesn't exist. - """ - if not self.has_section(section): - self.add_section(section) - return True - - def setif(self, section, option, value): - """Set section-option to value if option is not yet set - """ - if not self.has_option(section, option): - self.set(section, option, value) - return True - - def set_raw(self, section, raw): - """Add a raw string to a section - """ - try: - sec = self._raw[section] - except KeyError: - raise NoSectionError(section) - if isinstance(raw, (tuple, list)): - for r in raw: - sec.append(r) - else: - sec.append(raw) - - def get_raw(self, section, raw=False, vars=None): - """Get all raw lines as string for a given section. - - Interpolates %(var)s vars - """ - d = self._defaults.copy() - try: - d.update(self._sections[section]) - except KeyError: - if section != DEFAULTSECT: - raise NoSectionError(section) - # Update with the entry specific variables - if vars: - for key, value in vars.items(): - d[self.optionxform(key)] = value - try: - rawdata = "\n".join(self._raw[section]) - except KeyError: - return None - - if raw: - return rawdata - else: - return self._interpolate(section, "RAWDATA", rawdata, d) - - def optionxform(self, optionstr): - return optionstr - - def write(self, fp): - """Write an .ini-format representation of the configuration state.""" - for header in self._header: - fp.write("; %s\n" % header.replace('\n', '; \n')) - #if self._defaults: - # fp.write("[%s]\n" % DEFAULTSECT) - # for (key, value) in self._defaults.items(): - # fp.write("%s = %s\n" % (key, str(value).replace('\n', '\n\t'))) - # fp.write("\n") - for section in self._order: - fp.write("[%s]\n" % section) - for key in self._sections[section]: - if key == "__name__": - continue - value = self.get(section, key, raw=False) - fp.write("%s = %s\n" % - (key, str(value).replace('\n', '\n\t'))) - rawdata = self.get_raw(section, raw=False) - if rawdata: - fp.write(rawdata) - fp.write("\n") - - def remove_section(self, section): - """Remove a file section.""" - existed = RawConfigParser.remove_section(self, section) - if existed: - del self._raw[section] - return existed - - OPTCRE = re.compile( - r'(?P<option>[^=\s][^=]*)' # very permissive! - r'\s*(?P<vi>[=])\s*' # any number of space/tab, - # followed by separator - # (either : or =), followed - # by any # space/tab - r'(?P<value>.*)$' # everything up to eol - ) - - RAWRE = re.compile( - r'^[A-Z][A-Za-z]*:\s?' # 'Name: ' - r'".*";' # '"value ...";' and - ) - - def _read(self, fp, fpname): - """Parse a sectioned setup file. - - From ConfigParser.RawConfigParser - """ - cursect = None # None, or a dictionary - curraw = None - optname = None - lineno = 0 - e = None # None, or an exception - while True: - line = fp.readline() - if not line: - break - lineno = lineno + 1 - # comment or blank line? - if line.strip() == '' or line[0] in '#;': - continue - if line.split(None, 1)[0].lower() == 'rem' and line[0] in "rR": - # no leading whitespace - continue - # continuation line? - if line[0].isspace() and cursect is not None and optname: - value = line.strip() - if value: - cursect[optname] = "%s\n%s" % (cursect[optname], value) - # a section header or option header? - else: - # is it a section header? - mo = self.SECTCRE.match(line) - if mo: - sectname = mo.group('header') - if sectname in self._sections: - cursect = self._sections[sectname] - curraw = self._raw[sectname] - elif sectname == DEFAULTSECT: - cursect = self._defaults - else: - cursect = {'__name__': sectname} - curraw = [] # new - self._order.append(sectname) # new - self._sections[sectname] = cursect - self._raw[sectname] = curraw # new - # So sections can't start with a continuation line - optname = None - # no section header in the file? - elif cursect is None: - raise MissingSectionHeaderError(fpname, lineno, line) - # an option line? - else: - mo = self.OPTCRE.match(line) - if mo: - optname, vi, optval = mo.group('option', 'vi', 'value') - if vi in ('=', ':') and ';' in optval: - # ';' is a comment delimiter only if it follows - # a spacing character - pos = optval.find(';') - if pos != -1 and optval[pos-1].isspace(): - optval = optval[:pos] - optval = optval.strip() - # allow empty values - if optval == '""': - optval = '' - optname = self.optionxform(optname.rstrip()) - cursect[optname] = optval - else: - mo = self.RAWRE.match(line) # new - if mo: - # found a InnoSetup raw line - curraw.append(line.strip()) - else: - # a non-fatal parsing error occurred. set up the - # exception but keep going. the exception will be - # raised at the end of the file and will contain a - # list of all bogus lines - if not e: - e = ParsingError(fpname) - e.append(lineno, repr(line)) - # if any parsing errors occurred, raise an exception - if e: - raise e - - -class InnoSetupCommandMixin: - """Mixin class class for a distutils command - - You have call initialize_options() and run() from your class! - - >>> from tempfile import mkstemp - >>> tmphdlr, tmpfile = mkstemp() - - >>> test = InnoSetupCommandMixin() - >>> test.initialize_options() - >>> test.app_name = "Test App" - >>> test.innosetup = True - >>> test.inno_script = tmpfile - >>> test.lib_dir = 'li', - >>> test.dist_dir = 'dist' - >>> test.windows_exe_files = [r'dist\\test.exe'] - >>> test.lib_files = [r'dist\\lib1', r'dist\\lib2'] - - >>> try: - ... test.run() - ... finally: - ... data = open(tmpfile).read() - ... os.unlink(tmpfile) - - #>>> print data - """ - def initialize_options(self): - self.app_name = '' - self.innosetup = False - self.inno_script = None - self.inno_version = "1.0" - self.inno_templates = None - self.inno_interpolation = {} - self.inno_sections = {} - self.inno_languages = [('nl', 'Dutch'), ('de', 'German'), - ('fr', 'French'), ('it', 'Italian'), - ('es', 'Spanish') - ] - - def run(self): - self._createInnoSetup() - - def _createInnoSetup(self): - if not self.innosetup: - return - - self._inno_script = InnoScript( - self.app_name, - self.lib_dir, - self.dist_dir, - self.windows_exe_files, - self.lib_files, - inno_script = self.inno_script, - templates = self.inno_templates, - interpolation = self.inno_interpolation, - sections = self.inno_sections, - languages = self.inno_languages) - - print "*** creating the inno setup script***" - self._inno_script.create() - print "*** compiling the inno setup script***" - try: - self._inno_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 - - appname - name of the app - lib_dir - internal - dist_dir - internal - windows_exe_files - internal - lib_files - internal - inno_script=None - path to IS script output file - templates = None - list of template file names or single file - version = "1.0" - version string - interpolation - dict with additional %()s interpolation items - sections - dict with additional section informations - languages - list with languages tuples e.g. [('de', 'German')] - - sections = {'sectioname' : - {'key' : 'value', - 'RAW' : 'string or list with raw items' - } - } - - """ - def __init__(self, - appname, - lib_dir, - dist_dir, - windows_exe_files, - lib_files, - inno_script=None, - templates = None, - version = "1.0", - interpolation = {}, - sections = {}, - languages = [] - ): - self.lib_dir = lib_dir - self.dist_dir = dist_dir - if not self.dist_dir[-1] in "\\/": - self.dist_dir += "\\" - self.windows_exe_files = [self.chop(p) for p in windows_exe_files] - self.lib_files = [self.chop(p) for p in lib_files] - if inno_script is None: - self.inno_script = os.path.join(dist_dir, appname.replace(' ', '_')+'.iss') - else: - self.inno_script = inno_script - self.fd = open(self.inno_script, "w") - - ip = interpolation.copy() - ip['appname'] = appname - ip['version'] = version - ip['appnamestripped'] = "".join([c for c in appname - if c in ascii_letters]) - ip['appexe'] = self.windows_exe_files[0] - self.interpolation = ip - - self.cfg = ISSConfigParser(ip) - if templates: - read = self.cfg.read(templates) - self.sections = sections - self.languages = languages - - def chop(self, pathname): - assert pathname.startswith(self.dist_dir) - return pathname[len(self.dist_dir):] - - def create(self): - """create Inno Script - """ - self.createInnoScript() - self.modifyInnoScript() - self.writeInnoScript() - - def createInnoScript(self): - """Create Inno Script cfg - """ - cfg = self.cfg - cfg.add_header("WARNING: This script has been created by py2exe. Changes to this script") - cfg.add_header("will be overwritten the next time py2exe is run!\n") - - cfg.add_sectionif("Setup") - # Setup - cfg.setif("Setup", "AppName", "%(appname)s") - cfg.setif("Setup", "AppVerName", "%(appname)s %(version)s") - cfg.setif("Setup", "DefaultDirName", "{pf}\%(appname)s") - cfg.setif("Setup", "DefaultGroupName", "%(appname)s") - - self._writeLanguagesSect() - self._writeWindowsExeFiles() - self._writeLibFiles() - #self._writeIcons() - self._writeSections() - - def _writeLanguagesSect(self): - cfg = self.cfg - if not self.languages: - return - cfg.add_sectionif('Languages') - for key, lang in self.languages: - cfg.set_raw("Languages", - 'Name: "%s"; MessagesFile: "compiler:Languages\%s.isl"' % - (key, lang)) - - def _writeWindowsExeFiles(self): - cfg = self.cfg - cfg.add_sectionif("Files") - for path in self.windows_exe_files: - cfg.set_raw("Files", - r'Source: "%s"; DestDir: "{app}\%s"; Flags: ignoreversion' - % (path, os.path.dirname(path)) ) - - def _writeLibFiles(self): - cfg = self.cfg - cfg.add_sectionif("Files") - for path in self.lib_files: - cfg.set_raw("Files", - r'Source: "%s"; DestDir: "{app}\%s"; Flags: ignoreversion' - % (path, os.path.dirname(path)) ) - - def _writeIcons(self): - cfg = self.cfg - cfg.add_sectionif("Icons") - for path in self.windows_exe_files: - cfg.set_raw("Icons", - 'Name: "{group}\\%(appname)s"; Filename: "{app}\\' + path + '"') - cfg.set_raw("Icons", r'Name: "{group}\Uninstall %(appname)s"; Filename: "{uninstallexe}"') - - def _writeSections(self): - cfg = self.cfg - # Additional things in self.sections - for section in self.sections: - cfg.add_sectionif(section) - for key, value in self.sections[section].items(): - if key == "RAW": - cfg.set_raw(section, value) - else: - cfg.set(section, key, value) - - def modifyInnoScript(self): - """Hook - """ - pass - - def writeInnoScript(self): - """Write script to disk - """ - self.cfg.write(self.fd) - self.fd.close() - - def compile(self): - import ctypes - res = ctypes.windll.shell32.ShellExecuteA(0, "compile", - self.inno_script, - None, - None, - 0) - if res < 32: - raise RuntimeError("ShellExecute failed, error %d" % res) - - def __call__(self): - self.create() - self.compile() - -def test_suite(): - import unittest - from doctest import DocTestSuite - return unittest.TestSuite(( - DocTestSuite(__name__), - )) - -if __name__ == '__main__': - import unittest - unittest.main(defaultTest="test_suite") Deleted: pymoul/trunk/distutils_upx.py =================================================================== --- pymoul/trunk/distutils_upx.py 2007-02-02 17:13:40 UTC (rev 120) +++ pymoul/trunk/distutils_upx.py 2007-02-02 17:22:22 UTC (rev 121) @@ -1,157 +0,0 @@ -"""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 as subcall -from distutils import log -from stat import ST_SIZE -from fnmatch import fnmatch -from distutils_iss import InnoSetupCommandMixin - -class UpxCommand(InnoSetupCommandMixin): - """Upx packer mixin class for distutils - - Usage: - class UpxPy2exe(UpxCommand, py2exe): - pass - - setup(..., cmdclass = {'py2exe': UpxPy2exe}) - - The mixin class should work for every distutils Command based class on - every os (Win32, Mac, Linux). - - New options: - o upx - True/False - o upx_args - additional args for upx (e.g. "--no-color --best") - o upx_path - path to upx if not in os.environ['PATH'] - o upx_extensions - list of extensions to packed (e.g. ['dll','pyd','exe']) - o upx_ignore - list of pattern to ignore (e.g. ['python*.dll']= - """ - - def initialize_options(self): - result = self._otherclass().initialize_options(self) - InnoSetupCommandMixin.initialize_options(self) - self.upx = True - self.upx_args = '--no-color' - self.upx_path = 'upx' - self.upx_extensions = [ - 'pyd', 'dll', 'exe', # Windows - '', 'so', # Linux - 'dylib', # Mac OS X - ] - self.upx_ignore = [] - return result - - def finalize_options(self): - result = self._otherclass().finalize_options(self) - self.has_upx = self._upxAvailable() - self.upx_packlist = [] - return result - - def copy_file(self, *args, **kwargs): - result = self._otherclass().copy_file(self, *args, **kwargs) - self.upx_packlist.append(result) - return result - - def run(self, *args, **kwargs): - result = self._otherclass().run(self, *args, **kwargs) - self._upxPack() - InnoSetupCommandMixin.run(self) - 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 - - packed = [] - for fname, copied in self.upx_packlist: - if not copied: - continue - basename = os.path.basename(fname) - tmp, ext = os.path.splitext(basename) - ext = ext[1:] # strip leading dot - - # check extension - if ext not in self.upx_extensions: - continue - # check ignores - if self.upx_ignore: - matches = [pat for pat in self.upx_ignore if fnmatch(basename, pat)] - if matches: - continue - - origsize = os.stat(fname)[ST_SIZE] - self._upxPackFile(os.path.normpath(fname)) - newsize = os.stat(fname)[ST_SIZE] - ratio = newsize*100 / origsize - packed.append((basename, origsize, newsize, ratio)) - - print "\n*** UPX result ***" - for basename, origsize, newsize, ratio in packed: - print " %s packed to %i%%" % (basename, ratio) - if not packed: - print " no files packed" - print "\n" - - def _upxPackFile(self, fname): - """Pack a file - """ - 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 - pass - else: # something bad has happend - sys.exit(retcode) # XXX - - def _upxAvailable(self): - """Search for UPX in search path - """ - stdout = TemporaryFile() - try: - try: - retcode = subcall("%s --version" % self.upx_path, stdout=stdout) - finally: - if stdout: - stdout.close() - 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 - - @classmethod - def _otherclass(cls): - """Workaround: distutils.cmd.Command is an old style class - - Find next class in MRO that is not based on UpxCommand class - """ - for c in getmro(cls): - if not issubclass(c, (UpxCommand, InnoSetupCommandMixin)): - return c - raise ValueError(cls) - -try: - from py2exe.build_exe import py2exe -except ImportError: - pass -else: - class UpxPy2exe(UpxCommand, py2exe): - pass Added: pymoul/trunk/doc/XXXreport.html =================================================================== --- pymoul/trunk/doc/XXXreport.html (rev 0) +++ pymoul/trunk/doc/XXXreport.html 2007-02-02 17:22:22 UTC (rev 121) @@ -0,0 +1,411 @@ +<html><head><title>XXX/TODO/FIXME-Comment report for pyMoul</title> +</head> + +<body> +<h1>pyMoul - Developer report tools: XXX/TODO/FIXME comments</h1> +<p>Generated on Fri, 02 Feb 2007 18:18:36 CET, based on Zope 3's XXX report</p> +<hr> +<h3>Summary</h3> +<p> + There are currently 100 XXX/TODO/FIXME comments. +</p> +<hr/> +<h3>Listing</h3> +<ol><li><b>File: utilities/../.svn/text-base/ez_setup.py.svn-base:92</b><br/><pre> # XXX could we install in a subprocess here? +base-93- print >>sys.stderr, ( +base-94- "The required version of setuptools (>=%s) is not available, and\n" +base-95- "can't be installed while this script is running. Please install\n" +</pre></li><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-549- # separated by a horizontal dash line. Only the first one of +base-550- # them is now colorized properly. +base-551- header = lines[0] +</pre></li><li><b>File: utilities/../.svn/text-base/test.py.svn-base:603</b><br/><pre> # TODO: Scrape and colorize the traceback. +base-604- result.append(self.colorize('doctest_got', line)) +base-605- elif remaining[0] == 'Differences (ndiff with -expected +actual):': +base-606- result.append(self.colorize('doctest_title', remaining.pop(0))) # E. raised: +</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-624- # A colorizer for the Python's doctest module would be nice too. +base-625- if doctest: +base-626- # If we have a doctest, we do not care about this header. All the +</pre></li><li><b>File: utilities/../.svn/text-base/test.py.svn-base:690</b><br/><pre> # TODO these should be hookable +base-691- from zope.tales.tales import TALESTracebackSupplement +base-692- from zope.pagetemplate.pagetemplate \ +base-693- import PageTemplateTracebackSupplement +</pre></li><li><b>File: utilities/../.svn/text-base/setup_win32.py.svn-base:84</b><br/><pre> pexe['innosetup'] = os.environ.get('INNOSETUP') # TODO: +base-85- pexe['inno_templates'] = "template.iss" +base-86- pexe['app_name'] = 'pyMoul' +base-87- pexe['includes'].extend(findPyTz()) +</pre></li><li><b>File: utilities/../.svn/text-base/distutils_upx.py.svn-base:117</b><br/><pre> sys.exit(retcode) # XXX +base-118- +base-119- def _upxAvailable(self): +base-120- """Search for UPX in search path +</pre></li><li><b>File: utilities/../src/moul/file/.svn/text-base/chatlog.py.svn-base:268</b><br/><pre> # TODO: add parser, currently simply iterates over the file +base-269- return iter(self._fd) +</pre></li><li><b>File: utilities/../src/moul/file/.svn/text-base/kiimage.py.svn-base:112</b><br/><pre> # XXX use struct +base-113- if header is None: +base-114- fd = self._fd +base-115- fd.seek(0) +</pre></li><li><b>File: utilities/../src/moul/file/.svn/text-base/kiimage.py.svn-base:127</b><br/><pre> # XXX use struct +base-128- if size is None: +base-129- size = self.getFileSize() +base-130- leading = 4* [None] +</pre></li><li><b>File: utilities/../src/moul/file/.svn/text-base/wdysini.py.svn-base:156</b><br/><pre> # TODO: write me +base-157- pass +base-158- +base-159-class Constrain(object): +</pre></li><li><b>File: utilities/../src/moul/file/.svn/text-base/wdysini.py.svn-base:540</b><br/><pre> 'Audio.SetDeviceName' : (QuotedString, Constrain()), # TODO: add check +base-541- 'Audio.SetChannelVolume GUI' : (FloatString, MinMax(0.0, 1.0)), # 0-100%, no ui +base-542- # microphon missing -> OS mixer +base-543- } +</pre></li><li><b>File: utilities/../src/moul/file/.svn/text-base/wdysini.py.svn-base:628</b><br/><pre> # TODO: microphon needs an extra handler. The mic slider changes the OS mixer. +base-629- +base-630-class GraphicsIni(ConfFile): +base-631- _filename = 'graphics.ini' +</pre></li><li><b>File: utilities/../src/moul/file/.svn/text-base/directory.py.svn-base:58</b><br/><pre> # TODO: fnmatch +base-59- return len([name for name in os.listdir(path) +base-60- if os.path.isfile(os.path.join(path, name))]) +base-61- +</pre></li><li><b>File: utilities/../src/moul/file/tests/.svn/text-base/test_wdysini.py.svn-base:104</b><br/><pre> # TODO: more +base-105- +base-106- def test_publicapi_create(self): +base-107- inipath = os.path.join(self.tmpdir, os.path.basename(self.enc)) +</pre></li><li><b>File: utilities/../src/moul/file/tests/.svn/text-base/test_wdysini.py.svn-base:115</b><br/><pre> # TODO: more +base-116- +base-117-class AudioIniTest(GenericIniTest): +base-118- enc = aud_enc +</pre></li><li><b>File: utilities/../src/moul/file/tests/.svn/text-base/test_wdysini.py.svn-base:153</b><br/><pre> #XXX self.failIf(p.isChanged()) +base-154- +base-155- p.screenres = 0 +base-156- eq(p._get('Graphics.Width'), 800) +</pre></li><li><b>File: utilities/../src/moul/file/tests/.svn/text-base/utils.py.svn-base:79</b><br/><pre> for fname in ('UruLauncher.exe', 'UruExplorer.exe'): # XXX: win32 +base-80- fd = open(os.path.join(path, fname), 'wb') +base-81- fd.write('dummy') +base-82- fd.close() +</pre></li><li><b>File: utilities/../src/moul/file/tests/test_wdysini.py:104</b><br/><pre> # TODO: more + + def test_publicapi_create(self): + inipath = os.path.join(self.tmpdir, os.path.basename(self.enc)) +</pre></li><li><b>File: utilities/../src/moul/file/tests/test_wdysini.py:115</b><br/><pre> # TODO: more + +class AudioIniTest(GenericIniTest): + enc = aud_enc +</pre></li><li><b>File: utilities/../src/moul/file/tests/test_wdysini.py:153</b><br/><pre> #XXX self.failIf(p.isChanged()) + + p.screenres = 0 + eq(p._get('Graphics.Width'), 800) +</pre></li><li><b>File: utilities/../src/moul/file/tests/utils.py:79</b><br/><pre> for fname in ('UruLauncher.exe', 'UruExplorer.exe'): # XXX: win32 + fd = open(os.path.join(path, fname), 'wb') + fd.write('dummy') + fd.close() +</pre></li><li><b>File: utilities/../src/moul/file/chatlog.py:268</b><br/><pre> # TODO: add parser, currently simply iterates over the file + return iter(self._fd) +</pre></li><li><b>File: utilities/../src/moul/file/kiimage.py:112</b><br/><pre> # XXX use struct + if header is None: + fd = self._fd + fd.seek(0) +</pre></li><li><b>File: utilities/../src/moul/file/kiimage.py:127</b><br/><pre> # XXX use struct + if size is None: + size = self.getFileSize() + leading = 4* [None] +</pre></li><li><b>File: utilities/../src/moul/file/wdysini.py:156</b><br/><pre> # TODO: write me + pass + +class Constrain(object): +</pre></li><li><b>File: utilities/../src/moul/file/wdysini.py:540</b><br/><pre> 'Audio.SetDeviceName' : (QuotedString, Constrain()), # TODO: add check + 'Audio.SetChannelVolume GUI' : (FloatString, MinMax(0.0, 1.0)), # 0-100%, no ui + # microphon missing -> OS mixer + } +</pre></li><li><b>File: utilities/../src/moul/file/wdysini.py:628</b><br/><pre> # TODO: microphon needs an extra handler. The mic slider changes the OS mixer. + +class GraphicsIni(ConfFile): + _filename = 'graphics.ini' +</pre></li><li><b>File: utilities/../src/moul/file/kiimage.py~:112</b><br/><pre> # XXX use struct + if header is None: + fd = self._fd + fd.seek(0) +</pre></li><li><b>File: utilities/../src/moul/file/kiimage.py~:127</b><br/><pre> # XXX use struct + if size is None: + size = self.getFileSize() + leading = 4* [None] +</pre></li><li><b>File: utilities/../src/moul/file/chatlog.py~:268</b><br/><pre> # TODO: add parser, currently simply iterates over the file + return iter(self._fd) +</pre></li><li><b>File: utilities/../src/moul/file/wdysini.py~:156</b><br/><pre> # TODO: write me + pass + +class Constrain(object): +</pre></li><li><b>File: utilities/../src/moul/file/wdysini.py~:540</b><br/><pre> 'Audio.SetDeviceName' : (QuotedString, Constrain()), # TODO: add check + 'Audio.SetChannelVolume GUI' : (FloatString, MinMax(0.0, 1.0)), # 0-100%, no ui + # microphon missing -> OS mixer + } +</pre></li><li><b>File: utilities/../src/moul/file/wdysini.py~:628</b><br/><pre> # TODO: microphon needs an extra handler. The mic slider changes the OS mixer. + +class GraphicsIni(ConfFile): + _filename = 'graphics.ini' +</pre></li><li><b>File: utilities/../src/moul/file/directory.py:58</b><br/><pre> # TODO: fnmatch + return len([name for name in os.listdir(path) + if os.path.isfile(os.path.join(path, name))]) + +</pre></li><li><b>File: utilities/../src/moul/crypt/.svn/text-base/whatdoyousee.py.svn-base:76</b><br/><pre> # XXX: dos format +base-77- return data.replace("\r\n", "\n") +base-78- +base-79-def encryptWDYS(instr, fout): +</pre></li><li><b>File: utilities/../src/moul/crypt/.svn/text-base/whatdoyousee.py.svn-base:86</b><br/><pre> # XXX: dos format +base-87- instr = instr.replace("\n", "\r\n") +base-88- fout.seek(0) +base-89- fout.write(HEADER) +</pre></li><li><b>File: utilities/../src/moul/crypt/.svn/text-base/elf.py.svn-base:70</b><br/><pre> # XXX NotImplemented +base-71- raise NotImplementedError +base-72- +base-73-def decipher(crypt, size, key): +</pre></li><li><b>File: utilities/../src/moul/crypt/whatdoyousee.py:76</b><br/><pre> # XXX: dos format + return data.replace("\r\n", "\n") + +def encryptWDYS(instr, fout): +</pre></li><li><b>File: utilities/../src/moul/crypt/whatdoyousee.py:86</b><br/><pre> # XXX: dos format + instr = instr.replace("\n", "\r\n") + fout.seek(0) + fout.write(HEADER) +</pre></li><li><b>File: utilities/../src/moul/crypt/elf.py:70</b><br/><pre> # XXX NotImplemented + raise NotImplementedError + +def decipher(crypt, size, key): +</pre></li><li><b>File: utilities/../src/moul/qt/.svn/text-base/localization.py.svn-base:78</b><br/><pre> # TODO: other message box +base-79- self._journal_progressbar = SimpleProgressbar(self) +base-80- self._journal_progressbar.setWindowTitle(self.trUtf8("Loading journals")) +base-81- self._journal_progressbar.setProgressbar(0, 1, 0) +</pre></li><li><b>File: utilities/../src/moul/qt/.svn/text-base/mainwindow.py.svn-base:76</b><br/><pre> # TODO: checks +base-77- self.urudatadir.initializeFactories() +base-78- +base-79- # init handlers +</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-153- self.emit(SIGNAL("close()")) +base-154- event.accept() +base-155- event.ignore() +</pre></li><li><b>File: utilities/../src/moul/qt/.svn/text-base/mainwindow.py.svn-base:189</b><br/><pre> # TODO: msg +base-190- return +base-191- +base-192- self.pb_kiimage_repair.setEnabled(False) +</pre></li><li><b>File: utilities/../src/moul/qt/.svn/text-base/mainwindow.py.svn-base:219</b><br/><pre> # TODO: msg +base-220- +base-221- # ************************************************************************ +base-222- # graphics settings +</pre></li><li><b>File: utilities/../src/moul/qt/.svn/text-base/mainwindow.py.svn-base:237</b><br/><pre> self.emit(SIGNAL("graphicsini_loaded()")) # XXX: hard coded emit +base-238- +base-239- @signalLogDecorator(LOG) +base-240- def on_graphicsini_loaded(self): +</pre></li><li><b>File: utilities/../src/moul/qt/.svn/text-base/mainwindow.py.svn-base:297</b><br/><pre> # XXX: fixme +base-298- txt = videoModes.getVidModeHuman(idx) +base-299- self.lb_screenres.setText(QtCore.QString(txt)) +base-300- self._graphics_ini.screenres = idx +</pre></li><li><b>File: utilities/../src/moul/qt/.svn/text-base/mainwindow.py.svn-base:387</b><br/><pre> self.emit(SIGNAL("audioini_loaded()")) # XXX: hard coded emit +base-388- +base-389- @signalLogDecorator(LOG) +base-390- def on_audioini_loaded(self): +</pre></li><li><b>File: utilities/../src/moul/qt/.svn/text-base/mainwindow.py.svn-base:506</b><br/><pre> # TODO: needs optimization? run only when timer tab is active +base-507- self.connect(timer, SIGNAL('timeout()'), self.on_timezone_timer_timeout) +base-508- timer.start() +base-509- +</pre></li><li><b>File: utilities/../src/moul/qt/.svn/text-base/mainwindow.py.svn-base:602</b><br/><pre> # TODO: thread safety! +base-603- self.servers = servers +base-604- if not self.isRunning(): +base-605- self.start() +</pre></li><li><b>File: utilities/../src/moul/qt/.svn/text-base/mainwindow.py.svn-base:608</b><br/><pre> # TODO: thread safety! +base-609- # emit a list of names first +base-610- for server in self.servers: +base-611- self.emit(SIGNAL("server(const QString&)"), server.name) +</pre></li><li><b>File: utilities/../src/moul/qt/.svn/text-base/mainwindow.py.svn-base:644</b><br/><pre> # TODO check this +base-645- self._running = False +base-646- self.condition.wakeAll() +base-647- +</pre></li><li><b>File: utilities/../src/moul/qt/.svn/text-base/errorhandler.py.svn-base:46</b><br/><pre> # TODO: translation aware +base-47- LOG.critical("UNHANDLED ERROR", exc_info=(typ, value, traceback)) +base:48: return # XXX: remove +base-49- try: +base-50- title= QtGui.QApplication.translate("excepthook", +base-51- "An unhandled error has occured", +</pre></li><li><b>File: utilities/../src/moul/qt/mainwindow.py~:76</b><br/><pre> # TODO: checks + self.urudatadir.initializeFactories() + + # init handlers +</pre></li><li><b>File: utilities/../src/moul/qt/mainwindow.py~:152</b><br/><pre> # FIXME: signal doesn't do anything + self.emit(SIGNAL("close()")) + event.accept() + event.ignore() +</pre></li><li><b>File: utilities/../src/moul/qt/mainwindow.py~:189</b><br/><pre> # TODO: msg + return + + self.pb_kiimage_repair.setEnabled(False) +</pre></li><li><b>File: utilities/../src/moul/qt/mainwindow.py~:236</b><br/><pre> self.emit(SIGNAL("graphicsini_loaded()")) # XXX: hard coded emit + + @signalLogDecorator(LOG) + def on_graphicsini_loaded(self): +</pre></li><li><b>File: utilities/../src/moul/qt/mainwindow.py~:296</b><br/><pre> # XXX: fixme + txt = videoModes.getVidModeHuman(idx) + self.lb_screenres.setText(QtCore.QString(txt)) + self._graphics_ini.screenres = idx +</pre></li><li><b>File: utilities/../src/moul/qt/mainwindow.py~:386</b><br/><pre> self.emit(SIGNAL("audioini_loaded()")) # XXX: hard coded emit + + @signalLogDecorator(LOG) + def on_audioini_loaded(self): +</pre></li><li><b>File: utilities/../src/moul/qt/mainwindow.py~:505</b><br/><pre> # TODO: needs optimization? run only when timer tab is active + self.connect(timer, SIGNAL('timeout()'), self.on_timezone_timer_timeout) + timer.start() + +</pre></li><li><b>File: utilities/../src/moul/qt/mainwindow.py~:601</b><br/><pre> # TODO: thread safety! + self.servers = servers + if not self.isRunning(): + self.start() +</pre></li><li><b>File: utilities/../src/moul/qt/mainwindow.py~:607</b><br/><pre> # TODO: thread safety! + # emit a list of names first + for server in self.servers: + self.emit(SIGNAL("server(const QString&)"), server.name) +</pre></li><li><b>File: utilities/../src/moul/qt/mainwindow.py~:643</b><br/><pre> # TODO check this + self._running = False + self.condition.wakeAll() + +</pre></li><li><b>File: utilities/../src/moul/qt/localization.py:78</b><br/><pre> # TODO: other message box + self._journal_progressbar = SimpleProgressbar(self) + self._journal_progressbar.setWindowTitle(self.trUtf8("Loading journals")) + self._journal_progressbar.setProgressbar(0, 1, 0) +</pre></li><li><b>File: utilities/../src/moul/qt/mainwindow.py:76</b><br/><pre> # TODO: checks + self.urudatadir.initializeFactories() + + # init handlers +</pre></li><li><b>File: utilities/../src/moul/qt/mainwindow.py:152</b><br/><pre> # FIXME: signal doesn't do anything + self.emit(SIGNAL("close()")) + event.accept() + event.ignore() +</pre></li><li><b>File: utilities/../src/moul/qt/mainwindow.py:189</b><br/><pre> # TODO: msg + return + + self.pb_kiimage_repair.setEnabled(False) +</pre></li><li><b>File: utilities/../src/moul/qt/mainwindow.py:219</b><br/><pre> # TODO: msg + + # ************************************************************************ + # graphics settings +</pre></li><li><b>File: utilities/../src/moul/qt/mainwindow.py:237</b><br/><pre> self.emit(SIGNAL("graphicsini_loaded()")) # XXX: hard coded emit + + @signalLogDecorator(LOG) + def on_graphicsini_loaded(self): +</pre></li><li><b>File: utilities/../src/moul/qt/mainwindow.py:297</b><br/><pre> # XXX: fixme + txt = videoModes.getVidModeHuman(idx) + self.lb_screenres.setText(QtCore.QString(txt)) + self._graphics_ini.screenres = idx +</pre></li><li><b>File: utilities/../src/moul/qt/mainwindow.py:387</b><br/><pre> self.emit(SIGNAL("audioini_loaded()")) # XXX: hard coded emit + + @signalLogDecorator(LOG) + def on_audioini_loaded(self): +</pre></li><li><b>File: utilities/../src/moul/qt/mainwindow.py:506</b><br/><pre> # TODO: needs optimization? run only when timer tab is active + self.connect(timer, SIGNAL('timeout()'), self.on_timezone_timer_timeout) + timer.start() + +</pre></li><li><b>File: utilities/../src/moul/qt/mainwindow.py:602</b><br/><pre> # TODO: thread safety! + self.servers = servers + if not self.isRunning(): + self.start() +</pre></li><li><b>File: utilities/../src/moul/qt/mainwindow.py:608</b><br/><pre> # TODO: thread safety! + # emit a list of names first + for server in self.servers: + self.emit(SIGNAL("server(const QString&)"), server.name) +</pre></li><li><b>File: utilities/../src/moul/qt/mainwindow.py:644</b><br/><pre> # TODO check this + self._running = False + self.condition.wakeAll() + +</pre></li><li><b>File: utilities/../src/moul/qt/errorhandler.py:46</b><br/><pre> # TODO: translation aware + LOG.critical("UNHANDLED ERROR", exc_info=(typ, value, traceback)) + try: + title= QtGui.QApplication.translate("excepthook", + "An unhandled error has occured", +</pre></li><li><b>File: utilities/../src/moul/osdependent/__init__.py:116</b><br/><pre># XXX: what about cygwin, bsd and others? +_thismodule = sys.modules[__name__] +if __WIN32__: + from moul.osdependent import win32 as osdep_win32 +</pre></li><li><b>File: utilities/../src/moul/osdependent/.svn/text-base/__init__.py.svn-base:116</b><br/><pre># XXX: what about cygwin, bsd and others? +base-117-_thismodule = sys.modules[__name__] +base-118-if __WIN32__: +base-119- from moul.osdependent import win32 as osdep_win32 +</pre></li><li><b>File: utilities/../test.py:548</b><br/><pre> # XXX bug: doctest may report several failures in one test, they are + # separated by a horizontal dash line. Only the first one of + # them is now colorized properly. + header = lines[0] +</pre></li><li><b>File: utilities/../test.py:603</b><br/><pre> # TODO: Scrape and colorize the traceback. + result.append(self.colorize('doctest_got', line)) + elif remaining[0] == 'Differences (ndiff with -expected +actual):': + result.append(self.colorize('doctest_title', remaining.pop(0))) # E. raised: +</pre></li><li><b>File: utilities/../test.py:623</b><br/><pre> # TODO: We only deal with the output from Zope 3's doctest module. + # A colorizer for the Python's doctest module would be nice too. + if doctest: + # If we have a doctest, we do not care about this header. All the +</pre></li><li><b>File: utilities/../test.py:690</b><br/><pre> # TODO these should be hookable + from zope.tales.tales import TALESTracebackSupplement + from zope.pagetemplate.pagetemplate \ + import PageTemplateTracebackSupplement +</pre></li><li><b>File: utilities/../contrib/.svn/text-base/build_exe.py.svn-base:6</b><br/><pre># Todo: +base-7-# +base-8-# Make 'unbuffered' a per-target option +base-9- +</pre></li><li><b>File: utilities/../contrib/.svn/text-base/build_exe.py.svn-base:357</b><br/><pre>## extra_path = ["."] # XXX +base-358- extra_path = [] +base-359- dlls, unfriendly_dlls, other_depends = \ +base-360- self.find_dependend_dlls(dlls, +</pre></li><li><b>File: utilities/../contrib/.svn/text-base/build_exe.py.svn-base:403</b><br/><pre> # XXX all dlls are copied into the same directory - a flat name space. +base-404- # sooner or later that will give conflicts. +base-405- dst = os.path.join(self.lib_dir, os.path.basename(item.__file__)) +base-406- self.copy_file(src, dst, preserve_mode=0) +</pre></li><li><b>File: utilities/../contrib/.svn/text-base/build_exe.py.svn-base:919</b><br/><pre> # XXX On Windows NT, the SYSTEM directory is also searched +base-920- exedir = os.path.dirname(sys.executable) +base-921- syspath = os.environ['PATH'] +base-922- loadpath = ';'.join([exedir, sysdir, windir, syspath]) +</pre></li><li><b>File: utilities/../contrib/.svn/text-base/build_exe.py.svn-base:1329</b><br/><pre># XXX This list is NOT complete (it cannot be) +base-1330-# Note: ALL ENTRIES MUST BE IN LOWER CASE! +base-1331-EXCLUDED_DLLS = ( +base-1332- "advapi32.dll", +</pre></li><li><b>File: utilities/../contrib/.svn/text-base/build_exe.py.svn-base:1362</b><br/><pre># XXX Perhaps it would be better to assume dlls from the systemdir are system dlls, +base-1363-# and make some exceptions for known dlls, like msvcr71, pythonXY.dll, and so on? +base-1364-def isSystemDLL(pathname): +base-1365- if os.path.basename(pathname).lower() in ("msvcr71.dll", "msvcr71d.dll"): +</pre></li><li><b>File: utilities/../contrib/build_exe.py:6</b><br/><pre># Todo: +# +# Make 'unbuffered' a per-target option + +</pre></li><li><b>File: utilities/../contrib/build_exe.py:357</b><br/><pre>## extra_path = ["."] # XXX + extra_path = [] + dlls, unfriendly_dlls, other_depends = \ + self.find_dependend_dlls(dlls, +</pre></li><li><b>File: utilities/../contrib/build_exe.py:403</b><br/><pre> # XXX all dlls are copied into the same directory - a flat name space. + # sooner or later that will give conflicts. + dst = os.path.join(self.lib_dir, os.path.basename(item.__file__)) + self.copy_file(src, dst, preserve_mode=0) +</pre></li><li><b>File: utilities/../contrib/build_exe.py:919</b><br/><pre> # XXX On Windows NT, the SYSTEM directory is also searched + exedir = os.path.dirname(sys.executable) + syspath = os.environ['PATH'] + loadpath = ';'.join([exedir, sysdir, windir, syspath]) +</pre></li><li><b>File: utilities/../contrib/build_exe.py:1329</b><br/><pre># XXX This list is NOT complete (it cannot be) +# Note: ALL ENTRIES MUST BE IN LOWER CASE! +EXCLUDED_DLLS = ( + "advapi32.dll", +</pre></li><li><b>File: utilities/../contrib/build_exe.py:1362</b><br/><pre># XXX Perhaps it would be better to assume dlls from the systemdir are system dlls, +# and make some exceptions for known dlls, like msvcr71, pythonXY.dll, and so on? +def isSystemDLL(pathname): + if os.path.basename(pathname).lower() in ("msvcr71.dll", "msvcr71d.dll"): +</pre></li><li><b>File: utilities/../utilities/.svn/text-base/setup_win32.py.svn-base:84</b><br/><pre> pexe['innosetup'] = os.environ.get('INNOSETUP') # TODO: +base-85- pexe['inno_templates'] = "template.iss" +base-86- pexe['app_name'] = 'pyMoul' +base-87- pexe['includes'].extend(findPyTz()) +</pre></li><li><b>File: utilities/../utilities/.svn/text-base/distutils_upx.py.svn-base:117</b><br/><pre> sys.exit(retcode) # XXX +base-118- +base-119- def _upxAvailable(self): +base-120- """Search for UPX in search path +</pre></li><li><b>File: utilities/../utilities/.svn/text-base/ez_setup.py.svn-base:92</b><br/><pre> # XXX could we install in a subprocess here? +base-93- print >>sys.stderr, ( +base-94- "The required version of setuptools (>=%s) is not available, and\n" +base-95- "can't be installed while this script is running. Please install\n" +</pre></li><li><b>File: utilities/../utilities/setup_win32.py:84</b><br/><pre> pexe['innosetup'] = os.environ.get('INNOSETUP') # TODO: + pexe['inno_templates'] = "template.iss" + pexe['app_name'] = 'pyMoul' + pexe['includes'].extend(findPyTz()) +</pre></li><li><b>File: utilities/../utilities/distutils_upx.py:117</b><br/><pre> sys.exit(retcode) # XXX + + def _upxAvailable(self): + """Search for UPX in search path +</pre></li><ol></body></html> \ No newline at end of file Deleted: pymoul/trunk/ez_setup.py =================================================================== --- pymoul/trunk/ez_setup.py 2007-02-02 17:13:40 UTC (rev 120) +++ pymoul/trunk/ez_setup.py 2007-02-02 17:22:22 UTC (rev 121) @@ -1,228 +0,0 @@ -#!python -"""Bootstrap setuptools installation - -If you want to use setuptools in your package's setup.py, just include this -file in the same directory with it, and add this to the top of your setup.py:: - - from ez_setup import use_setuptools - use_setuptools() - -If you want to require a specific version of setuptools, set a download -mirror, or use an alternate download directory, you can do so by supplying -the appropriate options to ``use_setuptools()``. - -This file can also be run as a script to install or upgrade setuptools. -""" -import sys -DEFAULT_VERSION = "0.6c5" -DEFAULT_URL = "http://cheeseshop.python.org/packages/%s/s/setuptools/" % sys.version[:3] - -md5_data = { - 'setuptools-0.6b1-py2.3.egg': '8822caf901250d848b996b7f25c6e6ca', - 'setuptools-0.6b1-py2.4.egg': 'b79a8a403e4502fbb85ee3f1941735cb', - 'setuptools-0.6b2-py2.3.egg': '5657759d8a6d8fc44070a9d07272d99b', - 'setuptools-0.6b2-py2.4.egg': '4996a8d169d2be661fa32a6e52e4f82a', - 'setuptools-0.6b3-py2.3.egg': 'bb31c0fc7399a63579975cad9f5a0618', - 'setuptools-0.6b3-py2.4.egg': '38a8c6b3d6ecd22247f179f7da669fac', - 'setuptools-0.6b4-py2.3.egg': '62045a24ed4e1ebc77fe039aa4e6f7e5', - 'setuptools-0.6b4-py2.4.egg': '4cb2a185d228dacffb2d17f103b3b1c4', - 'setuptools-0.6c1-py2.3.egg': 'b3f2b5539d65cb7f74ad79127f1a908c', - 'setuptools-0.6c1-py2.4.egg': 'b45adeda0667d2d2ffe14009364f2a4b', - 'setuptools-0.6c2-py2.3.egg': 'f0064bf6aa2b7d0f3ba0b43f20817c27', - 'setuptools-0.6c2-py2.4.egg': '616192eec35f47e8ea16cd6a122b7277', - 'setuptools-0.6c3-py2.3.egg': 'f181fa125dfe85a259c9cd6f1d7b78fa', - 'setuptools-0.6c3-py2.4.egg': 'e0ed74682c998bfb73bf803a50e7b71e', - 'setuptools-0.6c3-py2.5.egg': 'abef16fdd61955514841c7c6bd98965e', - 'setuptools-0.6c4-py2.3.egg': 'b0b9131acab32022bfac7f44c5d7971f', - 'setuptools-0.6c4-py2.4.egg': '2a1f9656d4fbf3c97bf946c0a124e6e2', - 'setuptools-0.6c4-py2.5.egg': '8f5a052e32cdb9c72bcf4b5526f28afc', - 'setuptools-0.6c5-py2.3.egg': 'ee9fd80965da04f2f3e6b3576e9d8167', - 'setuptools-0.6c5-py2.4.egg': 'afe2adf1c01701ee841761f5bcd8aa64', - 'setuptools-0.6c5-py2.5.egg': 'a8d3f61494ccaa8714dfed37bccd3d5d', -} - -import sys, os - -def _validate_md5(egg_name, data): - if egg_name in md5_data: - from md5 import md5 - digest = md5(data).hexdigest() - if digest != md5_data[egg_name]: - print >>sys.stderr, ( - "md5 validation of %s failed! (Possible download problem?)" - % egg_name - ) - sys.exit(2) - return data - - -def use_setuptools( - version=DEFAULT_VERSION, download_base=DEFAULT_URL, to_dir=os.curdir, - download_delay=15 -): - """Automatically find/download setuptools and make it available on sys.path - - `version` should be a valid setuptools version number that is available - as an egg for download under the `download_base` URL (which should end with - a '/'). `to_dir` is the directory where setuptools will be downloaded, if - it is not already available. If `download_delay` is specified, it should - be the number of seconds that will be paused before initiating a download, - should one be required. If an older version of setuptools is installed, - this routine will print a message to ``sys.stderr`` and raise SystemExit in - an attempt to abort the calling script. - """ - try: - import setuptools - if setuptools.__version__ == '0.0.1': - print >>sys.stderr, ( - "You have an obsolete version of setuptools installed. Please\n" - "remove it from your system entirely before rerunning this script." - ) - sys.exit(2) - except ImportError: - egg = download_setuptools(version, download_base, to_dir, download_delay) - sys.path.insert(0, egg) - import setuptools; setuptools.bootstrap_install_from = egg - - import pkg_resources - try: - pkg_resources.require("setuptools>="+version) - - except pkg_resources.VersionConflict, e: - # XXX could we install in a subprocess here? - print >>sys.stderr, ( - "The required version of setuptools (>=%s) is not available, and\n" - "can't be installed while this script is running. Please install\n" - " a more recent version first.\n\n(Currently using %r)" - ) % (version, e.args[0]) - sys.exit(2) - -def download_setuptools( - version=DEFAULT_VERSION, download_base=DEFAULT_URL, to_dir=os.curdir, - delay = 15 -): - """Download setuptools from a specified location and return its filename - - `version` should be a valid setuptools version number that is available - as an egg for download under the `download_base` URL (which should end - with a '/'). `to_dir` is the directory where the egg will be downloaded. - `delay` is the number of seconds to pause before an actual download attempt. - """ - import urllib2, shutil - egg_name = "setuptools-%s-py%s.egg" % (version,sys.version[:3]) - url = download_base + egg_name - saveto = os.path.join(to_dir, egg_name) ... [truncated message content] |
From: <ti...@us...> - 2007-02-02 17:19:05
|
Revision: 120 http://pymoul.svn.sourceforge.net/pymoul/?rev=120&view=rev Author: tiran Date: 2007-02-02 09:13:40 -0800 (Fri, 02 Feb 2007) Log Message: ----------- Disabled non functional UI elements Added fix KI image code with cool progress bar Modified Paths: -------------- pymoul/trunk/src/moul/file/chatlog.py pymoul/trunk/src/moul/file/kiimage.py pymoul/trunk/src/moul/file/plasmalog.py pymoul/trunk/src/moul/file/wdysini.py pymoul/trunk/src/moul/metadata.py pymoul/trunk/src/moul/qt/mainwindow.py pymoul/trunk/src/moul/qt/simpleprogressbar.py pymoul/trunk/src/moul/qt/threadlet.py pymoul/trunk/src/moul/qt/ui/mainwindow.py pymoul/trunk/src/moul/qt/ui/mainwindow.ui Modified: pymoul/trunk/src/moul/file/chatlog.py =================================================================== --- pymoul/trunk/src/moul/file/chatlog.py 2007-02-02 14:38:56 UTC (rev 119) +++ pymoul/trunk/src/moul/file/chatlog.py 2007-02-02 17:13:40 UTC (rev 120) @@ -93,6 +93,7 @@ self._path = srcdir self._dest = destdir self._logs = [] + LOG.debug("ChatlogMover: %s -> %s" % (srcdir, destdir)) if not os.path.isdir(srcdir): LOG.warning("%s is not a directory" % srcdir) if not os.path.isdir(destdir): Modified: pymoul/trunk/src/moul/file/kiimage.py =================================================================== --- pymoul/trunk/src/moul/file/kiimage.py 2007-02-02 14:38:56 UTC (rev 119) +++ pymoul/trunk/src/moul/file/kiimage.py 2007-02-02 17:13:40 UTC (rev 120) @@ -222,16 +222,20 @@ self._found = [] # all found files self._tocheck = [] # found files to check self._fixed = [] # fixed files + LOG.debug("KIImageFixer: %s -> %s" % (srcdir, destdir)) if not os.path.isdir(srcdir): LOG.warning("%s is not a directory" % srcdir) if not os.path.isdir(destdir): - LOG.info("Creating chatlog directory %s" % destdir) + LOG.info("Creating fixed images directory %s" % destdir) os.mkdir(destdir) def findFiles(self): - """Find filess + """Find files """ + if not os.path.isdir(self._srcdir): + return False + for root, dirs, files in os.walk(self._srcdir): for name in files: matches = [pat for pat in self._pat @@ -248,23 +252,41 @@ LOG.debug("File %s exists and is fixed." % name) else: self._tocheck.append((ki, fixed)) - def checkAndCopyFiles(self): - """Check files if they are KI images + return self._tocheck + def checkAndCopyFile(self, kiname, fixedname): + """Check and copy file + If the file is a KI image than copy the file to the new location """ + ki = KIImage(kiname) + if ki.isMoulImage(): + tmp = ki.removeMoulHeader() + fixed = open(fixedname, 'wb') + while True: + buf = tmp.read(4096) + if not buf: + break + fixed.write(buf) + LOG.info("Created fixed image %s" % fixedname) + self._fixed.append((kiname, fixedname)) + fixed.close() + tmp.close() + ki.close() + + def __len__(self): + """len() support - returns number of images to check + """ + return len(self._tocheck) + + def __iter__(self): + """Iterate over the files to check + + Calls checkAndCopyFiles() for each element. This method is used to + update a progress bar in the UI. + + Yields a NULL seperated string containing "kiname\x00fixedname" + """ for kiname, fixedname in self._tocheck: - ki = KIImage(kiname) - if ki.isMoulImage(): - tmp = ki.removeMoulHeader() - fixed = open(fixedname, 'wb') - while True: - buf = tmp.read(4096) - if not buf: - break - fixed.write(buf) - LOG.info("Created fixed image %s" % fixedname) - self._fixed.append((kiname, fixedname)) - fixed.close() - tmp.close() - ki.close() + yield fixedname # "%s"x00%s" % (kiname, fixedname) + self.checkAndCopyFile(kiname, fixedname) Modified: pymoul/trunk/src/moul/file/plasmalog.py =================================================================== --- pymoul/trunk/src/moul/file/plasmalog.py 2007-02-02 14:38:56 UTC (rev 119) +++ pymoul/trunk/src/moul/file/plasmalog.py 2007-02-02 17:13:40 UTC (rev 120) @@ -43,6 +43,7 @@ def __init__(self, srcdir, destdir): self._srcdir = srcdir self._destdir = destdir + LOG.debug("PlasmalogZipper: %s -> %s" % (srcdir, destdir)) self._zipped_dirs = {} # dirname -> zipfile self._not_removed = [] # files with full path Modified: pymoul/trunk/src/moul/file/wdysini.py =================================================================== --- pymoul/trunk/src/moul/file/wdysini.py 2007-02-02 14:38:56 UTC (rev 119) +++ pymoul/trunk/src/moul/file/wdysini.py 2007-02-02 17:13:40 UTC (rev 120) @@ -314,6 +314,7 @@ if not os.path.isdir(path): LOG.warning("Directory not found %s" % path) self._fpath = os.path.join(path, self._filename) + LOG.debug("ConfFile: %s - %s" % (path, self._filename)) self._filedata = {} self._newdata = {} self._order = [] Modified: pymoul/trunk/src/moul/metadata.py =================================================================== --- pymoul/trunk/src/moul/metadata.py 2007-02-02 14:38:56 UTC (rev 119) +++ pymoul/trunk/src/moul/metadata.py 2007-02-02 17:13:40 UTC (rev 120) @@ -15,8 +15,27 @@ ''' name = '''pyMoul''' -README = '''''' +README = '''========================================= +Python library for Myst Online : Uru Live +========================================= +About +===== + +pyMoul is a set of Python libraries around MOUL (Myst Online : Uru Live). At +the moment the main focus is on the Qt4 based graphical tool. + +Donate +====== + +If you like the tool and find it usful please donate some money. You can +use the link below to send me money over PayPal. You don't need a PayPal +account. A credit card or bank account is sufficient. + +https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=christian%40cheimes%2ede&item_name=Donate%20for%20Tiran%27s%20open%20source%20activities&page_style=PayPal&no_shipping=2&cn=Your%20note%20for%20me&tax=0¤cy_code=EUR&lc=DE&bn=PP%2dDonationsBF&charset=UTF%2d8 + +''' + LICENSE = ''' GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Modified: pymoul/trunk/src/moul/qt/mainwindow.py =================================================================== --- pymoul/trunk/src/moul/qt/mainwindow.py 2007-02-02 14:38:56 UTC (rev 119) +++ pymoul/trunk/src/moul/qt/mainwindow.py 2007-02-02 17:13:40 UTC (rev 120) @@ -36,16 +36,22 @@ from moul.qt.localization import LocalizationMixin from moul.osdependent import isMoulRunning from moul.config import lookupDir -from moul.file.wdysini import AudioIni -from moul.file.wdysini import GraphicsIni +from moul.file.directory import UruGameDataDirectory +from moul.file.directory import UruPersonalDataDirectory from moul.file.wdysini import videoModes from moul.log import getLogger from moul.log import signalLogDecorator from moul.server.ping import ServerList from moul.server.ping import isSocketError from moul.time.cavern import CavernTime +from moul.qt.threadlet import YieldingThreadlet +from moul.qt.simpleprogressbar import SimpleProgressbar from moul import metadata +# TBR +from moul.file.wdysini import AudioIni +from moul.file.wdysini import GraphicsIni + LOG = getLogger('moul.qt') class MainWindow(QtGui.QMainWindow, Ui_MainWindow, LocalizationMixin): @@ -63,6 +69,12 @@ # dirty flag: unsaved changes self._dirty = False self.setDirty(False) + + # set directory handlers + self.urugamedir = UruGameDataDirectory(lookupDir('install')) + self.urudatadir = UruPersonalDataDirectory(lookupDir('userdata')) + # TODO: checks + self.urudatadir.initializeFactories() # init handlers self._timezone_init() @@ -110,11 +122,11 @@ QtGui.QMessageBox.information(self, self.trUtf8("Not Implemented"), self.trUtf8("""Sorry, this feature is not implemented yet!""")) - + def closeEvent(self, event): """ Close event handler - + @qtslot closeEvent(event QCloseEvent): notify on close @param event: close event @type event: QCloseEvent instance @@ -125,7 +137,7 @@ self._systray_close() event.accept() - + def keyPressEvent(self, event): """ Key event handler @@ -136,11 +148,12 @@ Has to ignore unknown events """ - #if event.key() == Qt.Key_Escape: - # self.emit(SIGNAL("close()")) - # event.accept() + if event.key() == Qt.Key_Escape: + # FIXME: signal doesn't do anything + self.emit(SIGNAL("close()")) + event.accept() event.ignore() - + def setDirty(self, boolean): """ Sets the save state @@ -150,7 +163,7 @@ #self.main_buttonbox_save.setEnabled(boolean) self.main_buttonbox_save.setEnabled(True) self.main_buttonbox_reset.setEnabled(True) - + # ************************************************************************ # system tray def _systray_init(self): @@ -163,6 +176,49 @@ self.systemtray.setVisible(False) # ************************************************************************ + # tasks + + @pyqtSignature("") + @signalLogDecorator(LOG) + def on_pb_kiimage_repair_clicked(self): + """ + Clicked repair button + """ + kimover = self.urudatadir.kiimages + if not kimover.findFiles(): + # TODO: msg + return + + self.pb_kiimage_repair.setEnabled(False) + self._kiimage_progressbar = SimpleProgressbar(self) + self._kiimage_progressbar.setWindowTitle( + self.trUtf8("Repairing KI images")) + self._kiimage_threadlet = YieldingThreadlet(self) + + self._kiimage_progressbar.setProgressbar(0, len(kimover), 0) + self.connect(self._kiimage_threadlet, SIGNAL("yield(const QString&)"), + self._kiimage_progressbar.increase) + self.connect(self._kiimage_threadlet, SIGNAL("finished()"), + self.on_pb_kiimage_repair_done) + self._kiimage_progressbar.show() + self._kiimage_threadlet.detach(kimover) + + @signalLogDecorator(LOG) + def on_pb_kiimage_repair_done(self): + """ + Repair threadlet done + """ + self._kiimage_progressbar.close() + self.disconnect(self._kiimage_threadlet, SIGNAL("yield(result)"), + self._kiimage_progressbar.increase) + self.disconnect(self._kiimage_threadlet, SIGNAL("finished()"), + self.on_pb_kiimage_repair_done) + del self._kiimage_threadlet + del self._kiimage_progressbar + self.pb_kiimage_repair.setEnabled(True) + # TODO: msg + + # ************************************************************************ # graphics settings def _about_init(self): self.te_license.setPlainText(metadata.LICENSE) Modified: pymoul/trunk/src/moul/qt/simpleprogressbar.py =================================================================== --- pymoul/trunk/src/moul/qt/simpleprogressbar.py 2007-02-02 14:38:56 UTC (rev 119) +++ pymoul/trunk/src/moul/qt/simpleprogressbar.py 2007-02-02 17:13:40 UTC (rev 120) @@ -58,6 +58,26 @@ self.progressbar.setMaximum(maxval) self.progressbar.setValue(value) + def increase(self, *args): + """Increase value by one + + Additional arguments are ignored. You can use the method as a + destination for a signal w/o worrying about the signature. + + @qtslot increase(): increase value by one + """ + self.progressbar.setValue(self.progressbar.value()+1) + + def decrease(self, *args): + """Decrease value by one + + Additional arguments are ignored. You can use the method as a + destination for a signal w/o worrying about the signature. + + @qtslot decrease(): decrease value by one + """ + self.progressbar.setValue(self.progressbar.value()-1) + @pyqtSignature("int") def setValue(self, value): """Set value of progress bar Modified: pymoul/trunk/src/moul/qt/threadlet.py =================================================================== --- pymoul/trunk/src/moul/qt/threadlet.py 2007-02-02 14:38:56 UTC (rev 119) +++ pymoul/trunk/src/moul/qt/threadlet.py 2007-02-02 17:13:40 UTC (rev 120) @@ -55,7 +55,6 @@ @qtsignal started(): Signal is emitted when the thread starts executing. @qtsignal finished(): Signal is emitted when the thread has finished. @qtsignal terminated(): Signal is emitted when the thread is terminated. - @qtsignal done(result): Signal is emitted when the function has returned. @warning: The function and all applied arguments must be thread safe! """ @@ -79,16 +78,16 @@ self._args = None self._kwargs = None - def detach(self, func, *args, **kwargs): + def detach(self, obj, *args, **kwargs): """ Detach a function call - @param func: a callable + @param obj: a callable (or iterable for YieldingThreadlet) @param *args: additional arguments for the function @param **kwargs: additional keyword arguments for the function """ self.mutex.lock() - self._func = func + self._obj = obj self._args = args self._kwargs = kwargs self.mutex.unlock() @@ -97,14 +96,30 @@ def run(self): """ - Payload - runs the script and emits done(result) + Payload - runs the callable and emits done(result) The function and its args/kwargs are cleared after the function has run to avoid cyclic references. + + @qtsignal done(result): Signal is emitted when the function has returned. """ self.mutex.lock() - result = self._func(*self._args, **self._kwargs) + result = self._obj(*self._args, **self._kwargs) self.emit(SIGNAL("done(result)"), result) self.clear() self.mutex.unlock() +class YieldingThreadlet(Threadlet): + """ + Similar to Threadlet by iters over the object and yields each value + """ + def run(self): + """ + Paylad - iters over the object and yields each value + + @qtsignal yield(const QString&): yield + """ + self.mutex.lock() + for result in iter(self._obj): + self.emit(SIGNAL("yield(const QString&)"), result) + self.mutex.unlock() Modified: pymoul/trunk/src/moul/qt/ui/mainwindow.py =================================================================== --- pymoul/trunk/src/moul/qt/ui/mainwindow.py 2007-02-02 14:38:56 UTC (rev 119) +++ pymoul/trunk/src/moul/qt/ui/mainwindow.py 2007-02-02 17:13:40 UTC (rev 120) @@ -2,7 +2,7 @@ # Form implementation generated from reading ui file 'src/moul/qt/ui/mainwindow.ui' # -# Created: Tue Jan 30 21:05:11 2007 +# Created: Fri Feb 2 17:26:46 2007 # by: PyQt4 UI code generator 4.1.1 # # WARNING! All changes made in this file will be lost! @@ -13,6 +13,7 @@ class Ui_MainWindow(object): def setupUi(self, MainWindow): MainWindow.setObjectName("MainWindow") + MainWindow.resize(QtCore.QSize(QtCore.QRect(0,0,472,595).size()).expandedTo(MainWindow.minimumSizeHint())) MainWindow.setMinimumSize(QtCore.QSize(472,595)) MainWindow.setMaximumSize(QtCore.QSize(472,595)) MainWindow.setWindowIcon(QtGui.QIcon(":/resources/uru_icon_32x32.png")) @@ -75,7 +76,33 @@ self.tab_tasks = QtGui.QWidget() self.tab_tasks.setObjectName("tab_tasks") + self.groupBox_2 = QtGui.QGroupBox(self.tab_tasks) + self.groupBox_2.setGeometry(QtCore.QRect(10,120,451,61)) + self.groupBox_2.setObjectName("groupBox_2") + + self.layoutWidget = QtGui.QWidget(self.groupBox_2) + self.layoutWidget.setGeometry(QtCore.QRect(10,20,431,30)) + self.layoutWidget.setObjectName("layoutWidget") + + self.hboxlayout2 = QtGui.QHBoxLayout(self.layoutWidget) + self.hboxlayout2.setMargin(0) + self.hboxlayout2.setSpacing(6) + self.hboxlayout2.setObjectName("hboxlayout2") + + self.pb_kiimage_repair = QtGui.QPushButton(self.layoutWidget) + self.pb_kiimage_repair.setMinimumSize(QtCore.QSize(60,0)) + self.pb_kiimage_repair.setObjectName("pb_kiimage_repair") + self.hboxlayout2.addWidget(self.pb_kiimage_repair) + + self.pb_kiimage_repair1 = QtGui.QLabel(self.layoutWidget) + self.pb_kiimage_repair1.setObjectName("pb_kiimage_repair1") + self.hboxlayout2.addWidget(self.pb_kiimage_repair1) + + spacerItem2 = QtGui.QSpacerItem(40,20,QtGui.QSizePolicy.Expanding,QtGui.QSizePolicy.Minimum) + self.hboxlayout2.addItem(spacerItem2) + self.groupBox = QtGui.QGroupBox(self.tab_tasks) + self.groupBox.setEnabled(False) self.groupBox.setGeometry(QtCore.QRect(10,0,451,121)) self.groupBox.setObjectName("groupBox") @@ -85,16 +112,16 @@ self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.NoButton) self.buttonBox.setObjectName("buttonBox") - self.widget = QtGui.QWidget(self.groupBox) - self.widget.setGeometry(QtCore.QRect(11,21,431,86)) - self.widget.setObjectName("widget") + self.layoutWidget1 = QtGui.QWidget(self.groupBox) + self.layoutWidget1.setGeometry(QtCore.QRect(11,21,431,89)) + self.layoutWidget1.setObjectName("layoutWidget1") - self.gridlayout = QtGui.QGridLayout(self.widget) + self.gridlayout = QtGui.QGridLayout(self.layoutWidget1) self.gridlayout.setMargin(0) self.gridlayout.setSpacing(6) self.gridlayout.setObjectName("gridlayout") - self.lb_log_archive = QtGui.QLabel(self.widget) + self.lb_log_archive = QtGui.QLabel(self.layoutWidget1) self.lb_log_archive.setTextFormat(QtCore.Qt.PlainText) self.lb_log_archive.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignVCenter) self.lb_log_archive.setWordWrap(True) @@ -102,62 +129,41 @@ self.lb_log_archive.setObjectName("lb_log_archive") self.gridlayout.addWidget(self.lb_log_archive,0,1,1,1) - self.lb_log_remove = QtGui.QLabel(self.widget) + self.lb_log_remove = QtGui.QLabel(self.layoutWidget1) self.lb_log_remove.setObjectName("lb_log_remove") self.gridlayout.addWidget(self.lb_log_remove,1,1,1,1) - self.pb_log_remove = QtGui.QPushButton(self.widget) + self.pb_log_remove = QtGui.QPushButton(self.layoutWidget1) + self.pb_log_remove.setEnabled(False) self.pb_log_remove.setMinimumSize(QtCore.QSize(60,0)) self.pb_log_remove.setObjectName("pb_log_remove") self.gridlayout.addWidget(self.pb_log_remove,1,0,1,1) - self.pb_log_archive = QtGui.QPushButton(self.widget) + self.pb_log_archive = QtGui.QPushButton(self.layoutWidget1) + self.pb_log_archive.setEnabled(False) self.pb_log_archive.setMinimumSize(QtCore.QSize(60,0)) self.pb_log_archive.setObjectName("pb_log_archive") self.gridlayout.addWidget(self.pb_log_archive,0,0,1,1) - spacerItem2 = QtGui.QSpacerItem(40,20,QtGui.QSizePolicy.Expanding,QtGui.QSizePolicy.Minimum) - self.gridlayout.addItem(spacerItem2,0,2,1,1) + spacerItem3 = QtGui.QSpacerItem(40,20,QtGui.QSizePolicy.Expanding,QtGui.QSizePolicy.Minimum) + self.gridlayout.addItem(spacerItem3,0,2,1,1) self.vboxlayout = QtGui.QVBoxLayout() self.vboxlayout.setMargin(0) self.vboxlayout.setSpacing(6) self.vboxlayout.setObjectName("vboxlayout") - self.radio_ziplogs = QtGui.QRadioButton(self.widget) + self.radio_ziplogs = QtGui.QRadioButton(self.layoutWidget1) + self.radio_ziplogs.setEnabled(False) self.radio_ziplogs.setChecked(True) self.radio_ziplogs.setObjectName("radio_ziplogs") self.vboxlayout.addWidget(self.radio_ziplogs) - self.radio_deletelogs = QtGui.QRadioButton(self.widget) + self.radio_deletelogs = QtGui.QRadioButton(self.layoutWidget1) + self.radio_deletelogs.setEnabled(False) self.radio_deletelogs.setObjectName("radio_deletelogs") self.vboxlayout.addWidget(self.radio_deletelogs) self.gridlayout.addLayout(self.vboxlayout,0,3,1,1) - - self.groupBox_2 = QtGui.QGroupBox(self.tab_tasks) - self.groupBox_2.setGeometry(QtCore.QRect(10,120,451,61)) - self.groupBox_2.setObjectName("groupBox_2") - - self.widget1 = QtGui.QWidget(self.groupBox_2) - self.widget1.setGeometry(QtCore.QRect(10,20,431,30)) - self.widget1.setObjectName("widget1") - - self.hboxlayout2 = QtGui.QHBoxLayout(self.widget1) - self.hboxlayout2.setMargin(0) - self.hboxlayout2.setSpacing(6) - self.hboxlayout2.setObjectName("hboxlayout2") - - self.pb_kiimage_repair = QtGui.QPushButton(self.widget1) - self.pb_kiimage_repair.setMinimumSize(QtCore.QSize(60,0)) - self.pb_kiimage_repair.setObjectName("pb_kiimage_repair") - self.hboxlayout2.addWidget(self.pb_kiimage_repair) - - self.pb_kiimage_repair1 = QtGui.QLabel(self.widget1) - self.pb_kiimage_repair1.setObjectName("pb_kiimage_repair1") - self.hboxlayout2.addWidget(self.pb_kiimage_repair1) - - spacerItem3 = QtGui.QSpacerItem(40,20,QtGui.QSizePolicy.Expanding,QtGui.QSizePolicy.Minimum) - self.hboxlayout2.addItem(spacerItem3) self.tabwidget.addTab(self.tab_tasks,"") self.tab_settings = QtGui.QWidget() @@ -484,16 +490,16 @@ self.groupBox_aud_level.setGeometry(QtCore.QRect(10,0,451,171)) self.groupBox_aud_level.setObjectName("groupBox_aud_level") - self.layoutWidget = QtGui.QWidget(self.groupBox_aud_level) - self.layoutWidget.setGeometry(QtCore.QRect(20,20,191,112)) - self.layoutWidget.setObjectName("layoutWidget") + self.layoutWidget2 = QtGui.QWidget(self.groupBox_aud_level) + self.layoutWidget2.setGeometry(QtCore.QRect(20,20,191,112)) + self.layoutWidget2.setObjectName("layoutWidget2") - self.vboxlayout10 = QtGui.QVBoxLayout(self.layoutWidget) + self.vboxlayout10 = QtGui.QVBoxLayout(self.layoutWidget2) self.vboxlayout10.setMargin(0) self.vboxlayout10.setSpacing(6) self.vboxlayout10.setObjectName("vboxlayout10") - self.verticalLayout_57 = QtGui.QWidget(self.layoutWidget) + self.verticalLayout_57 = QtGui.QWidget(self.layoutWidget2) self.verticalLayout_57.setObjectName("verticalLayout_57") self.vboxlayout11 = QtGui.QVBoxLayout(self.verticalLayout_57) @@ -520,7 +526,7 @@ self.vboxlayout11.addWidget(self.sl_aud_fx) self.vboxlayout10.addWidget(self.verticalLayout_57) - self.verticalLayout_59 = QtGui.QWidget(self.layoutWidget) + self.verticalLayout_59 = QtGui.QWidget(self.layoutWidget2) self.verticalLayout_59.setObjectName("verticalLayout_59") self.vboxlayout12 = QtGui.QVBoxLayout(self.verticalLayout_59) @@ -547,16 +553,16 @@ self.vboxlayout12.addWidget(self.sl_aud_music) self.vboxlayout10.addWidget(self.verticalLayout_59) - self.layoutWidget1 = QtGui.QWidget(self.groupBox_aud_level) - self.layoutWidget1.setGeometry(QtCore.QRect(240,20,191,139)) - self.layoutWidget1.setObjectName("layoutWidget1") + self.layoutWidget3 = QtGui.QWidget(self.groupBox_aud_level) + self.layoutWidget3.setGeometry(QtCore.QRect(240,20,191,139)) + self.layoutWidget3.setObjectName("layoutWidget3") - self.vboxlayout13 = QtGui.QVBoxLayout(self.layoutWidget1) + self.vboxlayout13 = QtGui.QVBoxLayout(self.layoutWidget3) self.vboxlayout13.setMargin(0) self.vboxlayout13.setSpacing(6) self.vboxlayout13.setObjectName("vboxlayout13") - self.verticalLayout_58 = QtGui.QWidget(self.layoutWidget1) + self.verticalLayout_58 = QtGui.QWidget(self.layoutWidget3) self.verticalLayout_58.setObjectName("verticalLayout_58") self.vboxlayout14 = QtGui.QVBoxLayout(self.verticalLayout_58) @@ -583,7 +589,7 @@ self.vboxlayout14.addWidget(self.sl_aud_ambience) self.vboxlayout13.addWidget(self.verticalLayout_58) - self.verticalLayout_56 = QtGui.QWidget(self.layoutWidget1) + self.verticalLayout_56 = QtGui.QWidget(self.layoutWidget3) self.verticalLayout_56.setObjectName("verticalLayout_56") self.vboxlayout15 = QtGui.QVBoxLayout(self.verticalLayout_56) @@ -610,7 +616,7 @@ self.vboxlayout15.addWidget(self.sl_aud_npc) self.vboxlayout13.addWidget(self.verticalLayout_56) - self.cb_aud_mute = QtGui.QCheckBox(self.layoutWidget1) + self.cb_aud_mute = QtGui.QCheckBox(self.layoutWidget3) self.cb_aud_mute.setObjectName("cb_aud_mute") self.vboxlayout13.addWidget(self.cb_aud_mute) @@ -722,6 +728,7 @@ self.tab_pymoul.setObjectName("tab_pymoul") self.groupBox_4 = QtGui.QGroupBox(self.tab_pymoul) + self.groupBox_4.setEnabled(False) self.groupBox_4.setGeometry(QtCore.QRect(10,0,451,371)) self.groupBox_4.setObjectName("groupBox_4") self.tab_sub_settings.addTab(self.tab_pymoul,"") @@ -824,6 +831,7 @@ self.tab_sub_chatlogs.setObjectName("tab_sub_chatlogs") self.groupBox_5 = QtGui.QGroupBox(self.tab_sub_chatlogs) + self.groupBox_5.setEnabled(False) self.groupBox_5.setGeometry(QtCore.QRect(10,0,451,371)) self.groupBox_5.setObjectName("groupBox_5") @@ -914,6 +922,12 @@ self.tab_sub_about = QtGui.QWidget() self.tab_sub_about.setObjectName("tab_sub_about") + + self.label_6 = QtGui.QLabel(self.tab_sub_about) + self.label_6.setGeometry(QtCore.QRect(20,10,431,351)) + self.label_6.setTextFormat(QtCore.Qt.PlainText) + self.label_6.setAlignment(QtCore.Qt.AlignCenter) + self.label_6.setObjectName("label_6") self.tabwidget_about.addTab(self.tab_sub_about,"") self.tab_sub_license = QtGui.QWidget() @@ -947,6 +961,9 @@ def retranslateUi(self, MainWindow): MainWindow.setWindowTitle(QtGui.QApplication.translate("MainWindow", "MainWindow", None, QtGui.QApplication.UnicodeUTF8)) + self.groupBox_2.setTitle(QtGui.QApplication.translate("MainWindow", "KI Image repair", None, QtGui.QApplication.UnicodeUTF8)) + self.pb_kiimage_repair.setText(QtGui.QApplication.translate("MainWindow", "Repair", None, QtGui.QApplication.UnicodeUTF8)) + self.pb_kiimage_repair1.setText(QtGui.QApplication.translate("MainWindow", "Fix KI and avatar images", None, QtGui.QApplication.UnicodeUTF8)) self.groupBox.setTitle(QtGui.QApplication.translate("MainWindow", "Chat and debug logs", None, QtGui.QApplication.UnicodeUTF8)) self.lb_log_archive.setText(QtGui.QApplication.translate("MainWindow", "Archive chatlogs and zip log files", None, QtGui.QApplication.UnicodeUTF8)) self.lb_log_remove.setText(QtGui.QApplication.translate("MainWindow", "Remove zipped logs", None, QtGui.QApplication.UnicodeUTF8)) @@ -954,9 +971,6 @@ self.pb_log_archive.setText(QtGui.QApplication.translate("MainWindow", "Archive", None, QtGui.QApplication.UnicodeUTF8)) self.radio_ziplogs.setText(QtGui.QApplication.translate("MainWindow", "Zip debug logs", None, QtGui.QApplication.UnicodeUTF8)) self.radio_deletelogs.setText(QtGui.QApplication.translate("MainWindow", "Delete debug logs", None, QtGui.QApplication.UnicodeUTF8)) - self.groupBox_2.setTitle(QtGui.QApplication.translate("MainWindow", "KI Image repair", None, QtGui.QApplication.UnicodeUTF8)) - self.pb_kiimage_repair.setText(QtGui.QApplication.translate("MainWindow", "Repair", None, QtGui.QApplication.UnicodeUTF8)) - self.pb_kiimage_repair1.setText(QtGui.QApplication.translate("MainWindow", "Fix KI and avatar images", None, QtGui.QApplication.UnicodeUTF8)) self.tabwidget.setTabText(self.tabwidget.indexOf(self.tab_tasks), QtGui.QApplication.translate("MainWindow", "Tasks", None, QtGui.QApplication.UnicodeUTF8)) self.groupBox_screenres.setTitle(QtGui.QApplication.translate("MainWindow", "Screen Resolution", None, QtGui.QApplication.UnicodeUTF8)) self.lb_screenres.setText(QtGui.QApplication.translate("MainWindow", "800x600 (4:3)", None, QtGui.QApplication.UnicodeUTF8)) @@ -1024,6 +1038,11 @@ self.label_3.setText(QtGui.QApplication.translate("MainWindow", "Set", None, QtGui.QApplication.UnicodeUTF8)) self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_sub_journals), QtGui.QApplication.translate("MainWindow", "Journals", None, QtGui.QApplication.UnicodeUTF8)) self.tabwidget.setTabText(self.tabwidget.indexOf(self.tab_browse), QtGui.QApplication.translate("MainWindow", "Browse", None, QtGui.QApplication.UnicodeUTF8)) + self.label_6.setText(QtGui.QApplication.translate("MainWindow", "Tool for Myst Online : Uru Live\n" + "\n" + "(c) 2007 by Christian Heimes\n" + "\n" + "http://pymoul.sourceforge.net/", None, QtGui.QApplication.UnicodeUTF8)) self.tabwidget_about.setTabText(self.tabwidget_about.indexOf(self.tab_sub_about), QtGui.QApplication.translate("MainWindow", "About pyMoul", None, QtGui.QApplication.UnicodeUTF8)) self.tabwidget_about.setTabText(self.tabwidget_about.indexOf(self.tab_sub_license), QtGui.QApplication.translate("MainWindow", "License", 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-02-02 14:38:56 UTC (rev 119) +++ pymoul/trunk/src/moul/qt/ui/mainwindow.ui 2007-02-02 17:13:40 UTC (rev 120) @@ -1,6 +1,14 @@ <ui version="4.0" > <class>MainWindow</class> <widget class="QMainWindow" name="MainWindow" > + <property name="geometry" > + <rect> + <x>0</x> + <y>0</y> + <width>472</width> + <height>595</height> + </rect> + </property> <property name="minimumSize" > <size> <width>472</width> @@ -154,7 +162,74 @@ <attribute name="title" > <string>Tasks</string> </attribute> + <widget class="QGroupBox" name="groupBox_2" > + <property name="geometry" > + <rect> + <x>10</x> + <y>120</y> + <width>451</width> + <height>61</height> + </rect> + </property> + <property name="title" > + <string>KI Image repair</string> + </property> + <widget class="QWidget" name="layoutWidget" > + <property name="geometry" > + <rect> + <x>10</x> + <y>20</y> + <width>431</width> + <height>30</height> + </rect> + </property> + <layout class="QHBoxLayout" > + <property name="margin" > + <number>0</number> + </property> + <property name="spacing" > + <number>6</number> + </property> + <item> + <widget class="QPushButton" name="pb_kiimage_repair" > + <property name="minimumSize" > + <size> + <width>60</width> + <height>0</height> + </size> + </property> + <property name="text" > + <string>Repair</string> + </property> + </widget> + </item> + <item> + <widget class="QLabel" name="pb_kiimage_repair" > + <property name="text" > + <string>Fix KI and avatar images</string> + </property> + </widget> + </item> + <item> + <spacer> + <property name="orientation" > + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeHint" > + <size> + <width>40</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + </layout> + </widget> + </widget> <widget class="QGroupBox" name="groupBox" > + <property name="enabled" > + <bool>false</bool> + </property> <property name="geometry" > <rect> <x>10</x> @@ -182,13 +257,13 @@ <set>QDialogButtonBox::NoButton</set> </property> </widget> - <widget class="QWidget" name="" > + <widget class="QWidget" name="layoutWidget" > <property name="geometry" > <rect> <x>11</x> <y>21</y> <width>431</width> - <height>86</height> + <height>89</height> </rect> </property> <layout class="QGridLayout" > @@ -226,6 +301,9 @@ </item> <item row="1" column="0" > <widget class="QPushButton" name="pb_log_remove" > + <property name="enabled" > + <bool>false</bool> + </property> <property name="minimumSize" > <size> <width>60</width> @@ -239,6 +317,9 @@ </item> <item row="0" column="0" > <widget class="QPushButton" name="pb_log_archive" > + <property name="enabled" > + <bool>false</bool> + </property> <property name="minimumSize" > <size> <width>60</width> @@ -273,6 +354,9 @@ </property> <item> <widget class="QRadioButton" name="radio_ziplogs" > + <property name="enabled" > + <bool>false</bool> + </property> <property name="text" > <string>Zip debug logs</string> </property> @@ -283,6 +367,9 @@ </item> <item> <widget class="QRadioButton" name="radio_deletelogs" > + <property name="enabled" > + <bool>false</bool> + </property> <property name="text" > <string>Delete debug logs</string> </property> @@ -293,70 +380,6 @@ </layout> </widget> </widget> - <widget class="QGroupBox" name="groupBox_2" > - <property name="geometry" > - <rect> - <x>10</x> - <y>120</y> - <width>451</width> - <height>61</height> - </rect> - </property> - <property name="title" > - <string>KI Image repair</string> - </property> - <widget class="QWidget" name="" > - <property name="geometry" > - <rect> - <x>10</x> - <y>20</y> - <width>431</width> - <height>30</height> - </rect> - </property> - <layout class="QHBoxLayout" > - <property name="margin" > - <number>0</number> - </property> - <property name="spacing" > - <number>6</number> - </property> - <item> - <widget class="QPushButton" name="pb_kiimage_repair" > - <property name="minimumSize" > - <size> - <width>60</width> - <height>0</height> - </size> - </property> - <property name="text" > - <string>Repair</string> - </property> - </widget> - </item> - <item> - <widget class="QLabel" name="pb_kiimage_repair" > - <property name="text" > - <string>Fix KI and avatar images</string> - </property> - </widget> - </item> - <item> - <spacer> - <property name="orientation" > - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeHint" > - <size> - <width>40</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - </layout> - </widget> - </widget> </widget> <widget class="QWidget" name="tab_settings" > <attribute name="title" > @@ -1509,6 +1532,9 @@ <string>pyMoul</string> </attribute> <widget class="QGroupBox" name="groupBox_4" > + <property name="enabled" > + <bool>false</bool> + </property> <property name="geometry" > <rect> <x>10</x> @@ -1732,6 +1758,9 @@ <string>Chat logs</string> </attribute> <widget class="QGroupBox" name="groupBox_5" > + <property name="enabled" > + <bool>false</bool> + </property> <property name="geometry" > <rect> <x>10</x> @@ -1902,6 +1931,29 @@ <attribute name="title" > <string>About pyMoul</string> </attribute> + <widget class="QLabel" name="label_6" > + <property name="geometry" > + <rect> + <x>20</x> + <y>10</y> + <width>431</width> + <height>351</height> + </rect> + </property> + <property name="text" > + <string>Tool for Myst Online : Uru Live + +(c) 2007 by Christian Heimes + +http://pymoul.sourceforge.net/</string> + </property> + <property name="textFormat" > + <enum>Qt::PlainText</enum> + </property> + <property name="alignment" > + <set>Qt::AlignCenter</set> + </property> + </widget> </widget> <widget class="QWidget" name="tab_sub_license" > <attribute name="title" > This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ti...@us...> - 2007-02-02 14:38:56
|
Revision: 119 http://pymoul.svn.sourceforge.net/pymoul/?rev=119&view=rev Author: tiran Date: 2007-02-02 06:38:56 -0800 (Fri, 02 Feb 2007) Log Message: ----------- Added simple progress bar. Use it in the loc loader screen Modified Paths: -------------- pymoul/trunk/doc/TODO.txt pymoul/trunk/src/moul/qt/errorhandler.py pymoul/trunk/src/moul/qt/localization.py pymoul/trunk/src/moul/qt/mainwindow.py pymoul/trunk/src/moul/qt/threadlet.py Added Paths: ----------- pymoul/trunk/src/moul/qt/simpleprogressbar.py pymoul/trunk/src/moul/qt/ui/simpleprogressbar.py pymoul/trunk/src/moul/qt/ui/simpleprogressbar.ui Modified: pymoul/trunk/doc/TODO.txt =================================================================== --- pymoul/trunk/doc/TODO.txt 2007-02-02 12:35:40 UTC (rev 118) +++ pymoul/trunk/doc/TODO.txt 2007-02-02 14:38:56 UTC (rev 119) @@ -12,3 +12,7 @@ * complete chatlog viewer * more checks and exceptions! Never fail silentely * update readme.txt + * connect QThread.terminate() slots with its parents close/destroy signal + handler + * clean documents/journal/localization naming + Modified: pymoul/trunk/src/moul/qt/errorhandler.py =================================================================== --- pymoul/trunk/src/moul/qt/errorhandler.py 2007-02-02 12:35:40 UTC (rev 118) +++ pymoul/trunk/src/moul/qt/errorhandler.py 2007-02-02 14:38:56 UTC (rev 119) @@ -38,8 +38,6 @@ LOG = getLogger('moul.qt.error') -def trUtf8(s): - return s def qtexcepthook(typ, value, traceback): """ @@ -49,8 +47,10 @@ LOG.critical("UNHANDLED ERROR", exc_info=(typ, value, traceback)) return # XXX: remove try: - title = trUtf8("An unhandled error has occured") - msg = (trUtf8("Please report the error:\n\n") + + title= QtGui.QApplication.translate("excepthook", + "An unhandled error has occured", + None, QtGui.QApplication.UnicodeUTF8) + msg = ("Please report the error:\n\n" + '\n'.join([line.strip() for line in format_exception(typ, value, traceback)]) ) @@ -111,7 +111,7 @@ """ Info message box """ - mb = _mkMessageBox(context, icon='Info') + mb = _mkMessageBox(context, icon='Information') mb.setStandardButtons(QtGui.QMessageBox.Ok) mb.setWindowTitle(title) mb.setText(text) Modified: pymoul/trunk/src/moul/qt/localization.py =================================================================== --- pymoul/trunk/src/moul/qt/localization.py 2007-02-02 12:35:40 UTC (rev 118) +++ pymoul/trunk/src/moul/qt/localization.py 2007-02-02 14:38:56 UTC (rev 119) @@ -37,6 +37,7 @@ from moul.log import getLogger from moul.log import signalLogDecorator from moul.qt.threadlet import Threadlet +from moul.qt.simpleprogressbar import SimpleProgressbar LOG = getLogger('moul.loc') @@ -49,10 +50,43 @@ Mixin for documentation tab """ def _documents_init(self): - installDir = lookupDir('install') + """ + @qtsignal loadLocalization(): load loc data + """ + self._journals_loaded = False + self.connect(self, SIGNAL('loadLocalization()'), + self.on_localization_doload) + self.cb_doc_language.addItems(insertDummyQ([])) + self.cb_doc_language_eventFilter = LocalizationLoadEventFilter(self) + self.cb_doc_language.installEventFilter(self.cb_doc_language_eventFilter) + + @signalLogDecorator(LOG) + def on_localization_doload(self): + """ + @qtslot loadLocalization(): Load localization + @qtsignal finished(): self._journal_threadlet + """ + if self.cb_doc_language_eventFilter: + self.cb_doc_language.removeEventFilter( + self.cb_doc_language_eventFilter + ) + self.cb_doc_language_eventFilter = None + + if self._journals_loaded: + return + + # TODO: other message box + self._journal_progressbar = SimpleProgressbar(self) + self._journal_progressbar.setWindowTitle(self.trUtf8("Loading journals")) + self._journal_progressbar.setProgressbar(0, 1, 0) + self._journal_progressbar.show() + + installDir = lookupDir('install') self._gamedir = UruGameDataDirectory(installDir) if not self._gamedir.exists('loc'): + self.tab_sub_journals.setEnabled(False) return + self._journal_threadlet = Threadlet() self.connect(self._journal_threadlet, SIGNAL('finished()'), self.on_localization_loaded) @@ -60,8 +94,20 @@ @signalLogDecorator(LOG) def on_localization_loaded(self): - self.tab_sub_journals.setEnabled(True) + """ + @qtslot finished(): self._journal_threadlet + """ + # remove thread + self.disconnect(self._journal_threadlet, SIGNAL('finished()'), + self.on_localization_loaded) + del self._journal_threadlet + # close and remove info message box + self._journal_progressbar.setValue(1) + self._journal_progressbar.close() + del self._journal_progressbar + self._journals_loaded = True + self._documents_state = {} self.connect(self.cb_doc_language, SIGNAL("currentIndexChanged(int)"), @@ -72,9 +118,9 @@ 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.clear() self.cb_doc_language.addItems(insertDummyQ(languages)) self.cb_doc_language.setCurrentIndex(0) @@ -140,5 +186,17 @@ translation = tr[(lang, age, set, element)] qstr = QtCore.QString(translation) self.te_doc_view.setPlainText(qstr) - self.te_doc_view.setEnabled(True) - + self.te_doc_view.setEnabled(True) + +class LocalizationLoadEventFilter(QtCore.QObject): + """Event filter to load localization + """ + def eventFilter(self, target, event): + """ + Event filter + """ + if event.type() in (QtCore.QEvent.MouseButtonPress, + QtCore.QEvent.FocusIn): + self.parent().emit(SIGNAL('loadLocalization()')) + + return QtCore.QObject.eventFilter(self, target, event) Modified: pymoul/trunk/src/moul/qt/mainwindow.py =================================================================== --- pymoul/trunk/src/moul/qt/mainwindow.py 2007-02-02 12:35:40 UTC (rev 118) +++ pymoul/trunk/src/moul/qt/mainwindow.py 2007-02-02 14:38:56 UTC (rev 119) @@ -63,7 +63,6 @@ # dirty flag: unsaved changes self._dirty = False self.setDirty(False) - self.tab_sub_journals.setEnabled(False) # init handlers self._timezone_init() @@ -80,7 +79,7 @@ self.connect(self._moulrunning_thread, SIGNAL('moulIsRunning(bool)'), self.on_moulIsRunning) self._moulrunning_thread.startChecker(5.0) # check now and every 5 seconds - + @signalLogDecorator(LOG) def on_moulIsRunning(self, boolean): """ Added: pymoul/trunk/src/moul/qt/simpleprogressbar.py =================================================================== --- pymoul/trunk/src/moul/qt/simpleprogressbar.py (rev 0) +++ pymoul/trunk/src/moul/qt/simpleprogressbar.py 2007-02-02 14:38:56 UTC (rev 119) @@ -0,0 +1,69 @@ +# 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: mainwindow.py 116 2007-02-02 03:32:28Z tiran $" +__revision__ = "$Revision: 116 $" + +__all__ = ['SimpleProgressbar'] + +from PyQt4 import QtGui +from PyQt4.QtCore import pyqtSignature + +from moul.qt.ui.simpleprogressbar import Ui_SimpleProgressbar + +class SimpleProgressbar(QtGui.QDialog, Ui_SimpleProgressbar): + """A simple progress bar dialog + + >>> bar = SimpleProgressbar() + >>> bar.setWindowTitle(bar.trUtf8('a bar')) + >>> bar.setProgressbar(0, 100, 20) + >>> bar.setValue(50) + """ + + def __init__(self, parent=None): + QtGui.QDialog.__init__(self, parent) + self.setupUi(self) + + def setProgressbar(self, minval, maxval, value=None): + """Set progress bar min, max and initial value + + @param minval: minimum value + @type minval: int + @param maxval: maximum value + @type maxval: int + @param value: initial value (set to minval if value is None) + @type value: int, None + """ + if value is None: + value = minval + self.progressbar.setMinimum(minval) + self.progressbar.setMaximum(maxval) + self.progressbar.setValue(value) + + @pyqtSignature("int") + def setValue(self, value): + """Set value of progress bar + + @qtslot setValue(int): set value of progress bar + @param value: current value of the progress bar + @type value: int + """ + return self.progressbar.setValue(value) Modified: pymoul/trunk/src/moul/qt/threadlet.py =================================================================== --- pymoul/trunk/src/moul/qt/threadlet.py 2007-02-02 12:35:40 UTC (rev 118) +++ pymoul/trunk/src/moul/qt/threadlet.py 2007-02-02 14:38:56 UTC (rev 119) @@ -36,34 +36,53 @@ Use this class to run a CPU or I/O bound function in a seperate thread. - @signal started(): Signal is emitted when the thread starts executing. - @signal finished(): Signal is emitted when the thread has finished. - @signal terminated(): Signal is emitted when the thread is terminated. - @signal done(result): Signal is emitted when the function has returned. - The result argument contains the return value of the function. - + >>> def pow(x, y): return x**y >>> def printer(r): print r - >>> example =Threadlet() - >>> connect(example, SIGNAL('done(result)'), printer) - >>> example.detach(pow, 2, 6) - - started() - done(result) - finished() - - @warning: The function and all applied arguments must be reentrant or - thread safe! + >>> parent.example = Threadlet() + >>> parent.connect(parent.example, SIGNAL('done(result)'), printer) + >>> parent.example.detach(pow, 2, 6) + + Signals emitted: + - started() + - done(result) + - finished() + + You should disconnect all signals after the threadlet has finished + >>> parent.disconnect(parent.example, SIGNAL('done(result)')) + >>> del parent.example + + @qtsignal started(): Signal is emitted when the thread starts executing. + @qtsignal finished(): Signal is emitted when the thread has finished. + @qtsignal terminated(): Signal is emitted when the thread is terminated. + @qtsignal done(result): Signal is emitted when the function has returned. + + @warning: The function and all applied arguments must be thread safe! """ def __init__(self, parent=None): + """Constructor + + @param parent: Qt parent object + @type parent: QObject instance or None + """ QtCore.QThread.__init__(self, parent) self.mutex = QtCore.QMutex() + self.clear() + + def clear(self): + """ + Clear variables + + Mutex must be locked before clear() is called from a method! + """ self._func = None self._args = None self._kwargs = None def detach(self, func, *args, **kwargs): """ + Detach a function call + @param func: a callable @param *args: additional arguments for the function @param **kwargs: additional keyword arguments for the function @@ -77,7 +96,15 @@ self.start() def run(self): + """ + Payload - runs the script and emits done(result) + + The function and its args/kwargs are cleared after the function has + run to avoid cyclic references. + """ self.mutex.lock() result = self._func(*self._args, **self._kwargs) self.emit(SIGNAL("done(result)"), result) + self.clear() self.mutex.unlock() + Added: pymoul/trunk/src/moul/qt/ui/simpleprogressbar.py =================================================================== --- pymoul/trunk/src/moul/qt/ui/simpleprogressbar.py (rev 0) +++ pymoul/trunk/src/moul/qt/ui/simpleprogressbar.py 2007-02-02 14:38:56 UTC (rev 119) @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- + +# Form implementation generated from reading ui file 'src/moul/qt/ui/simpleprogressbar.ui' +# +# Created: Fri Feb 2 15:36:30 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_SimpleProgressbar(object): + def setupUi(self, SimpleProgressbar): + SimpleProgressbar.setObjectName("SimpleProgressbar") + SimpleProgressbar.resize(QtCore.QSize(QtCore.QRect(0,0,203,38).size()).expandedTo(SimpleProgressbar.minimumSizeHint())) + SimpleProgressbar.setMinimumSize(QtCore.QSize(203,38)) + SimpleProgressbar.setMaximumSize(QtCore.QSize(203,38)) + SimpleProgressbar.setWindowIcon(QtGui.QIcon(":/resources/uru_icon_32x32.png")) + + self.verticalLayout = QtGui.QWidget(SimpleProgressbar) + self.verticalLayout.setGeometry(QtCore.QRect(0,0,201,41)) + self.verticalLayout.setObjectName("verticalLayout") + + self.vboxlayout = QtGui.QVBoxLayout(self.verticalLayout) + self.vboxlayout.setMargin(0) + self.vboxlayout.setSpacing(6) + self.vboxlayout.setObjectName("vboxlayout") + + self.progressbar = QtGui.QProgressBar(self.verticalLayout) + self.progressbar.setMinimum(0) + self.progressbar.setMaximum(100) + self.progressbar.setProperty("value",QtCore.QVariant(0)) + self.progressbar.setTextVisible(False) + self.progressbar.setOrientation(QtCore.Qt.Horizontal) + self.progressbar.setObjectName("progressbar") + self.vboxlayout.addWidget(self.progressbar) + + self.retranslateUi(SimpleProgressbar) + QtCore.QMetaObject.connectSlotsByName(SimpleProgressbar) + + def retranslateUi(self, SimpleProgressbar): + SimpleProgressbar.setWindowTitle(QtGui.QApplication.translate("SimpleProgressbar", "Title", None, QtGui.QApplication.UnicodeUTF8)) + +from moul.qt.ui import moulqt_rc + +if __name__ == "__main__": + app = QtGui.QApplication(sys.argv) + SimpleProgressbar = QtGui.QDialog() + ui = Ui_SimpleProgressbar() + ui.setupUi(SimpleProgressbar) + SimpleProgressbar.show() + sys.exit(app.exec_()) Added: pymoul/trunk/src/moul/qt/ui/simpleprogressbar.ui =================================================================== --- pymoul/trunk/src/moul/qt/ui/simpleprogressbar.ui (rev 0) +++ pymoul/trunk/src/moul/qt/ui/simpleprogressbar.ui 2007-02-02 14:38:56 UTC (rev 119) @@ -0,0 +1,72 @@ +<ui version="4.0" > + <class>SimpleProgressbar</class> + <widget class="QDialog" name="SimpleProgressbar" > + <property name="geometry" > + <rect> + <x>0</x> + <y>0</y> + <width>203</width> + <height>38</height> + </rect> + </property> + <property name="minimumSize" > + <size> + <width>203</width> + <height>38</height> + </size> + </property> + <property name="maximumSize" > + <size> + <width>203</width> + <height>38</height> + </size> + </property> + <property name="windowTitle" > + <string>Title</string> + </property> + <property name="windowIcon" > + <iconset resource="moulqt.qrc" >:/resources/uru_icon_32x32.png</iconset> + </property> + <widget class="QWidget" name="verticalLayout" > + <property name="geometry" > + <rect> + <x>0</x> + <y>0</y> + <width>201</width> + <height>41</height> + </rect> + </property> + <layout class="QVBoxLayout" > + <property name="margin" > + <number>0</number> + </property> + <property name="spacing" > + <number>6</number> + </property> + <item> + <widget class="QProgressBar" name="progressbar" > + <property name="minimum" > + <number>0</number> + </property> + <property name="maximum" > + <number>100</number> + </property> + <property name="value" > + <number>0</number> + </property> + <property name="textVisible" > + <bool>false</bool> + </property> + <property name="orientation" > + <enum>Qt::Horizontal</enum> + </property> + </widget> + </item> + </layout> + </widget> + </widget> + <resources> + <include location="moulqt.qrc" /> + </resources> + <connections/> +</ui> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ti...@us...> - 2007-02-02 12:35:41
|
Revision: 118 http://pymoul.svn.sourceforge.net/pymoul/?rev=118&view=rev Author: tiran Date: 2007-02-02 04:35:40 -0800 (Fri, 02 Feb 2007) Log Message: ----------- Update translations Modified Paths: -------------- pymoul/trunk/src/moul/qt/i18n/pymoul_de.ts pymoul/trunk/src/moul/qt/i18n/pymoul_es.ts pymoul/trunk/src/moul/qt/i18n/pymoul_fr.ts pymoul/trunk/src/moul/qt/i18n/pymoul_it.ts pymoul/trunk/src/moul/qt/i18n/pymoul_nl.ts Modified: pymoul/trunk/src/moul/qt/i18n/pymoul_de.ts =================================================================== --- pymoul/trunk/src/moul/qt/i18n/pymoul_de.ts 2007-02-02 03:49:46 UTC (rev 117) +++ pymoul/trunk/src/moul/qt/i18n/pymoul_de.ts 2007-02-02 12:35:40 UTC (rev 118) @@ -1,23 +1,24 @@ <!DOCTYPE TS><TS> <context> - <name>MainWindow</name> + <name>@default</name> <message> - <source>Tool for Myst Online</source> + <source>An unhandled error has occured</source> <translation type="unfinished"></translation> </message> <message> - <source>Configure</source> + <source>Please report the error: + +</source> <translation type="unfinished"></translation> </message> +</context> +<context> + <name>MainWindow</name> <message> <source>Windowed</source> <translation type="unfinished"></translation> </message> <message> - <source>Vertical Sync</source> - <translation type="unfinished"></translation> - </message> - <message> <source>Display Shadows</source> <translation type="unfinished"></translation> </message> @@ -150,99 +151,186 @@ <translation type="unfinished"></translation> </message> <message> - <source>(Mountain Standard Time)</source> + <source>D'ni time</source> <translation type="unfinished"></translation> </message> <message> - <source>(Pacific Standard Time)</source> + <source>Time</source> <translation type="unfinished"></translation> </message> <message> - <source>D'ni time</source> + <source>Ping servers</source> <translation type="unfinished"></translation> </message> <message> - <source>Time</source> + <source>Ping</source> <translation type="unfinished"></translation> </message> <message> - <source>Ping servers</source> + <source>Servers</source> <translation type="unfinished"></translation> </message> <message> - <source>Ping</source> + <source>Age</source> <translation type="unfinished"></translation> </message> <message> - <source><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; font-size:8pt;"></p></body></html></source> + <source>Element</source> <translation type="unfinished"></translation> </message> <message> - <source>Servers</source> + <source>Language</source> <translation type="unfinished"></translation> </message> <message> - <source>Browse in game documents</source> + <source>Set</source> <translation type="unfinished"></translation> </message> <message> - <source>Age</source> + <source>About</source> <translation type="unfinished"></translation> </message> <message> - <source>Element</source> + <source>MOUL is running</source> <translation type="unfinished"></translation> </message> <message> - <source>Language</source> + <source>MOUL</source> <translation type="unfinished"></translation> </message> <message> - <source>Set</source> + <source>MOUL is not running</source> <translation type="unfinished"></translation> </message> <message> - <source>Documents</source> + <source>Not Implemented</source> <translation type="unfinished"></translation> </message> <message> - <source>pyMoul tools</source> + <source>Sorry, this feature is not implemented yet!</source> <translation type="unfinished"></translation> </message> <message> - <source>About</source> + <source>Error opening graphics.ini</source> <translation type="unfinished"></translation> </message> <message> - <source>MOUL is running</source> + <source>Error opening audio.ini</source> <translation type="unfinished"></translation> </message> <message> - <source>MOUL</source> + <source>MainWindow</source> <translation type="unfinished"></translation> </message> <message> - <source>MOUL is not running</source> + <source>Chat and debug logs</source> <translation type="unfinished"></translation> </message> <message> - <source>Not Implemented</source> + <source>Archive chatlogs and zip log files</source> <translation type="unfinished"></translation> </message> <message> - <source>Sorry, this feature is not implemented yet!</source> + <source>Remove zipped logs</source> <translation type="unfinished"></translation> </message> <message> - <source>Error opening graphics.ini</source> + <source>Remove</source> <translation type="unfinished"></translation> </message> <message> - <source>Error opening audio.ini</source> + <source>Archive</source> <translation type="unfinished"></translation> </message> + <message> + <source>Zip debug logs</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Delete debug logs</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>KI Image repair</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Repair</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Fix KI and avatar images</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Tasks</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Other</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>VSync</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Tool Settings</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>pyMoul</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Settings</source> + <translation type="unfinished"></translation> + </message> + <message> + <source><html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; 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; font-family:'MS Shell Dlg 2'; font-size:8pt;"></p></body></html></source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Read chatlogs</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Chat logs</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Browse journals and notes</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Journals</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Browse</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>About pyMoul</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>License</source> + <translation type="unfinished"></translation> + </message> </context> +<context> + <name>app</name> + <message> + <source>pyMoul QT already running</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>An instance of pyMoul QT is already running!</source> + <translation type="unfinished"></translation> + </message> +</context> </TS> Modified: pymoul/trunk/src/moul/qt/i18n/pymoul_es.ts =================================================================== --- pymoul/trunk/src/moul/qt/i18n/pymoul_es.ts 2007-02-02 03:49:46 UTC (rev 117) +++ pymoul/trunk/src/moul/qt/i18n/pymoul_es.ts 2007-02-02 12:35:40 UTC (rev 118) @@ -1,23 +1,24 @@ <!DOCTYPE TS><TS> <context> - <name>MainWindow</name> + <name>@default</name> <message> - <source>Tool for Myst Online</source> + <source>An unhandled error has occured</source> <translation type="unfinished"></translation> </message> <message> - <source>Configure</source> + <source>Please report the error: + +</source> <translation type="unfinished"></translation> </message> +</context> +<context> + <name>MainWindow</name> <message> <source>Windowed</source> <translation type="unfinished"></translation> </message> <message> - <source>Vertical Sync</source> - <translation type="unfinished"></translation> - </message> - <message> <source>Display Shadows</source> <translation type="unfinished"></translation> </message> @@ -150,99 +151,186 @@ <translation type="unfinished"></translation> </message> <message> - <source>(Mountain Standard Time)</source> + <source>D'ni time</source> <translation type="unfinished"></translation> </message> <message> - <source>(Pacific Standard Time)</source> + <source>Time</source> <translation type="unfinished"></translation> </message> <message> - <source>D'ni time</source> + <source>Ping servers</source> <translation type="unfinished"></translation> </message> <message> - <source>Time</source> + <source>Ping</source> <translation type="unfinished"></translation> </message> <message> - <source>Ping servers</source> + <source>Servers</source> <translation type="unfinished"></translation> </message> <message> - <source>Ping</source> + <source>Age</source> <translation type="unfinished"></translation> </message> <message> - <source><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; font-size:8pt;"></p></body></html></source> + <source>Element</source> <translation type="unfinished"></translation> </message> <message> - <source>Servers</source> + <source>Language</source> <translation type="unfinished"></translation> </message> <message> - <source>Browse in game documents</source> + <source>Set</source> <translation type="unfinished"></translation> </message> <message> - <source>Age</source> + <source>About</source> <translation type="unfinished"></translation> </message> <message> - <source>Element</source> + <source>MOUL is running</source> <translation type="unfinished"></translation> </message> <message> - <source>Language</source> + <source>MOUL</source> <translation type="unfinished"></translation> </message> <message> - <source>Set</source> + <source>MOUL is not running</source> <translation type="unfinished"></translation> </message> <message> - <source>Documents</source> + <source>Not Implemented</source> <translation type="unfinished"></translation> </message> <message> - <source>pyMoul tools</source> + <source>Sorry, this feature is not implemented yet!</source> <translation type="unfinished"></translation> </message> <message> - <source>About</source> + <source>Error opening graphics.ini</source> <translation type="unfinished"></translation> </message> <message> - <source>MOUL is running</source> + <source>Error opening audio.ini</source> <translation type="unfinished"></translation> </message> <message> - <source>MOUL</source> + <source>MainWindow</source> <translation type="unfinished"></translation> </message> <message> - <source>MOUL is not running</source> + <source>Chat and debug logs</source> <translation type="unfinished"></translation> </message> <message> - <source>Not Implemented</source> + <source>Archive chatlogs and zip log files</source> <translation type="unfinished"></translation> </message> <message> - <source>Sorry, this feature is not implemented yet!</source> + <source>Remove zipped logs</source> <translation type="unfinished"></translation> </message> <message> - <source>Error opening graphics.ini</source> + <source>Remove</source> <translation type="unfinished"></translation> </message> <message> - <source>Error opening audio.ini</source> + <source>Archive</source> <translation type="unfinished"></translation> </message> + <message> + <source>Zip debug logs</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Delete debug logs</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>KI Image repair</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Repair</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Fix KI and avatar images</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Tasks</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Other</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>VSync</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Tool Settings</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>pyMoul</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Settings</source> + <translation type="unfinished"></translation> + </message> + <message> + <source><html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; 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; font-family:'MS Shell Dlg 2'; font-size:8pt;"></p></body></html></source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Read chatlogs</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Chat logs</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Browse journals and notes</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Journals</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Browse</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>About pyMoul</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>License</source> + <translation type="unfinished"></translation> + </message> </context> +<context> + <name>app</name> + <message> + <source>pyMoul QT already running</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>An instance of pyMoul QT is already running!</source> + <translation type="unfinished"></translation> + </message> +</context> </TS> Modified: pymoul/trunk/src/moul/qt/i18n/pymoul_fr.ts =================================================================== --- pymoul/trunk/src/moul/qt/i18n/pymoul_fr.ts 2007-02-02 03:49:46 UTC (rev 117) +++ pymoul/trunk/src/moul/qt/i18n/pymoul_fr.ts 2007-02-02 12:35:40 UTC (rev 118) @@ -1,23 +1,24 @@ <!DOCTYPE TS><TS> <context> - <name>MainWindow</name> + <name>@default</name> <message> - <source>Tool for Myst Online</source> + <source>An unhandled error has occured</source> <translation type="unfinished"></translation> </message> <message> - <source>Configure</source> + <source>Please report the error: + +</source> <translation type="unfinished"></translation> </message> +</context> +<context> + <name>MainWindow</name> <message> <source>Windowed</source> <translation type="unfinished"></translation> </message> <message> - <source>Vertical Sync</source> - <translation type="unfinished"></translation> - </message> - <message> <source>Display Shadows</source> <translation type="unfinished"></translation> </message> @@ -150,99 +151,186 @@ <translation type="unfinished"></translation> </message> <message> - <source>(Mountain Standard Time)</source> + <source>D'ni time</source> <translation type="unfinished"></translation> </message> <message> - <source>(Pacific Standard Time)</source> + <source>Time</source> <translation type="unfinished"></translation> </message> <message> - <source>D'ni time</source> + <source>Ping servers</source> <translation type="unfinished"></translation> </message> <message> - <source>Time</source> + <source>Ping</source> <translation type="unfinished"></translation> </message> <message> - <source>Ping servers</source> + <source>Servers</source> <translation type="unfinished"></translation> </message> <message> - <source>Ping</source> + <source>Age</source> <translation type="unfinished"></translation> </message> <message> - <source><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; font-size:8pt;"></p></body></html></source> + <source>Element</source> <translation type="unfinished"></translation> </message> <message> - <source>Servers</source> + <source>Language</source> <translation type="unfinished"></translation> </message> <message> - <source>Browse in game documents</source> + <source>Set</source> <translation type="unfinished"></translation> </message> <message> - <source>Age</source> + <source>About</source> <translation type="unfinished"></translation> </message> <message> - <source>Element</source> + <source>MOUL is running</source> <translation type="unfinished"></translation> </message> <message> - <source>Language</source> + <source>MOUL</source> <translation type="unfinished"></translation> </message> <message> - <source>Set</source> + <source>MOUL is not running</source> <translation type="unfinished"></translation> </message> <message> - <source>Documents</source> + <source>Not Implemented</source> <translation type="unfinished"></translation> </message> <message> - <source>pyMoul tools</source> + <source>Sorry, this feature is not implemented yet!</source> <translation type="unfinished"></translation> </message> <message> - <source>About</source> + <source>Error opening graphics.ini</source> <translation type="unfinished"></translation> </message> <message> - <source>MOUL is running</source> + <source>Error opening audio.ini</source> <translation type="unfinished"></translation> </message> <message> - <source>MOUL</source> + <source>MainWindow</source> <translation type="unfinished"></translation> </message> <message> - <source>MOUL is not running</source> + <source>Chat and debug logs</source> <translation type="unfinished"></translation> </message> <message> - <source>Not Implemented</source> + <source>Archive chatlogs and zip log files</source> <translation type="unfinished"></translation> </message> <message> - <source>Sorry, this feature is not implemented yet!</source> + <source>Remove zipped logs</source> <translation type="unfinished"></translation> </message> <message> - <source>Error opening graphics.ini</source> + <source>Remove</source> <translation type="unfinished"></translation> </message> <message> - <source>Error opening audio.ini</source> + <source>Archive</source> <translation type="unfinished"></translation> </message> + <message> + <source>Zip debug logs</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Delete debug logs</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>KI Image repair</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Repair</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Fix KI and avatar images</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Tasks</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Other</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>VSync</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Tool Settings</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>pyMoul</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Settings</source> + <translation type="unfinished"></translation> + </message> + <message> + <source><html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; 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; font-family:'MS Shell Dlg 2'; font-size:8pt;"></p></body></html></source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Read chatlogs</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Chat logs</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Browse journals and notes</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Journals</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Browse</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>About pyMoul</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>License</source> + <translation type="unfinished"></translation> + </message> </context> +<context> + <name>app</name> + <message> + <source>pyMoul QT already running</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>An instance of pyMoul QT is already running!</source> + <translation type="unfinished"></translation> + </message> +</context> </TS> Modified: pymoul/trunk/src/moul/qt/i18n/pymoul_it.ts =================================================================== --- pymoul/trunk/src/moul/qt/i18n/pymoul_it.ts 2007-02-02 03:49:46 UTC (rev 117) +++ pymoul/trunk/src/moul/qt/i18n/pymoul_it.ts 2007-02-02 12:35:40 UTC (rev 118) @@ -1,23 +1,24 @@ <!DOCTYPE TS><TS> <context> - <name>MainWindow</name> + <name>@default</name> <message> - <source>Tool for Myst Online</source> + <source>An unhandled error has occured</source> <translation type="unfinished"></translation> </message> <message> - <source>Configure</source> + <source>Please report the error: + +</source> <translation type="unfinished"></translation> </message> +</context> +<context> + <name>MainWindow</name> <message> <source>Windowed</source> <translation type="unfinished"></translation> </message> <message> - <source>Vertical Sync</source> - <translation type="unfinished"></translation> - </message> - <message> <source>Display Shadows</source> <translation type="unfinished"></translation> </message> @@ -150,99 +151,186 @@ <translation type="unfinished"></translation> </message> <message> - <source>(Mountain Standard Time)</source> + <source>D'ni time</source> <translation type="unfinished"></translation> </message> <message> - <source>(Pacific Standard Time)</source> + <source>Time</source> <translation type="unfinished"></translation> </message> <message> - <source>D'ni time</source> + <source>Ping servers</source> <translation type="unfinished"></translation> </message> <message> - <source>Time</source> + <source>Ping</source> <translation type="unfinished"></translation> </message> <message> - <source>Ping servers</source> + <source>Servers</source> <translation type="unfinished"></translation> </message> <message> - <source>Ping</source> + <source>Age</source> <translation type="unfinished"></translation> </message> <message> - <source><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; font-size:8pt;"></p></body></html></source> + <source>Element</source> <translation type="unfinished"></translation> </message> <message> - <source>Servers</source> + <source>Language</source> <translation type="unfinished"></translation> </message> <message> - <source>Browse in game documents</source> + <source>Set</source> <translation type="unfinished"></translation> </message> <message> - <source>Age</source> + <source>About</source> <translation type="unfinished"></translation> </message> <message> - <source>Element</source> + <source>MOUL is running</source> <translation type="unfinished"></translation> </message> <message> - <source>Language</source> + <source>MOUL</source> <translation type="unfinished"></translation> </message> <message> - <source>Set</source> + <source>MOUL is not running</source> <translation type="unfinished"></translation> </message> <message> - <source>Documents</source> + <source>Not Implemented</source> <translation type="unfinished"></translation> </message> <message> - <source>pyMoul tools</source> + <source>Sorry, this feature is not implemented yet!</source> <translation type="unfinished"></translation> </message> <message> - <source>About</source> + <source>Error opening graphics.ini</source> <translation type="unfinished"></translation> </message> <message> - <source>MOUL is running</source> + <source>Error opening audio.ini</source> <translation type="unfinished"></translation> </message> <message> - <source>MOUL</source> + <source>MainWindow</source> <translation type="unfinished"></translation> </message> <message> - <source>MOUL is not running</source> + <source>Chat and debug logs</source> <translation type="unfinished"></translation> </message> <message> - <source>Not Implemented</source> + <source>Archive chatlogs and zip log files</source> <translation type="unfinished"></translation> </message> <message> - <source>Sorry, this feature is not implemented yet!</source> + <source>Remove zipped logs</source> <translation type="unfinished"></translation> </message> <message> - <source>Error opening graphics.ini</source> + <source>Remove</source> <translation type="unfinished"></translation> </message> <message> - <source>Error opening audio.ini</source> + <source>Archive</source> <translation type="unfinished"></translation> </message> + <message> + <source>Zip debug logs</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Delete debug logs</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>KI Image repair</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Repair</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Fix KI and avatar images</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Tasks</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Other</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>VSync</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Tool Settings</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>pyMoul</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Settings</source> + <translation type="unfinished"></translation> + </message> + <message> + <source><html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; 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; font-family:'MS Shell Dlg 2'; font-size:8pt;"></p></body></html></source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Read chatlogs</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Chat logs</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Browse journals and notes</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Journals</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Browse</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>About pyMoul</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>License</source> + <translation type="unfinished"></translation> + </message> </context> +<context> + <name>app</name> + <message> + <source>pyMoul QT already running</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>An instance of pyMoul QT is already running!</source> + <translation type="unfinished"></translation> + </message> +</context> </TS> Modified: pymoul/trunk/src/moul/qt/i18n/pymoul_nl.ts =================================================================== --- pymoul/trunk/src/moul/qt/i18n/pymoul_nl.ts 2007-02-02 03:49:46 UTC (rev 117) +++ pymoul/trunk/src/moul/qt/i18n/pymoul_nl.ts 2007-02-02 12:35:40 UTC (rev 118) @@ -1,23 +1,24 @@ <!DOCTYPE TS><TS> <context> - <name>MainWindow</name> + <name>@default</name> <message> - <source>Tool for Myst Online</source> + <source>An unhandled error has occured</source> <translation type="unfinished"></translation> </message> <message> - <source>Configure</source> + <source>Please report the error: + +</source> <translation type="unfinished"></translation> </message> +</context> +<context> + <name>MainWindow</name> <message> <source>Windowed</source> <translation type="unfinished"></translation> </message> <message> - <source>Vertical Sync</source> - <translation type="unfinished"></translation> - </message> - <message> <source>Display Shadows</source> <translation type="unfinished"></translation> </message> @@ -150,99 +151,186 @@ <translation type="unfinished"></translation> </message> <message> - <source>(Mountain Standard Time)</source> + <source>D'ni time</source> <translation type="unfinished"></translation> </message> <message> - <source>(Pacific Standard Time)</source> + <source>Time</source> <translation type="unfinished"></translation> </message> <message> - <source>D'ni time</source> + <source>Ping servers</source> <translation type="unfinished"></translation> </message> <message> - <source>Time</source> + <source>Ping</source> <translation type="unfinished"></translation> </message> <message> - <source>Ping servers</source> + <source>Servers</source> <translation type="unfinished"></translation> </message> <message> - <source>Ping</source> + <source>Age</source> <translation type="unfinished"></translation> </message> <message> - <source><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; font-size:8pt;"></p></body></html></source> + <source>Element</source> <translation type="unfinished"></translation> </message> <message> - <source>Servers</source> + <source>Language</source> <translation type="unfinished"></translation> </message> <message> - <source>Browse in game documents</source> + <source>Set</source> <translation type="unfinished"></translation> </message> <message> - <source>Age</source> + <source>About</source> <translation type="unfinished"></translation> </message> <message> - <source>Element</source> + <source>MOUL is running</source> <translation type="unfinished"></translation> </message> <message> - <source>Language</source> + <source>MOUL</source> <translation type="unfinished"></translation> </message> <message> - <source>Set</source> + <source>MOUL is not running</source> <translation type="unfinished"></translation> </message> <message> - <source>Documents</source> + <source>Not Implemented</source> <translation type="unfinished"></translation> </message> <message> - <source>pyMoul tools</source> + <source>Sorry, this feature is not implemented yet!</source> <translation type="unfinished"></translation> </message> <message> - <source>About</source> + <source>Error opening graphics.ini</source> <translation type="unfinished"></translation> </message> <message> - <source>MOUL is running</source> + <source>Error opening audio.ini</source> <translation type="unfinished"></translation> </message> <message> - <source>MOUL</source> + <source>MainWindow</source> <translation type="unfinished"></translation> </message> <message> - <source>MOUL is not running</source> + <source>Chat and debug logs</source> <translation type="unfinished"></translation> </message> <message> - <source>Not Implemented</source> + <source>Archive chatlogs and zip log files</source> <translation type="unfinished"></translation> </message> <message> - <source>Sorry, this feature is not implemented yet!</source> + <source>Remove zipped logs</source> <translation type="unfinished"></translation> </message> <message> - <source>Error opening graphics.ini</source> + <source>Remove</source> <translation type="unfinished"></translation> </message> <message> - <source>Error opening audio.ini</source> + <source>Archive</source> <translation type="unfinished"></translation> </message> + <message> + <source>Zip debug logs</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Delete debug logs</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>KI Image repair</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Repair</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Fix KI and avatar images</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Tasks</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Other</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>VSync</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Tool Settings</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>pyMoul</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Settings</source> + <translation type="unfinished"></translation> + </message> + <message> + <source><html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; 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; font-family:'MS Shell Dlg 2'; font-size:8pt;"></p></body></html></source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Read chatlogs</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Chat logs</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Browse journals and notes</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Journals</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Browse</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>About pyMoul</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>License</source> + <translation type="unfinished"></translation> + </message> </context> +<context> + <name>app</name> + <message> + <source>pyMoul QT already running</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>An instance of pyMoul QT is already running!</source> + <translation type="unfinished"></translation> + </message> +</context> </TS> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ti...@us...> - 2007-02-02 03:49:54
|
Revision: 117 http://pymoul.svn.sourceforge.net/pymoul/?rev=117&view=rev Author: tiran Date: 2007-02-01 19:49:46 -0800 (Thu, 01 Feb 2007) Log Message: ----------- Run localization loading in a Threadlet Modified Paths: -------------- pymoul/trunk/src/moul/qt/localization.py pymoul/trunk/src/moul/qt/threadlet.py Modified: pymoul/trunk/src/moul/qt/localization.py =================================================================== --- pymoul/trunk/src/moul/qt/localization.py 2007-02-02 03:32:28 UTC (rev 116) +++ pymoul/trunk/src/moul/qt/localization.py 2007-02-02 03:49:46 UTC (rev 117) @@ -36,6 +36,7 @@ from moul.file.directory import UruGameDataDirectory from moul.log import getLogger from moul.log import signalLogDecorator +from moul.qt.threadlet import Threadlet LOG = getLogger('moul.loc') @@ -52,8 +53,13 @@ self._gamedir = UruGameDataDirectory(installDir) if not self._gamedir.exists('loc'): return + self._journal_threadlet = Threadlet() + self.connect(self._journal_threadlet, SIGNAL('finished()'), + self.on_localization_loaded) + self._journal_threadlet.detach(self._gamedir.factory, 'loc') - self._gamedir.factory('loc') + @signalLogDecorator(LOG) + def on_localization_loaded(self): self.tab_sub_journals.setEnabled(True) self._documents_state = {} Modified: pymoul/trunk/src/moul/qt/threadlet.py =================================================================== --- pymoul/trunk/src/moul/qt/threadlet.py 2007-02-02 03:32:28 UTC (rev 116) +++ pymoul/trunk/src/moul/qt/threadlet.py 2007-02-02 03:49:46 UTC (rev 117) @@ -26,11 +26,15 @@ import sys from PyQt4 import QtCore +from moul.log import getLogger +from PyQt4.QtCore import SIGNAL -LOG = getLogger('moul.tasklket') +LOG = getLogger('moul.tasklet') class Threadlet(QtCore.QThread): """Threadlet - execute a function in a seperate thread + + Use this class to run a CPU or I/O bound function in a seperate thread. @signal started(): Signal is emitted when the thread starts executing. @signal finished(): Signal is emitted when the thread has finished. @@ -40,9 +44,9 @@ >>> def pow(x, y): return x**y >>> def printer(r): print r - >>> example =Threadlet(pow, parent=None, 2, 6) + >>> example =Threadlet() >>> connect(example, SIGNAL('done(result)'), printer) - >>> example.start() + >>> example.detach(pow, 2, 6) started() done(result) @@ -51,18 +55,29 @@ @warning: The function and all applied arguments must be reentrant or thread safe! """ - def __init__(self, func, parent=None, *args, **kwargs): + def __init__(self, parent=None): + QtCore.QThread.__init__(self, parent) + self.mutex = QtCore.QMutex() + self._func = None + self._args = None + self._kwargs = None + + def detach(self, func, *args, **kwargs): """ @param func: a callable - @param parent: Qt parent @param *args: additional arguments for the function @param **kwargs: additional keyword arguments for the function """ - QtCore.QThread.__init__(self, parent) + self.mutex.lock() self._func = func self._args = args self._kwargs = kwargs + self.mutex.unlock() + if not self.isRunning(): + self.start() def run(self): + self.mutex.lock() result = self._func(*self._args, **self._kwargs) self.emit(SIGNAL("done(result)"), result) + self.mutex.unlock() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ti...@us...> - 2007-02-02 03:32:29
|
Revision: 116 http://pymoul.svn.sourceforge.net/pymoul/?rev=116&view=rev Author: tiran Date: 2007-02-01 19:32:28 -0800 (Thu, 01 Feb 2007) Log Message: ----------- Added error handling and threadlet Modified Paths: -------------- pymoul/trunk/src/moul/file/directory.py pymoul/trunk/src/moul/osdependent/linux/__init__.py pymoul/trunk/src/moul/qt/localization.py pymoul/trunk/src/moul/qt/mainwindow.py pymoul/trunk/src/moul/qt/moulqt.py Added Paths: ----------- pymoul/trunk/src/moul/qt/errorhandler.py pymoul/trunk/src/moul/qt/threadlet.py Modified: pymoul/trunk/src/moul/file/directory.py =================================================================== --- pymoul/trunk/src/moul/file/directory.py 2007-02-02 00:49:08 UTC (rev 115) +++ pymoul/trunk/src/moul/file/directory.py 2007-02-02 03:32:28 UTC (rev 116) @@ -145,7 +145,7 @@ 'soundwav' : 'sfx' + os.sep + 'streamingCache', 'video' : 'avi', } - _factory = { + _factories = { 'loc' : (parseLocDirectory, ('loc',)), } Modified: pymoul/trunk/src/moul/osdependent/linux/__init__.py =================================================================== --- pymoul/trunk/src/moul/osdependent/linux/__init__.py 2007-02-02 00:49:08 UTC (rev 115) +++ pymoul/trunk/src/moul/osdependent/linux/__init__.py 2007-02-02 03:32:28 UTC (rev 116) @@ -93,7 +93,7 @@ finally: if fd: fd.close() - except IoError: + except IOError: continue details = {} for line in status: Added: pymoul/trunk/src/moul/qt/errorhandler.py =================================================================== --- pymoul/trunk/src/moul/qt/errorhandler.py (rev 0) +++ pymoul/trunk/src/moul/qt/errorhandler.py 2007-02-02 03:32:28 UTC (rev 116) @@ -0,0 +1,118 @@ +#!/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 +# + +"""Error handling for moul qt + +The module installs a custom exception hook that shows unhandled traceback in +the ui. It also contains several functions to create message boxes. +""" +__author__ = "Christian Heimes" +__version__ = "$Id" +__revision__ = "$Revision$" + +import sys +import os +from traceback import format_exception + +from PyQt4 import QtGui +from PyQt4 import QtCore +from PyQt4.QtCore import Qt + +from moul.log import getLogger + +LOG = getLogger('moul.qt.error') + +def trUtf8(s): + return s + +def qtexcepthook(typ, value, traceback): + """ + Custom exception hood to announce error inside the UI + """ + # TODO: translation aware + LOG.critical("UNHANDLED ERROR", exc_info=(typ, value, traceback)) + return # XXX: remove + try: + title = trUtf8("An unhandled error has occured") + msg = (trUtf8("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(): + """ + Install Qt exception hook + """ + LOG.info("Qt exception hook installed") + sys.excepthook = qtexcepthook + +def removeQtExceptHook(): + """ + Remove Qt exception hook + """ + LOG.info("Qt exception hook removed") + sys.excepthook = sys.__excepthook__ + +def _mkMessageBox(context, icon='Information'): + """ + Create a message box + """ + assert icon in ('Question', 'Information', 'Warning', 'Critical') + if context: + mb = QtGui.QMessageBox(context) + else: + mb = QtGui.QMessageBox() + mb.setWindowIcon(QtGui.QIcon(":/resources/uru_icon_32x32.png")) + mb.setIcon(getattr(QtGui.QMessageBox, icon)) + mb.setStandardButtons(QtGui.QMessageBox.Close) + return mb + + +def criticalMB(context, title, text): + """ + Critical message box + """ + mb = _mkMessageBox(context, icon='Critical') + mb.setWindowTitle(title) + mb.setText(text) + return mb + +def warningMB(context, title, text): + """ + warning message box + """ + mb = _mkMessageBox(context, icon='Warning') + mb.setWindowTitle(title) + mb.setText(text) + return mb + +def infoMB(context, title, text): + """ + Info message box + """ + mb = _mkMessageBox(context, icon='Info') + mb.setStandardButtons(QtGui.QMessageBox.Ok) + mb.setWindowTitle(title) + mb.setText(text) + return mb Modified: pymoul/trunk/src/moul/qt/localization.py =================================================================== --- pymoul/trunk/src/moul/qt/localization.py 2007-02-02 00:49:08 UTC (rev 115) +++ pymoul/trunk/src/moul/qt/localization.py 2007-02-02 03:32:28 UTC (rev 116) @@ -33,7 +33,7 @@ from moul.config import lookupDir from moul.file.localization import translationRegistry as tr -from moul.file.localization import parseLocDirectory +from moul.file.directory import UruGameDataDirectory from moul.log import getLogger from moul.log import signalLogDecorator @@ -48,17 +48,16 @@ Mixin for documentation tab """ def _documents_init(self): - return - locDir = lookupDir('loc') - if not os.path.isdir(locDir): + installDir = lookupDir('install') + self._gamedir = UruGameDataDirectory(installDir) + if not self._gamedir.exists('loc'): return - self.tab_documents.setEnabled(True) - - parseLocDirectory(locDir) - + self._gamedir.factory('loc') + self.tab_sub_journals.setEnabled(True) + 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)"), Modified: pymoul/trunk/src/moul/qt/mainwindow.py =================================================================== --- pymoul/trunk/src/moul/qt/mainwindow.py 2007-02-02 00:49:08 UTC (rev 115) +++ pymoul/trunk/src/moul/qt/mainwindow.py 2007-02-02 03:32:28 UTC (rev 116) @@ -48,18 +48,6 @@ LOG = getLogger('moul.qt') -def criticalMessageBox(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 - class MainWindow(QtGui.QMainWindow, Ui_MainWindow, LocalizationMixin): def __init__(self): QtGui.QMainWindow.__init__(self) @@ -75,7 +63,8 @@ # dirty flag: unsaved changes self._dirty = False self.setDirty(False) - + self.tab_sub_journals.setEnabled(False) + # init handlers self._timezone_init() self._graphics_init() @@ -84,8 +73,7 @@ self._systray_init() self._about_init() self._documents_init() - self.tab_sub_journals.setEnabled(False) - + # run checker self._moulrunning = None self._moulrunning_thread = MoulRunningThread() @@ -498,9 +486,9 @@ """ self._ping_thread = thread = PingServerThread() - self.connect(thread, SIGNAL("started"), + self.connect(thread, SIGNAL("started()"), self.on_pingthread_started) - self.connect(thread, SIGNAL("done()"), + self.connect(thread, SIGNAL("finished()"), self.on_pingthread_done) self.connect(thread, SIGNAL("server(const QString&)"), self.on_pingthread_server) @@ -563,7 +551,6 @@ def run(self): # TODO: thread safety! - self.emit(SIGNAL("started")) # emit a list of names first for server in self.servers: self.emit(SIGNAL("server(const QString&)"), server.name) @@ -583,8 +570,6 @@ name, ping[0], ping[1]) continue self.emit(SIGNAL("ping(const QString&, float)"), name, ping) - - self.emit(SIGNAL("done()")) class MoulRunningThread(QtCore.QThread): def __init__(self, parent=None): Modified: pymoul/trunk/src/moul/qt/moulqt.py =================================================================== --- pymoul/trunk/src/moul/qt/moulqt.py 2007-02-02 00:49:08 UTC (rev 115) +++ pymoul/trunk/src/moul/qt/moulqt.py 2007-02-02 03:32:28 UTC (rev 116) @@ -28,7 +28,9 @@ from PyQt4 import QtGui from moul.qt.mainwindow import MainWindow -from moul.qt.mainwindow import criticalMessageBox +from moul.qt.errorhandler import criticalMB +from moul.qt.errorhandler import setupQtExceptHook +from moul.qt.errorhandler import removeQtExceptHook from moul.osdependent.singleapp import SimpleSingleApp from moul.config import getPyMoulDataDir from moul.osdependent import isMoulRunning @@ -55,28 +57,24 @@ try: singleapp.acquire() except OSError: - mb = criticalMessageBox(app, - "pyMoul QT already running", - """An instance of pyMoul QT is already running!""") + mb = criticalMB(app, + app.trUtf8("pyMoul QT already running"), + app.trUtf8("""An instance of pyMoul QT is already running!""") + ) mb.exec_() sys.exit(1) - + createLogfile() - -# if isMoulRunning(): -# mb = criticalMessageBox(app, -# "URU is running", -# """URU is running! Please close Uru or Uru Launcher first.""") -# mb.exec_() -# sys.exit(2) + setupQtExceptHook() LOG.info("Invoking PyMoul QT MainWindow") mainWindow = MainWindow() mainWindow.show() err = app.exec_() LOG.info("Exiting PyMoul QT UI with status %i" % err) + removeQtExceptHook() return err - + if __name__ == '__main__': err = main(sys.argv) sys.exit(err) Added: pymoul/trunk/src/moul/qt/threadlet.py =================================================================== --- pymoul/trunk/src/moul/qt/threadlet.py (rev 0) +++ pymoul/trunk/src/moul/qt/threadlet.py 2007-02-02 03:32:28 UTC (rev 116) @@ -0,0 +1,68 @@ +#!/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 +# + +"""Threadlet - execute a function in a seperate thread +""" +__author__ = "Christian Heimes" +__version__ = "$Id: moulqt.py 110 2007-01-31 15:40:51Z tiran $" +__revision__ = "$Revision: 110 $" + +import sys + +from PyQt4 import QtCore + +LOG = getLogger('moul.tasklket') + +class Threadlet(QtCore.QThread): + """Threadlet - execute a function in a seperate thread + + @signal started(): Signal is emitted when the thread starts executing. + @signal finished(): Signal is emitted when the thread has finished. + @signal terminated(): Signal is emitted when the thread is terminated. + @signal done(result): Signal is emitted when the function has returned. + The result argument contains the return value of the function. + + >>> def pow(x, y): return x**y + >>> def printer(r): print r + >>> example =Threadlet(pow, parent=None, 2, 6) + >>> connect(example, SIGNAL('done(result)'), printer) + >>> example.start() + + started() + done(result) + finished() + + @warning: The function and all applied arguments must be reentrant or + thread safe! + """ + def __init__(self, func, parent=None, *args, **kwargs): + """ + @param func: a callable + @param parent: Qt parent + @param *args: additional arguments for the function + @param **kwargs: additional keyword arguments for the function + """ + QtCore.QThread.__init__(self, parent) + self._func = func + self._args = args + self._kwargs = kwargs + + def run(self): + result = self._func(*self._args, **self._kwargs) + self.emit(SIGNAL("done(result)"), result) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ti...@us...> - 2007-02-02 00:49:50
|
Revision: 115 http://pymoul.svn.sourceforge.net/pymoul/?rev=115&view=rev Author: tiran Date: 2007-02-01 16:49:08 -0800 (Thu, 01 Feb 2007) Log Message: ----------- Lot's of fixed. The moul.file.* don't break with an OSError/IOError when the files do not exist Modified Paths: -------------- pymoul/trunk/src/moul/config/__init__.py pymoul/trunk/src/moul/file/chatlog.py pymoul/trunk/src/moul/file/directory.py pymoul/trunk/src/moul/file/kiimage.py pymoul/trunk/src/moul/file/plasmalog.py pymoul/trunk/src/moul/file/tests/test_directory.py pymoul/trunk/src/moul/file/tests/utils.py pymoul/trunk/src/moul/file/wdysini.py pymoul/trunk/src/moul/qt/localization.py Modified: pymoul/trunk/src/moul/config/__init__.py =================================================================== --- pymoul/trunk/src/moul/config/__init__.py 2007-02-01 13:47:36 UTC (rev 114) +++ pymoul/trunk/src/moul/config/__init__.py 2007-02-02 00:49:08 UTC (rev 115) @@ -111,7 +111,8 @@ listConfig = _configuration.listConfig # hard coded for my system -setOption('moul', 'installdir', 'D:\\games\\MystOnline') +#setOption('moul', 'installdir', 'D:\\games\\MystOnline') +setOption('moul', 'installdir', '/home/heimes/dev/pymoul/MystOnline') ## directories class Directories(object): @@ -136,6 +137,7 @@ map = {'install' : self.getMoulInstallDir, 'userdata' : self.getMoulUserDataDir, 'pymouldir' : self.getPyMoulDataDir, + 'ini' : self.getPyMoulDataDir, } return map[name]() Modified: pymoul/trunk/src/moul/file/chatlog.py =================================================================== --- pymoul/trunk/src/moul/file/chatlog.py 2007-02-01 13:47:36 UTC (rev 114) +++ pymoul/trunk/src/moul/file/chatlog.py 2007-02-02 00:49:08 UTC (rev 115) @@ -94,7 +94,7 @@ self._dest = destdir self._logs = [] if not os.path.isdir(srcdir): - LOG.critical("%s is not a directory" % srcdir) + LOG.warning("%s is not a directory" % srcdir) if not os.path.isdir(destdir): LOG.info("Creating chatlog directory %s" % destdir) os.mkdir(destdir) @@ -185,7 +185,7 @@ self._logfiles = [] # list of ChatlogViews if not os.path.isdir(logdir): - LOG.critical("%s is not a directory" % logdir) + LOG.warning("%s is not a directory" % logdir) self._findChatlogs() def _findChatlogs(self): @@ -220,7 +220,7 @@ self._date = None if not os.path.isfile(fname): - LOG.critical("%s is not a file" % fname) + LOG.warning("%s is not a file" % fname) @property def name(self): Modified: pymoul/trunk/src/moul/file/directory.py =================================================================== --- pymoul/trunk/src/moul/file/directory.py 2007-02-01 13:47:36 UTC (rev 114) +++ pymoul/trunk/src/moul/file/directory.py 2007-02-02 00:49:08 UTC (rev 115) @@ -78,8 +78,11 @@ @param basepath: absolute path to folder @type basepath: str """ - self._basepath = basepath + for key in self._factories: + if key in self.__class__.__dict__: + raise AttributeError("Name %s is reserved and can't be used " + "as a factory name" % name) def exists(self, name=None): """Check if directory with name exists. @@ -99,7 +102,7 @@ @rtype: str """ if name and name != '.': - path = self._dirmapping(name) + path = self._dirmapping[name] else: path = '' return os.path.join(self._basepath, path) @@ -111,14 +114,24 @@ @type name: str @return: Factory instance """ + try: + return getattr(self, name) + except AttributeError: + pass args = [] factory, argnames = self._factories[name] - if not self.exists(argnames[0]): - return None for name in argnames: args.append(self.get(name)) return factory(*args) + def initializeFactories(self): + """Create instance attributes with factory instances + """ + for key in self._factories: + fac = self.factory(key) + if fac is not None: + setattr(self, key, fac) + class UruGameDataDirectory(AbstractUruDirectory): """Uru game directory handler @@ -144,7 +157,7 @@ data. """ _dirmapping = { - 'log' : 'Log', + 'logs' : 'Logs', 'kiimages' : 'KIimages', 'avatars' : 'Avatars', 'ini' : 'init', @@ -154,8 +167,8 @@ } _factories = { - 'logchat' : (ChatlogMover, ('log', 'chatlogs')), - 'logzip' : (PlasmalogZipper, ('log', 'zipped')), + 'logchat' : (ChatlogMover, ('logs', 'chatlogs')), + 'logzip' : (PlasmalogZipper, ('logs', 'zipped')), 'kiimages' : (KIImageFixer, ('kiimages', 'fixed')), 'avatars' : (KIImageFixer, ('avatars', 'fixed')), 'graphicsini' : (GraphicsIni, ('ini',)), @@ -165,6 +178,11 @@ 'fixed' : (DirectoryCount, ('fixed',)), } + def __init__(self, basepath): + AbstractUruDirectory.__init__(self, basepath) + if self.exists(): + self.initializeFactories() + def create(self, name): """Create a directory @@ -175,6 +193,7 @@ raise ValueError("Cannot create() basedir") path = self.get(name) os.makedirs(path) + return path def createTree(self): """Create the directory tree @@ -188,6 +207,6 @@ created.append(self._basepath) for key in self._dirmapping: if not self.exists(key): - self.create(key) + path = self.create(key) created.append(path) return created Modified: pymoul/trunk/src/moul/file/kiimage.py =================================================================== --- pymoul/trunk/src/moul/file/kiimage.py 2007-02-01 13:47:36 UTC (rev 114) +++ pymoul/trunk/src/moul/file/kiimage.py 2007-02-02 00:49:08 UTC (rev 115) @@ -224,8 +224,7 @@ self._fixed = [] # fixed files if not os.path.isdir(srcdir): - LOG.critical("%s is not a directory" % srcdir) - return False + LOG.warning("%s is not a directory" % srcdir) if not os.path.isdir(destdir): LOG.info("Creating chatlog directory %s" % destdir) os.mkdir(destdir) Modified: pymoul/trunk/src/moul/file/plasmalog.py =================================================================== --- pymoul/trunk/src/moul/file/plasmalog.py 2007-02-01 13:47:36 UTC (rev 114) +++ pymoul/trunk/src/moul/file/plasmalog.py 2007-02-02 00:49:08 UTC (rev 115) @@ -47,10 +47,10 @@ self._not_removed = [] # files with full path if not os.path.isdir(srcdir): - LOG.critical("%s is not a directory" % srcdir) + LOG.warning("%s is not a directory" % srcdir) if not self.isPlasmaLogDir(): self._ispldir = False - LOG.critical("%s is not a plasma log directory" % srcdir) + LOG.warning("%s is not a plasma log directory" % srcdir) else: self._ispldir = True if not os.path.isdir(destdir): Modified: pymoul/trunk/src/moul/file/tests/test_directory.py =================================================================== --- pymoul/trunk/src/moul/file/tests/test_directory.py 2007-02-01 13:47:36 UTC (rev 114) +++ pymoul/trunk/src/moul/file/tests/test_directory.py 2007-02-02 00:49:08 UTC (rev 115) @@ -21,6 +21,7 @@ __version__ = "$Id$" __revision__ = "$Revision$" +import os import unittest from doctest import DocTestSuite @@ -34,27 +35,67 @@ from moul.file.tests.utils import base class AbstractTest(unittest.TestCase): + klass = None + + def setUp(self): + self._tmpdir = mkTempdir() + fakeUruGameDir(self._tmpdir) + self.urudir = self.klass(self._tmpdir) + def tearDown(self): rmTempdir(self._tmpdir) def test_exists(self): - self.failUnless(self.urudir.exists) + self.failUnless(self.urudir.exists()) + for d in self.urudir._dirmapping: + self.urudir.exists(d) + def test_dumbfactorycreate(self): + for name in self.urudir._factories: + f = self.urudir.factory(name) + self.failUnless(f, str((type(f), repr(f), name))) + class UruPersonalDirTest(AbstractTest): - def setUp(self): + klass = UruPersonalDataDirectory + + def test_nodir(self): + # setup a new, empty testing direcotry + rmTempdir(self._tmpdir) self._tmpdir = mkTempdir() - fakeUruPersonalDataDir(self._tmpdir) - self.urudir = UruPersonalDataDirectory(self._tmpdir) + tmpdir = os.path.join(self._tmpdir, 'UruLive') -class UruGameDirTest(AbstractTest): - def setUp(self): + self.urudir = self.klass(tmpdir) + self.failIf(self.urudir.exists()) + self.failIf(self.urudir.factory('audioini').exists()) + self.failIf(self.urudir.factory('graphicsini').exists()) + + self.urudir.createTree() + self.failUnless(self.urudir.exists()) + self.urudir.initializeFactories() + self.failIf(self.urudir.audioini.exists()) + self.failIf(self.urudir.graphicsini.exists()) + + def test_create(self): + # setup a new, empty testing direcotry + rmTempdir(self._tmpdir) self._tmpdir = mkTempdir() - fakeUruGameDir(self._tmpdir) - self.urudir = UruGameDataDirectory(self._tmpdir) - def test_foo(self): - pass + self.urudir = self.klass(self._tmpdir) + #self.urudir.createTree() + self.failUnless(self.urudir.exists()) + self.urudir.initializeFactories() + self.failIf(self.urudir.audioini.exists()) + self.urudir.audioini.create() + self.failUnless(self.urudir.audioini.exists()) + + self.failIf(self.urudir.graphicsini.exists()) + self.urudir.graphicsini.create() + self.failUnless(self.urudir.graphicsini.exists()) + +class UruGameDirTest(AbstractTest): + klass = UruGameDataDirectory + def test_suite(): return unittest.TestSuite(( unittest.makeSuite(UruPersonalDirTest), Modified: pymoul/trunk/src/moul/file/tests/utils.py =================================================================== --- pymoul/trunk/src/moul/file/tests/utils.py 2007-02-01 13:47:36 UTC (rev 114) +++ pymoul/trunk/src/moul/file/tests/utils.py 2007-02-02 00:49:08 UTC (rev 115) @@ -74,7 +74,7 @@ def fakeUruGameDir(path): """Create a fake Uru Live game directory """ - for dname in ('dat', 'sfx', 'avi'): + for dname in ('dat', 'sfx', 'avi', 'sfx' + os.sep + 'streamingCache'): os.mkdir(os.path.join(path, dname)) for fname in ('UruLauncher.exe', 'UruExplorer.exe'): # XXX: win32 fd = open(os.path.join(path, fname), 'wb') Modified: pymoul/trunk/src/moul/file/wdysini.py =================================================================== --- pymoul/trunk/src/moul/file/wdysini.py 2007-02-01 13:47:36 UTC (rev 114) +++ pymoul/trunk/src/moul/file/wdysini.py 2007-02-02 00:49:08 UTC (rev 115) @@ -312,13 +312,18 @@ def __init__(self, path): if not os.path.isdir(path): - raise OSError("Directory not found %s" % path) + LOG.warning("Directory not found %s" % path) self._fpath = os.path.join(path, self._filename) self._filedata = {} self._newdata = {} self._order = [] self._opened = False + def exists(self): + """Check if file exists + """ + return os.path.isfile(self._fpath) + def clear(self): """Clear all informations """ @@ -360,6 +365,10 @@ """ if self._opened: raise ValueError("File already open") + dirname = os.path.dirname(self._fpath) + if not os.path.isdir(dirname): + LOG.info("Creating directory %s" % dirname) + os.mkdir(dirname) # Create a dummy file fd = open(self._fpath, 'w') fd.write("Created by pyMoul") Modified: pymoul/trunk/src/moul/qt/localization.py =================================================================== --- pymoul/trunk/src/moul/qt/localization.py 2007-02-01 13:47:36 UTC (rev 114) +++ pymoul/trunk/src/moul/qt/localization.py 2007-02-02 00:49:08 UTC (rev 115) @@ -48,7 +48,8 @@ Mixin for documentation tab """ def _documents_init(self): - locDir = lookupDir('loc') + return + locDir = lookupDir('loc') if not os.path.isdir(locDir): return This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ti...@us...> - 2007-02-01 13:47:37
|
Revision: 114 http://pymoul.svn.sourceforge.net/pymoul/?rev=114&view=rev Author: tiran Date: 2007-02-01 05:47:36 -0800 (Thu, 01 Feb 2007) Log Message: ----------- Moved some functions to tests.utils Added directory tests Doc strings Modified Paths: -------------- pymoul/trunk/src/moul/file/directory.py pymoul/trunk/src/moul/file/tests/test_directory.py pymoul/trunk/src/moul/file/tests/test_plasmalog.py Added Paths: ----------- pymoul/trunk/src/moul/file/tests/utils.py Modified: pymoul/trunk/src/moul/file/directory.py =================================================================== --- pymoul/trunk/src/moul/file/directory.py 2007-02-01 03:07:31 UTC (rev 113) +++ pymoul/trunk/src/moul/file/directory.py 2007-02-01 13:47:36 UTC (rev 114) @@ -36,25 +36,36 @@ class DirectoryCount(object): """Counts how many files are inside a directory + """ + def __init__(self, path): + """Constructor - def __init__(self, path): + @param path: absolute path to folder + @type path: str + """ self._basepath = path - self._count = 0 - if not os.path.isdir(path): - self._count = None - return - # TODO: fnmatch - for name in os.listdir(path): - if os.path.isfile(os.path.join(path, name)): - self._count+=1 @property def count(self): - return self._count + """Count number of files in basepath + returns int or None if path doesn't exist + """ + count = 0 + if not os.path.isdir(self._basepath): + return + # TODO: fnmatch + return len([name for name in os.listdir(path) + if os.path.isfile(os.path.join(path, name))]) + class AbstractUruDirectory(object): """Abstract class for an Uru directory + + @cvar _dirmapping: A mapping of name S{->} subpath + @type _dirmapping: dict + @cvar _factories: A list of factories name S{->} (callable, name tuples) C{_dirmapping} + @type _factories: dict """ # name -> subpath _dirmapping = {} @@ -62,17 +73,30 @@ _factories = {} def __init__(self, basepath): + """Constructor + + @param basepath: absolute path to folder + @type basepath: str + """ + self._basepath = basepath def exists(self, name=None): """Check if directory with name exists. + + @param name: Name of the subdirectory or None for basedir + @type name: str or None + @rtype: bool """ - os.path.isdir(self.get(name)) + return os.path.isdir(self.get(name)) def get(self, name=None): """Get complete path for name - - None or '.' means basedir. + + @param name: Name of the subdirectory or None for basedir + @type name: str or None + @return: absolute path + @rtype: str """ if name and name != '.': path = self._dirmapping(name) @@ -82,6 +106,10 @@ def factory(self, name): """Factory - creates instances to handle subdirectories and files + + @param name: Factory name + @type name: str + @return: Factory instance """ args = [] factory, argnames = self._factories[name] @@ -126,12 +154,12 @@ } _factories = { - 'log-chat' : (ChatlogMover, ('log', 'chatlogs')), - 'log-zip' : (PlasmalogZipper, ('log', 'zipped')), + 'logchat' : (ChatlogMover, ('log', 'chatlogs')), + 'logzip' : (PlasmalogZipper, ('log', 'zipped')), 'kiimages' : (KIImageFixer, ('kiimages', 'fixed')), 'avatars' : (KIImageFixer, ('avatars', 'fixed')), - 'graphics.ini' : (GraphicsIni, ('ini',)), - 'audio.ini' : (AudioIni, ('ini',)), + 'graphicsini' : (GraphicsIni, ('ini',)), + 'audioini' : (AudioIni, ('ini',)), 'chatlogs' : (ChatlogDirectoryView, ('chatlogs',)), 'zipped' : (DirectoryCount, ('zipped',)), 'fixed' : (DirectoryCount, ('fixed',)), @@ -139,6 +167,9 @@ def create(self, name): """Create a directory + + @param name: Name of the subdirectory + @type name: str """ if not name or name == '.': raise ValueError("Cannot create() basedir") @@ -147,6 +178,9 @@ def createTree(self): """Create the directory tree + + @return: List of created directories as absolute path + @rtype: list of str """ created = [] if not self.exists(''): Modified: pymoul/trunk/src/moul/file/tests/test_directory.py =================================================================== --- pymoul/trunk/src/moul/file/tests/test_directory.py 2007-02-01 03:07:31 UTC (rev 113) +++ pymoul/trunk/src/moul/file/tests/test_directory.py 2007-02-01 13:47:36 UTC (rev 114) @@ -24,10 +24,41 @@ import unittest from doctest import DocTestSuite -import moul.file.directory +from moul.file.directory import UruGameDataDirectory +from moul.file.directory import UruPersonalDataDirectory +from moul.file.tests.utils import fakeUruPersonalDataDir +from moul.file.tests.utils import fakeUruGameDir +from moul.file.tests.utils import mkTempdir +from moul.file.tests.utils import rmTempdir +from moul.file.tests.utils import base + +class AbstractTest(unittest.TestCase): + def tearDown(self): + rmTempdir(self._tmpdir) + + def test_exists(self): + self.failUnless(self.urudir.exists) + +class UruPersonalDirTest(AbstractTest): + def setUp(self): + self._tmpdir = mkTempdir() + fakeUruPersonalDataDir(self._tmpdir) + self.urudir = UruPersonalDataDirectory(self._tmpdir) + +class UruGameDirTest(AbstractTest): + def setUp(self): + self._tmpdir = mkTempdir() + fakeUruGameDir(self._tmpdir) + self.urudir = UruGameDataDirectory(self._tmpdir) + + def test_foo(self): + pass + def test_suite(): return unittest.TestSuite(( + unittest.makeSuite(UruPersonalDirTest), + unittest.makeSuite(UruGameDirTest), DocTestSuite('moul.file.directory') )) Modified: pymoul/trunk/src/moul/file/tests/test_plasmalog.py =================================================================== --- pymoul/trunk/src/moul/file/tests/test_plasmalog.py 2007-02-01 03:07:31 UTC (rev 113) +++ pymoul/trunk/src/moul/file/tests/test_plasmalog.py 2007-02-01 13:47:36 UTC (rev 114) @@ -35,55 +35,15 @@ from moul.file.kiimage import KIImageFixer from moul.file.kiimage import KIImage -FILE_LIST = ['audio.0.elf', 'audiocaps.0.elf', 'audioTimes.0.elf', - 'Avatar.0.elf', 'impacts.0.elf', 'LocalizationDataMgr.0.elf', - 'Marker.0.elf', 'NetScreener.0.elf', 'patcher.0.elf', 'pipeline.0.elf', - 'plasmalog.txt', 'Python.0.elf', 'Simulation.0.elf', 'voice.0.elf', - 'Chat.0.log'] +from moul.file.tests.utils import fakeUruPersonalDataDir +from moul.file.tests.utils import fakeUruGameDir +from moul.file.tests.utils import mkTempdir +from moul.file.tests.utils import rmTempdir +from moul.file.tests.utils import base -CHATLOG = """(01/02 03:04:05) Chat.log started... -(01/02 03:04:06) Testuser: foo -(01/02 03:04:07) ...Chat.log stopped. -""" - -base = os.path.dirname(__file__) - -def _fakeLogdir(path): - """Create a fake logdir - """ - if not os.path.isdir(path): - os.mkdir(path) - for fname in FILE_LIST: - fd = open(os.path.join(path, fname), 'w') - fd.write('dummy') - fd.close() - - fd = open(os.path.join(path, 'Chat.0.log'), 'w') - fd.write(CHATLOG) - fd.close() - fd = open(os.path.join(path, 'plasmalog.txt'), 'w') - fd.write('') - fd.close() - -def _fakeUruLiveDir(path): - """Create a fake Uru Live directory - """ - for dname in ('Avatars', 'init', 'KIimages'): - os.mkdir(os.path.join(path, dname)) - _fakeLogdir(os.path.join(path, 'Logs')) - _fakeLogdir(os.path.join(path, 'Logs', 'faketest')) - shutil.copyfile(os.path.join(base, 'avatar.jpg'), - os.path.join(path, 'Avatars', '001.jpg')) - shutil.copyfile(os.path.join(base, 'avatar.jpg'), - os.path.join(path, 'KIimages', 'KIimage001.jpg')) - shutil.copyfile(os.path.join(base, 'graphics.ini'), - os.path.join(path, 'init', 'graphics.ini')) - shutil.copyfile(os.path.join(base, 'audio.ini'), - os.path.join(path, 'init', 'audio.ini')) - class PlasmaChatTest(unittest.TestCase): def setUp(self): - self._tmpdir = mkdtemp() + self._tmpdir = mkTempdir() self._logdir = os.path.join(self._tmpdir, 'Logs') self._kidir = os.path.join(self._tmpdir, 'KIimages') self._avatardir = os.path.join(self._tmpdir, 'Avatars') @@ -92,8 +52,11 @@ self._logdest = os.path.join(self._tmpdir, 'ZippedLogs') self._kidest = os.path.join(self._tmpdir, 'FixedImages') - _fakeUruLiveDir(self._tmpdir) + fakeUruPersonalDataDir(self._tmpdir) + def tearDown(self): + rmTempdir(self._tmpdir) + def test_000dirs(self): for d in (self._tmpdir, self._logdir, self._kidir, self._avatardir): self.failUnless(os.path.isdir(d), d) @@ -153,9 +116,6 @@ self.failUnlessEqual(len(cleandata), len(newdata)) self.failUnlessEqual(cleandata, newdata) - def tearDown(self): - shutil.rmtree(self._tmpdir) - def test_suite(): return unittest.TestSuite(( unittest.makeSuite(PlasmaChatTest), Copied: pymoul/trunk/src/moul/file/tests/utils.py (from rev 113, pymoul/trunk/src/moul/file/tests/test_plasmalog.py) =================================================================== --- pymoul/trunk/src/moul/file/tests/utils.py (rev 0) +++ pymoul/trunk/src/moul/file/tests/utils.py 2007-02-01 13:47:36 UTC (rev 114) @@ -0,0 +1,94 @@ +# 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 +# +"""test helpers +""" +__author__ = "Christian Heimes" +__version__ = "$Id$" +__revision__ = "$Revision$" + +import os +import shutil +from tempfile import mkdtemp + +FILE_LIST = ['audio.0.elf', 'audiocaps.0.elf', 'audioTimes.0.elf', + 'Avatar.0.elf', 'impacts.0.elf', 'LocalizationDataMgr.0.elf', + 'Marker.0.elf', 'NetScreener.0.elf', 'patcher.0.elf', 'pipeline.0.elf', + 'plasmalog.txt', 'Python.0.elf', 'Simulation.0.elf', 'voice.0.elf', + 'Chat.0.log'] + +CHATLOG = """(01/02 03:04:05) Chat.log started... +(01/02 03:04:06) Testuser: foo +(01/02 03:04:07) ...Chat.log stopped. +""" + +base = os.path.dirname(__file__) + +def fakeLogdir(path): + """Create a fake logdir + """ + if not os.path.isdir(path): + os.mkdir(path) + for fname in FILE_LIST: + fd = open(os.path.join(path, fname), 'w') + fd.write('dummy') + fd.close() + + fd = open(os.path.join(path, 'Chat.0.log'), 'w') + fd.write(CHATLOG) + fd.close() + fd = open(os.path.join(path, 'plasmalog.txt'), 'w') + fd.write('') + fd.close() + +def fakeUruPersonalDataDir(path): + """Create a fake Uru Live personal data directory + """ + for dname in ('Avatars', 'init', 'KIimages'): + os.mkdir(os.path.join(path, dname)) + fakeLogdir(os.path.join(path, 'Logs')) + fakeLogdir(os.path.join(path, 'Logs', 'faketest')) + shutil.copyfile(os.path.join(base, 'avatar.jpg'), + os.path.join(path, 'Avatars', '001.jpg')) + shutil.copyfile(os.path.join(base, 'avatar.jpg'), + os.path.join(path, 'KIimages', 'KIimage001.jpg')) + shutil.copyfile(os.path.join(base, 'graphics.ini'), + os.path.join(path, 'init', 'graphics.ini')) + shutil.copyfile(os.path.join(base, 'audio.ini'), + os.path.join(path, 'init', 'audio.ini')) + +def fakeUruGameDir(path): + """Create a fake Uru Live game directory + """ + for dname in ('dat', 'sfx', 'avi'): + os.mkdir(os.path.join(path, dname)) + for fname in ('UruLauncher.exe', 'UruExplorer.exe'): # XXX: win32 + fd = open(os.path.join(path, fname), 'wb') + fd.write('dummy') + fd.close() + shutil.copyfile(os.path.join(base, 'test.loc'), + os.path.join(path, 'dat', 'test.loc')) + +def mkTempdir(): + """Make a temporary directory + """ + return mkdtemp() + +def rmTempdir(d): + """Remove a temporary directory + """ + shutil.rmtree(d) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ti...@us...> - 2007-02-01 03:07:31
|
Revision: 113 http://pymoul.svn.sourceforge.net/pymoul/?rev=113&view=rev Author: tiran Date: 2007-01-31 19:07:31 -0800 (Wed, 31 Jan 2007) Log Message: ----------- Moved stuff from config to *Directory classes Modified Paths: -------------- pymoul/trunk/src/moul/config/__init__.py pymoul/trunk/src/moul/file/directory.py Modified: pymoul/trunk/src/moul/config/__init__.py =================================================================== --- pymoul/trunk/src/moul/config/__init__.py 2007-02-01 02:39:34 UTC (rev 112) +++ pymoul/trunk/src/moul/config/__init__.py 2007-02-01 03:07:31 UTC (rev 113) @@ -69,7 +69,7 @@ return value elif default is _marker: raise KeyError(section) - + def setOption(self, section, name=None, value=_marker): """Set configuratin option """ @@ -82,15 +82,15 @@ del sec[name] else: sec[name] = value - + def addSection(self, section): """Add a new configuration section """ return self.setdefault(section, {}) - + def listConfig(self): """List - + >>> cfg = listConfig() >>> len(cfg) > 0 True @@ -115,35 +115,15 @@ ## directories class Directories(object): - - _dirmapping = { - 'install' : "%(installdir)s", - 'loc' : "%(installdir)s/dat", - 'dat' : "%(installdir)s/dat", - 'sound' : "%(installdir)s/sfx", - 'soundwav' : "%(installdir)s/sfx/streamingCache", - 'video' : "%(installdir)s/avi", - - 'userdata' : "%(datadir)s", - 'log' : "%(datadir)s/Log", - 'kiimages' : "%(datadir)s/KIimages", - 'avatars' : "%(datadir)s/Avatars", - 'chatlogs' : "%(datadir)s/chatlogs", - 'ini' : "%(datadir)s/init", - - 'pymoul.ini' : "%(pymouldir)s/pymoul.ini", - } - + """TODO: to be replaced or removed + """ + def __init__(self, config): - self._cache = {} self._config = config - - def clearCache(self): - self._cache.clear() def getMoulInstallDir(self): return self._config.getOption('moul.installdir') - + def getMoulUserDataDir(self): return getMoulUserDataDir() @@ -153,31 +133,11 @@ def lookupDir(self, name): """Lookup MOUL directory """ - cached = self._cache.get(name, None) - if cached: - return cached - path = self._dirmapping.get(name) - path = path.replace('/', os.sep) - map = {'installdir' : self.getMoulInstallDir(), - 'datadir' : self.getMoulUserDataDir(), - 'pymouldir' : self.getPyMoulDataDir(), + map = {'install' : self.getMoulInstallDir, + 'userdata' : self.getMoulUserDataDir, + 'pymouldir' : self.getPyMoulDataDir, } - fullpath = path % map - #self._cache[name] = fullpath - return fullpath - - def listDirs(self): - """List all MOUL dirs - - >>> dirs = listDirs() - >>> len(dirs) - 13 - >>> type(dirs) - <type 'dict'> - """ - return dict([(name, self.lookupDir(name)) for name in self._dirmapping]) + return map[name]() _directories = Directories(_configuration) -clearCache = _directories.clearCache lookupDir = _directories.lookupDir -listDirs = _directories.listDirs Modified: pymoul/trunk/src/moul/file/directory.py =================================================================== --- pymoul/trunk/src/moul/file/directory.py 2007-02-01 02:39:34 UTC (rev 112) +++ pymoul/trunk/src/moul/file/directory.py 2007-02-01 03:07:31 UTC (rev 113) @@ -34,6 +34,25 @@ LOG = getLogger('moul.file.directory') +class DirectoryCount(object): + """Counts how many files are inside a directory + """ + + def __init__(self, path): + self._basepath = path + self._count = 0 + if not os.path.isdir(path): + self._count = None + return + # TODO: fnmatch + for name in os.listdir(path): + if os.path.isfile(os.path.join(path, name)): + self._count+=1 + + @property + def count(self): + return self._count + class AbstractUruDirectory(object): """Abstract class for an Uru directory """ @@ -66,6 +85,8 @@ """ args = [] factory, argnames = self._factories[name] + if not self.exists(argnames[0]): + return None for name in argnames: args.append(self.get(name)) return factory(*args) @@ -112,19 +133,27 @@ 'graphics.ini' : (GraphicsIni, ('ini',)), 'audio.ini' : (AudioIni, ('ini',)), 'chatlogs' : (ChatlogDirectoryView, ('chatlogs',)), - 'zipped' : None, - 'fixed' : None, + 'zipped' : (DirectoryCount, ('zipped',)), + 'fixed' : (DirectoryCount, ('fixed',)), } + def create(self, name): + """Create a directory + """ + if not name or name == '.': + raise ValueError("Cannot create() basedir") + path = self.get(name) + os.makedirs(path) + def createTree(self): """Create the directory tree """ created = [] - if self.exists(''): + if not self.exists(''): os.mkdir(self._basepath) created.append(self._basepath) for key in self._dirmapping: if not self.exists(key): - os.mkdir(path) + self.create(key) created.append(path) return created This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ti...@us...> - 2007-02-01 02:39:34
|
Revision: 112 http://pymoul.svn.sourceforge.net/pymoul/?rev=112&view=rev Author: tiran Date: 2007-01-31 18:39:34 -0800 (Wed, 31 Jan 2007) Log Message: ----------- Added directory handler Modified Paths: -------------- pymoul/trunk/src/moul/file/localization.py Added Paths: ----------- pymoul/trunk/src/moul/file/directory.py pymoul/trunk/src/moul/file/tests/test_directory.py Removed Paths: ------------- pymoul/trunk/src/moul/file/directories.py Deleted: pymoul/trunk/src/moul/file/directories.py =================================================================== --- pymoul/trunk/src/moul/file/directories.py 2007-02-01 00:05:40 UTC (rev 111) +++ pymoul/trunk/src/moul/file/directories.py 2007-02-01 02:39:34 UTC (rev 112) @@ -1,78 +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 -# -"""Directories: Uru game directory and Uru personal data directory -""" -__author__ = "Christian Heimes" -__version__ = "$Id$" -__revision__ = "$Revision$" - -import os - -from moul.log import getLogger -from moul.file.chatlog import ChatlogMover -from moul.file.chatlog import ChatlogDirectoryView -from moul.file.plasmalog import PlasmalogZipper -from moul.file.kiimage import KIImageFixer - -LOG = getLogger('moul.file.directory') - -class AbstractUruDirectory(object): - """Abstract class for an Uru directory - """ - _dirmapping = {} - - def __init__(self, basedir): - self._basedir = basedir - - def exists(self): - return os.path.isdir(self._basedir) - - def get(self, name): - path = self._dirmapping(name) - return os.path.join(self._basedir, path) - -class UruGameDataDirectory(AbstractUruDirectory): - """Uru game directory handler - - An uru game directory contains the launcher, explorer, age files, sound - files, localizations and other stuff. - """ - _dirmapping = { - 'loc' : 'dat', - 'dat' : 'dat', - 'sound' : 'sfx' - 'soundwav' : 'sfx' + os.sep + 'streamingCache', - 'video' : 'avi', - } - -class UruPersonalDataDirectory(AbstractUruDirectory): - """Uru personal data handler - - An uru personal data directory contains per user data like audio and - graphics settings, KI shots, avatar images, logs and pyMoul specific - data. - """ - _dirmapping = { - 'log' : 'Log', - 'kiimages' : 'KIimages', - 'avatars' : 'Avatars', - 'ini' : 'init', - 'chatlogs' : 'Chatlogs', - 'zipped' : 'ZippedLogs', - } - Copied: pymoul/trunk/src/moul/file/directory.py (from rev 111, pymoul/trunk/src/moul/file/directories.py) =================================================================== --- pymoul/trunk/src/moul/file/directory.py (rev 0) +++ pymoul/trunk/src/moul/file/directory.py 2007-02-01 02:39:34 UTC (rev 112) @@ -0,0 +1,130 @@ +# 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 +# +"""Directories: Uru game directory and Uru personal data directory +""" +__author__ = "Christian Heimes" +__version__ = "$Id$" +__revision__ = "$Revision$" + +import os + +from moul.log import getLogger +from moul.file.chatlog import ChatlogMover +from moul.file.chatlog import ChatlogDirectoryView +from moul.file.plasmalog import PlasmalogZipper +from moul.file.kiimage import KIImageFixer +from moul.file.wdysini import GraphicsIni +from moul.file.wdysini import AudioIni +from moul.file.localization import parseLocDirectory + +LOG = getLogger('moul.file.directory') + +class AbstractUruDirectory(object): + """Abstract class for an Uru directory + """ + # name -> subpath + _dirmapping = {} + # name -> (callable, nametuple) + _factories = {} + + def __init__(self, basepath): + self._basepath = basepath + + def exists(self, name=None): + """Check if directory with name exists. + """ + os.path.isdir(self.get(name)) + + def get(self, name=None): + """Get complete path for name + + None or '.' means basedir. + """ + if name and name != '.': + path = self._dirmapping(name) + else: + path = '' + return os.path.join(self._basepath, path) + + def factory(self, name): + """Factory - creates instances to handle subdirectories and files + """ + args = [] + factory, argnames = self._factories[name] + for name in argnames: + args.append(self.get(name)) + return factory(*args) + +class UruGameDataDirectory(AbstractUruDirectory): + """Uru game directory handler + + An uru game directory contains the launcher, explorer, age files, sound + files, localizations and other stuff. + """ + _dirmapping = { + 'loc' : 'dat', + 'dat' : 'dat', + 'sound' : 'sfx', + 'soundwav' : 'sfx' + os.sep + 'streamingCache', + 'video' : 'avi', + } + _factory = { + 'loc' : (parseLocDirectory, ('loc',)), + } + +class UruPersonalDataDirectory(AbstractUruDirectory): + """Uru personal data handler + + An uru personal data directory contains per user data like audio and + graphics settings, KI shots, avatar images, logs and pyMoul specific + data. + """ + _dirmapping = { + 'log' : 'Log', + 'kiimages' : 'KIimages', + 'avatars' : 'Avatars', + 'ini' : 'init', + 'chatlogs' : 'Chatlogs', + 'zipped' : 'ZippedLogs', + 'fixed' : 'FixedImages', + } + + _factories = { + 'log-chat' : (ChatlogMover, ('log', 'chatlogs')), + 'log-zip' : (PlasmalogZipper, ('log', 'zipped')), + 'kiimages' : (KIImageFixer, ('kiimages', 'fixed')), + 'avatars' : (KIImageFixer, ('avatars', 'fixed')), + 'graphics.ini' : (GraphicsIni, ('ini',)), + 'audio.ini' : (AudioIni, ('ini',)), + 'chatlogs' : (ChatlogDirectoryView, ('chatlogs',)), + 'zipped' : None, + 'fixed' : None, + } + + def createTree(self): + """Create the directory tree + """ + created = [] + if self.exists(''): + os.mkdir(self._basepath) + created.append(self._basepath) + for key in self._dirmapping: + if not self.exists(key): + os.mkdir(path) + created.append(path) + return created Property changes on: pymoul/trunk/src/moul/file/directory.py ___________________________________________________________________ Name: svn:keywords + Id Revision Name: svn:eol-style + native Modified: pymoul/trunk/src/moul/file/localization.py =================================================================== --- pymoul/trunk/src/moul/file/localization.py 2007-02-01 00:05:40 UTC (rev 111) +++ pymoul/trunk/src/moul/file/localization.py 2007-02-01 02:39:34 UTC (rev 112) @@ -36,21 +36,14 @@ from moul.log import getLogger LOG = getLogger('moul loc') -def _addList(d, key, value): - lst = d.setdefault(key, []) - lst.append(value) +IGNORE_AGES = [u'OptionsMenu', u'ACA', u'Global', u'KI', u'Heek'] +IGNORE_SETS = [] +IGNORE_ELEMENTS = [] -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', '_tree', - '_ignore_age') + __slot__ = ('_bylanguage', '_byage', '_byset', '_byelement', '_tree') def __new__(cls, *args, **kwargs): self = dict.__new__(cls, *args, **kwargs) @@ -59,7 +52,6 @@ self._byset = {} self._byelement = {} self._tree = {} - self._ignore_age = [u'OptionsMenu', u'ACA', u'Global', u'KI'] return self def register(self, translation): @@ -69,8 +61,12 @@ (translation.fname, str(key))) LOG.error("TranslationRegistry: %s" % msg) raise KeyError(msg) - if translation.age in self._ignore_age: + if translation.age in IGNORE_AGES: return + if translation.set in IGNORE_SETS: + return + if translation.element in IGNORE_ELEMENTS: + return _addList(self._bylanguage, translation.language, key) _addList(self._byage, translation.age, key) _addList(self._byset, translation.set, key) @@ -112,6 +108,21 @@ translationRegistry = TranslationRegistry() registerTranslation = translationRegistry.register +def _addList(d, key, value): + """Utility for dict.setdefault(key, [].append()) + """ + lst = d.setdefault(key, []) + lst.append(value) + +def _addTree(d, lang, age, setname, element, key): + """Utility to create the lang - age - set - element tree + """ + dlang = d.setdefault(lang, {}) + dage = dlang.setdefault(age, {}) + dset = dage.setdefault(setname, {}) + dset[element] = key + + class Translation(unicode): """Translation object Added: pymoul/trunk/src/moul/file/tests/test_directory.py =================================================================== --- pymoul/trunk/src/moul/file/tests/test_directory.py (rev 0) +++ pymoul/trunk/src/moul/file/tests/test_directory.py 2007-02-01 02:39:34 UTC (rev 112) @@ -0,0 +1,36 @@ +# 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.file.directory unit tests +""" +__author__ = "Christian Heimes" +__version__ = "$Id$" +__revision__ = "$Revision$" + +import unittest +from doctest import DocTestSuite + +import moul.file.directory + +def test_suite(): + return unittest.TestSuite(( + DocTestSuite('moul.file.directory') + )) + +if __name__ == '__main__': + unittest.main(defaultTest="test_suite") + Property changes on: pymoul/trunk/src/moul/file/tests/test_directory.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-02-01 00:05:40
|
Revision: 111 http://pymoul.svn.sourceforge.net/pymoul/?rev=111&view=rev Author: tiran Date: 2007-01-31 16:05:40 -0800 (Wed, 31 Jan 2007) Log Message: ----------- Added some informations and donate link to README.txt Modified Paths: -------------- pymoul/trunk/README.txt pymoul/trunk/src/moul/file/tests/test_wdysini.py pymoul/trunk/src/moul/file/wdysini.py pymoul/trunk/src/moul/qt/mainwindow.py Added Paths: ----------- pymoul/trunk/src/moul/file/directories.py Modified: pymoul/trunk/README.txt =================================================================== --- pymoul/trunk/README.txt 2007-01-31 15:40:51 UTC (rev 110) +++ pymoul/trunk/README.txt 2007-02-01 00:05:40 UTC (rev 111) @@ -0,0 +1,19 @@ +========================================= +Python library for Myst Online : Uru Live +========================================= + +About +===== + +pyMoul is a set of Python libraries around MOUL (Myst Online : Uru Live). At +the moment the main focus is on the Qt4 based graphical tool. + +Donate +====== + +If you like the tool and find it usful please donate some money. You can +use the link below to send me money over PayPal. You don't need a PayPal +account. A credit card or bank account is sufficient. + +https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=christian%40cheimes%2ede&item_name=Donate%20for%20Tiran%27s%20open%20source%20activities&page_style=PayPal&no_shipping=2&cn=Your%20note%20for%20me&tax=0¤cy_code=EUR&lc=DE&bn=PP%2dDonationsBF&charset=UTF%2d8 + Added: pymoul/trunk/src/moul/file/directories.py =================================================================== --- pymoul/trunk/src/moul/file/directories.py (rev 0) +++ pymoul/trunk/src/moul/file/directories.py 2007-02-01 00:05:40 UTC (rev 111) @@ -0,0 +1,78 @@ +# 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 +# +"""Directories: Uru game directory and Uru personal data directory +""" +__author__ = "Christian Heimes" +__version__ = "$Id$" +__revision__ = "$Revision$" + +import os + +from moul.log import getLogger +from moul.file.chatlog import ChatlogMover +from moul.file.chatlog import ChatlogDirectoryView +from moul.file.plasmalog import PlasmalogZipper +from moul.file.kiimage import KIImageFixer + +LOG = getLogger('moul.file.directory') + +class AbstractUruDirectory(object): + """Abstract class for an Uru directory + """ + _dirmapping = {} + + def __init__(self, basedir): + self._basedir = basedir + + def exists(self): + return os.path.isdir(self._basedir) + + def get(self, name): + path = self._dirmapping(name) + return os.path.join(self._basedir, path) + +class UruGameDataDirectory(AbstractUruDirectory): + """Uru game directory handler + + An uru game directory contains the launcher, explorer, age files, sound + files, localizations and other stuff. + """ + _dirmapping = { + 'loc' : 'dat', + 'dat' : 'dat', + 'sound' : 'sfx' + 'soundwav' : 'sfx' + os.sep + 'streamingCache', + 'video' : 'avi', + } + +class UruPersonalDataDirectory(AbstractUruDirectory): + """Uru personal data handler + + An uru personal data directory contains per user data like audio and + graphics settings, KI shots, avatar images, logs and pyMoul specific + data. + """ + _dirmapping = { + 'log' : 'Log', + 'kiimages' : 'KIimages', + 'avatars' : 'Avatars', + 'ini' : 'init', + 'chatlogs' : 'Chatlogs', + 'zipped' : 'ZippedLogs', + } + Modified: pymoul/trunk/src/moul/file/tests/test_wdysini.py =================================================================== --- pymoul/trunk/src/moul/file/tests/test_wdysini.py 2007-01-31 15:40:51 UTC (rev 110) +++ pymoul/trunk/src/moul/file/tests/test_wdysini.py 2007-02-01 00:05:40 UTC (rev 111) @@ -26,6 +26,8 @@ from StringIO import StringIO import unittest from doctest import DocTestSuite +from tempfile import mkdtemp +import shutil from moul.crypt.whatdoyousee import decryptWDYS from moul.file.wdysini import AudioIni @@ -45,12 +47,14 @@ def setUp(self): self.enc_fd = open(self.enc, 'rb') self.dec_fd = open(self.dec, 'r') - self.parser = self.parserClass() - + self.tmpdir = mkdtemp() + shutil.copy(self.enc, self.tmpdir) + def tearDown(self): self.enc_fd.close() self.dec_fd.close() - + shutil.rmtree(self.tmpdir) + def _compareLines(self, first, second): flines = first.split('\n') slines = second.split('\n') @@ -58,39 +62,58 @@ self.failUnlessEqual(fline, slines[i]) def test_parseString(self): - p = self.parser + p = self.parserClass(self.tmpdir) data = self.dec_fd.read() - p.parseString(data) + p._parseString(data) self.failUnless(p._filedata) self.failIf(p.isChanged()) - newdata = p.writeString() + self.failUnless(p.exists()) + newdata = p._writeString() self._compareLines(data, newdata) def test_chars(self): + p = self.parserClass(self.tmpdir) valid = string.ascii_letters + '_. ' data = self.dec_fd.read() - self.parser.parseString(data) - for key in self.parser._filedata: + p._parseString(data) + for key in p._filedata: for s in key: self.failUnless(s in valid, s) def test_cryptparse(self): - p = self.parser + p = self.parserClass(self.tmpdir) data = self.dec_fd.read() - p.parseEncFile(self.enc) - newdata = p.writeString() + p._parseEncFile(self.enc) + newdata = p._writeString() self._compareLines(data, newdata) fdout = StringIO() - p.writeEncFile(fdout) - + p._writeEncFile(fdout) + # round trip fdout.seek(0) encdata = decryptWDYS(fdout) - p.parseString(encdata) - newdata = p.writeString() + p._parseString(encdata) + newdata = p._writeString() self._compareLines(data, newdata) - - + + def test_publicapi_read(self): + p = self.parserClass(self.tmpdir) + p.read() + self.failUnless(p.exists()) + p.write() + # TODO: more + + def test_publicapi_create(self): + inipath = os.path.join(self.tmpdir, os.path.basename(self.enc)) + os.unlink(inipath) + p = self.parserClass(self.tmpdir) + self.failIf(p.exists()) + p.create() + self.failUnless(p.exists()) + p.write() + self.failUnless(p.exists()) + # TODO: more + class AudioIniTest(GenericIniTest): enc = aud_enc dec = aud_dec @@ -102,10 +125,10 @@ parserClass = GraphicsIni def test_properties(self): - p = self.parser + p = self.parserClass(self.tmpdir) eq = self.failUnlessEqual - p.parseEncFile(self.enc) + p.read() eq(p.screenres, 1) eq(p.windowed, True) eq(p.antialias, 2) @@ -116,10 +139,10 @@ eq(p.vsync, False) def test_property_edit(self): - p = self.parser + p = self.parserClass(self.tmpdir) eq = self.failUnlessEqual - p.parseEncFile(self.enc) + p.read() self.failIf(p.isChanged()) p.vsync = True Modified: pymoul/trunk/src/moul/file/wdysini.py =================================================================== --- pymoul/trunk/src/moul/file/wdysini.py 2007-01-31 15:40:51 UTC (rev 110) +++ pymoul/trunk/src/moul/file/wdysini.py 2007-02-01 00:05:40 UTC (rev 111) @@ -307,46 +307,75 @@ class ConfFile(object): _options = {} + _defaults = {} _filename = None - def __init__(self): + def __init__(self, path): + if not os.path.isdir(path): + raise OSError("Directory not found %s" % path) + self._fpath = os.path.join(path, self._filename) self._filedata = {} self._newdata = {} self._order = [] - self._fpath = None - + self._opened = False + def clear(self): """Clear all informations """ self._filedata.clear() self._newdata.clear() self._order[:] = [] - + def reset(self): """Reset state of the ini parser - + Copies file data to new data """ self._newdata.clear() self._newdata.update(self._filedata.copy()) - - def open(self, path): - """Open encrypted file at 'path' + + def exists(self): + """Test if the file exists """ - if self._fpath is not None: + return os.path.isfile(self._fpath) + + def isChanged(self): + """Check if the data was changed + """ + for key, value in self._filedata.items(): + if value != self._newdata[key]: + return True + return False + + def read(self): + """Open encrypted file at 'path' and parse its data + """ + if self._opened: raise ValueError("File already open") - if not os.path.isdir(path): - raise OSError("Directory not found %s" % path) - self._fpath = os.path.join(path, self._filename) - self.parseEncFile(self._fpath) - + self._opened = True + self._parseEncFile(self._fpath) + + def create(self): + """Create a new file using default values + """ + if self._opened: + raise ValueError("File already open") + # Create a dummy file + fd = open(self._fpath, 'w') + fd.write("Created by pyMoul") + fd.close() + self._opened = True + for key, value in self._defaults.items(): + self._filedata[key] = value + self.reset() + def write(self): """Write data to file - + The write method uses the savest way possible. The old file is backed up, the new data is written to another file and at last the original file is replaced with the new file. - + WINDOWS ------- os.rename() can't replace the file in place under Windows. The final @@ -355,17 +384,19 @@ orig = self._fpath if orig is None: raise ValueError("Full path not set") + if not self._opened: + raise ValueError("File not opened") bak = orig + ".bak" new = orig + ".new" shutil.copyfile(orig, bak) # make backup - self.writeEncFile(new) # write new + self._writeEncFile(new) # write new os.unlink(orig) # stupid windows can't perform an atomic rename os.rename(new, orig) # move new to orig - + # reread the file again - self.parseEncFile(self._fpath) - - def parseEncFile(self, fd_name): + self._parseEncFile(self._fpath) + + def _parseEncFile(self, fd_name): """Read and parse file (fd or file name) """ self.clear() @@ -379,9 +410,9 @@ data = decryptWDYS(fd) if close: fd.close() - self.parseString(data) - - def parseString(self, s): + self._parseString(data) + + def _parseString(self, s): """Parse string with file contents @param s: newline seperated file @@ -414,22 +445,14 @@ raise ValueError(line) self.reset() - self.parserDoneHook() + self._parserDoneHook() - def parserDoneHook(self): + def _parserDoneHook(self): """Hook called after the data is read and parsed """ pass - - def isChanged(self): - """Check if the data was changed - """ - for key, value in self._filedata.items(): - if value != self._newdata[key]: - return True - return False - - def writeString(self): + + def _writeString(self): """Create a string with new file contents """ out = [] @@ -448,7 +471,7 @@ out.append('') # new line at EOF return '\n'.join(out) - def writeEncFile(self, fd_name): + def _writeEncFile(self, fd_name): """Write file (fd or file name) """ if isinstance(fd_name, basestring): @@ -457,7 +480,7 @@ else: fd = fd_name close = False - data = self.writeString() + data = self._writeString() encryptWDYS(data, fd) if close: fd.close() @@ -508,9 +531,23 @@ 'Audio.SetChannelVolume GUI' : (FloatString, MinMax(0.0, 1.0)), # 0-100%, no ui # microphon missing -> OS mixer } + _defaults = { + 'Audio.Initialize' : BoolString(True), + 'Audio.UseEAX' : BoolString(False), + 'Audio.SetPriorityCutoff' : 6, + 'Audio.MuteAll' : 0, # 0, 1 + 'Audio.SetChannelVolume SoundFX' : FloatString(1.0), + 'Audio.SetChannelVolume BgndMusic' : FloatString(1.0), + 'Audio.SetChannelVolume Ambience' : FloatString(1.0), + 'Audio.SetChannelVolume NPCVoice' : FloatString(1.0), + 'Audio.EnableVoiceRecording' : 1, + 'Audio.SetDeviceName' : QuotedString('"Generic Software"'), + 'Audio.SetChannelVolume GUI' : FloatString(1.0), + # microphon missing -> OS mixer + } _devices = ['"Generic Software"', '"Generic Hardware"'] # plus maybe a custom OpenAL v1.1 device - + def parserDoneHook(self): """Hook called after the data is read and parsed """ @@ -596,7 +633,21 @@ 'Graphics.EnableVSync' : (BoolString, Constrain()), # true/false 'Graphics.Shadow.VisibleDistance' : (FloatString, MinMax(0.0, 1.0)), # 0-1, 0-100% } - + _defaults = { + 'Graphics.Width' : 800, + 'Graphics.Height' : 600, + 'Graphics.ColorDepth' : 32, + 'Graphics.Windowed' : BoolString(False), + 'Graphics.AntiAliasAmount' : 0, + 'Graphics.AnisotropicLevel' : 1, + 'Graphics.TextureQuality' : 1, + 'Quality.Level' : 2, + 'Graphics.Shadow.Enable' : 1, + 'Graphics.EnablePlanarReflections' : 1, + 'Graphics.EnableVSync' : BoolString(False), + 'Graphics.Shadow.VisibleDistance' : FloatString(0.337126016617), + } + def _getScreenRes(self): w = self._newdata['Graphics.Width'] h = self._newdata['Graphics.Height'] Modified: pymoul/trunk/src/moul/qt/mainwindow.py =================================================================== --- pymoul/trunk/src/moul/qt/mainwindow.py 2007-01-31 15:40:51 UTC (rev 110) +++ pymoul/trunk/src/moul/qt/mainwindow.py 2007-02-01 00:05:40 UTC (rev 111) @@ -199,9 +199,9 @@ @qtslot graphicsini_loaded(): notify when a graphics.ini is loaded """ inipath = lookupDir('ini') - self._graphics_ini = gini = GraphicsIni() + self._graphics_ini = gini = GraphicsIni(inipath) try: - gini.open(inipath) + gini.read() except Exception, msg: LOG.exception("Something bad happened while parsing the graphics.ini file") QtGui.QMessageBox.critical(None, @@ -349,9 +349,9 @@ SIGNAL: audioini_loaded() """ inipath = lookupDir('ini') - self._audio_ini = aini = AudioIni() + self._audio_ini = aini = AudioIni(inipath) try: - aini.open(inipath) + aini.read() except Exception, msg: LOG.exception("Something bad happened while parsing the audio.ini file") QtGui.QMessageBox.critical(None, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ti...@us...> - 2007-01-31 15:40:57
|
Revision: 110 http://pymoul.svn.sourceforge.net/pymoul/?rev=110&view=rev Author: tiran Date: 2007-01-31 07:40:51 -0800 (Wed, 31 Jan 2007) Log Message: ----------- Small doc string adjustments to make epydoc happy Modified Paths: -------------- pymoul/trunk/Makefile.in pymoul/trunk/genepydoc.py pymoul/trunk/src/moul/file/wdysini.py pymoul/trunk/src/moul/osdependent/processinfo.py pymoul/trunk/src/moul/osdependent/singleapp.py pymoul/trunk/src/moul/qt/mainwindow.py pymoul/trunk/src/moul/qt/moulqt.py pymoul/trunk/src/moul/time/cavern.py pymoul/trunk/src/moul/time/dni.py Modified: pymoul/trunk/Makefile.in =================================================================== --- pymoul/trunk/Makefile.in 2007-01-31 14:57:57 UTC (rev 109) +++ pymoul/trunk/Makefile.in 2007-01-31 15:40:51 UTC (rev 110) @@ -45,8 +45,14 @@ PYTHONPATH="src" $(PYTHON) test.py $(TESTFLAGS) $(TESTOPTS) doc_html: - PYTHONPATH="src" $(EPYDOC) -v --html --output="doc/html" moul + PYTHONPATH="src" $(EPYDOC) -v --html --no-sourcecode \ + --output="doc/html" moul +doc_html_graph: + PYTHONPATH="src" $(EPYDOC) -v --html --no-sourcecode --graph=all \ + --output="doc/html" moul + + # What should the default be? test: test_inplace Modified: pymoul/trunk/genepydoc.py =================================================================== --- pymoul/trunk/genepydoc.py 2007-01-31 14:57:57 UTC (rev 109) +++ pymoul/trunk/genepydoc.py 2007-01-31 15:40:51 UTC (rev 110) @@ -8,13 +8,13 @@ #from epydoc.docstringparser import register_field_handler STANDARD_FIELDS.append( - DocstringField(['slots', 'qtslots'], 'Qt Slot: %s', 'Qt Slots: %s', + DocstringField(['slot', 'qtslot'], 'Qt Slot', 'Qt Slots', 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, + DocstringField(['signal', 'qtsignal'], 'Emits Qt Signal', + 'Emit Qt Signals', short=False, multivalue=True, takes_arg=True) ) Modified: pymoul/trunk/src/moul/file/wdysini.py =================================================================== --- pymoul/trunk/src/moul/file/wdysini.py 2007-01-31 14:57:57 UTC (rev 109) +++ pymoul/trunk/src/moul/file/wdysini.py 2007-01-31 15:40:51 UTC (rev 110) @@ -347,8 +347,10 @@ up, the new data is written to another file and at last the original file is replaced with the new file. - WINDOWS: os.rename() can't replace the file in place under Windows. - The final operation is not atomic. :( + WINDOWS + ------- + os.rename() can't replace the file in place under Windows. The final + operation is not atomic. :( """ orig = self._fpath if orig is None: @@ -382,7 +384,8 @@ def parseString(self, s): """Parse string with file contents - @param s newline seperated file (string) + @param s: newline seperated file + @type s: string """ self.clear() lines = s.split('\n') Modified: pymoul/trunk/src/moul/osdependent/processinfo.py =================================================================== --- pymoul/trunk/src/moul/osdependent/processinfo.py 2007-01-31 14:57:57 UTC (rev 109) +++ pymoul/trunk/src/moul/osdependent/processinfo.py 2007-01-31 15:40:51 UTC (rev 110) @@ -17,11 +17,12 @@ # """Get process informations -API: - getPids() - list of ints/longs - getPidNames() - mapping pid -> name - getPidDetails(pid) - detailed informations about a process - getPidDetails('self') - detailed informations about current process +API +=== + getPids() - list of ints/longs + getPidNames() - mapping pid -> name + getPidDetails(pid) - detailed informations about a process + getPidDetails('self') - detailed informations about current process >>> cur = os.getpid() >>> exe = sys.executable Modified: pymoul/trunk/src/moul/osdependent/singleapp.py =================================================================== --- pymoul/trunk/src/moul/osdependent/singleapp.py 2007-01-31 14:57:57 UTC (rev 109) +++ pymoul/trunk/src/moul/osdependent/singleapp.py 2007-01-31 15:40:51 UTC (rev 110) @@ -17,10 +17,9 @@ # """Simple single instance application -Includes portalocker code with minor tweaks for Python 2.4+ - Author: Jonathan Feinberg <jd...@po...> - Version: $Id$ - http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/65203 +Includes portalocker code with minor tweaks for Python 2.4+ from +Jonathan Feinberg <jd...@po...> +http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/65203 Unit tests for lock/unlock are in tests/test_singleapp @@ -38,6 +37,7 @@ >>> singleapp.release() >>> os.path.isfile(lckfile) False + """ __author__ = "Christian Heimes" __version__ = "$Id$" Modified: pymoul/trunk/src/moul/qt/mainwindow.py =================================================================== --- pymoul/trunk/src/moul/qt/mainwindow.py 2007-01-31 14:57:57 UTC (rev 109) +++ pymoul/trunk/src/moul/qt/mainwindow.py 2007-01-31 15:40:51 UTC (rev 110) @@ -95,6 +95,9 @@ @signalLogDecorator(LOG) def on_moulIsRunning(self, boolean): + """ + @qtslot moulIsRunning(bool): notify if moul is running + """ sb = self.statusbar boolean = bool(boolean) if boolean is not self._moulrunning: @@ -125,7 +128,9 @@ """ Close event handler - @param event close event (QCloseEvent) + @qtslot closeEvent(event QCloseEvent): notify on close + @param event: close event + @type event: QCloseEvent instance """ #if self._dirty: # event.reject() @@ -137,9 +142,11 @@ def keyPressEvent(self, event): """ Key event handler - - @param event key event (QKeyEvent) - + + @qtslot keyPressEvent(event QKeyEvent): notify on key pressed + @param event: key event + @type event: QKeyEvent + Has to ignore unknown events """ #if event.key() == Qt.Key_Escape: @@ -189,7 +196,7 @@ @signalLogDecorator(LOG) def on_graphicsini_loaded(self): """ - SIGNAL graphicsini_loaded() + @qtslot graphicsini_loaded(): notify when a graphics.ini is loaded """ inipath = lookupDir('ini') self._graphics_ini = gini = GraphicsIni() Modified: pymoul/trunk/src/moul/qt/moulqt.py =================================================================== --- pymoul/trunk/src/moul/qt/moulqt.py 2007-01-31 14:57:57 UTC (rev 109) +++ pymoul/trunk/src/moul/qt/moulqt.py 2007-01-31 15:40:51 UTC (rev 110) @@ -41,13 +41,13 @@ """Main application Flow diagram: - * create app - * check if other instance of pymoulqt is running - o exit app if another instance is running - * create log file handler - * check if URU is running - o exit if URU is running - * Show the main window + - create app + - check if other instance of pymoulqt is running + - exit app if another instance is running + - create log file handler + - check if URU is running + - exit if URU is running + - Show the main window """ LOG.info("Starting PyMoul QT UI with argv %s" % repr(args)) app = QtGui.QApplication(*args) Modified: pymoul/trunk/src/moul/time/cavern.py =================================================================== --- pymoul/trunk/src/moul/time/cavern.py 2007-01-31 14:57:57 UTC (rev 109) +++ pymoul/trunk/src/moul/time/cavern.py 2007-01-31 15:40:51 UTC (rev 110) @@ -117,14 +117,14 @@ zone. Call a CavernTime object: utc - datetime -- Current time in UTC as <datetime> object + - datetime -- Current time in UTC as <datetime> object cavern, pacific - datetime -- current time TZ as <datetime> object - tz -- time zone object - dst -- dst in seconds if dst - utcoffset -- (signum, hours, fraction) offset from UTC - name -- long time like US/Mountain - id -- short name like MST + - datetime -- current time TZ as <datetime> object + - tz -- time zone object + - dst -- dst in seconds if dst + - utcoffset -- (signum, hours, fraction) offset from UTC + - name -- long time like US/Mountain + - id -- short name like MST >>> ct = CavernTime() >>> result = ct() Modified: pymoul/trunk/src/moul/time/dni.py =================================================================== --- pymoul/trunk/src/moul/time/dni.py 2007-01-31 14:57:57 UTC (rev 109) +++ pymoul/trunk/src/moul/time/dni.py 2007-01-31 15:40:51 UTC (rev 110) @@ -67,28 +67,28 @@ The DniTime class assumes the following rules: - * Hahrtee Farah 1 started on 21st of April 7656 B.C. - * Hahrtee Fahrah 15 started 1719 A.C. - * A new hahr starts on 21st of April. - * The reference time for the calculation is Mountain Standard Time (MST) - without (!) DST. The UTC offset is always UTC-7. - * To compensate leap years a new hahr starts on midnight (0:00am) in every - forth year (year % 4 == 0). - * To simplify the code special cases like year % 100 and year % 400 are - NOT taken into account. I'm assuming a year has 365,25 days (which is - wrong). A year according to the Gregorian Calendar has 365,2425 days. + - Hahrtee Farah 1 started on 21st of April 7656 B.C. + - Hahrtee Fahrah 15 started 1719 A.C. + - A new hahr starts on 21st of April. + - The reference time for the calculation is Mountain Standard Time (MST) + without (!) DST. The UTC offset is always UTC-7. + - To compensate leap years a new hahr starts on midnight (0:00am) in every + forth year (year % 4 == 0). + - To simplify the code special cases like year % 100 and year % 400 are + NOT taken into account. I'm assuming a year has 365,25 days (which is + wrong). A year according to the Gregorian Calendar has 365,2425 days. Overview - --------- + -------- - fahrah millenium 625 years - hahr year 1 year - vailee month 10 per year - yahr day 29 per vailee, about 30h 14min - gahrtahvo section about 6h, 3min - tahvo quarter about 14,5min - gorahn minute 36 seconds - prorahn second about 1.3929 seconds + fahrah millenium 625 years + hahr year 1 year + vailee month 10 per year + yahr day 29 per vailee, about 30h 14min + gahrtahvo section about 6h, 3min + tahvo quarter about 14,5min + gorahn minute 36 seconds + prorahn second about 1.3929 seconds """ _fahrah = None # millenium (625 years) _hahr = None # year (1 year) 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:58:01
|
Revision: 109 http://pymoul.svn.sourceforge.net/pymoul/?rev=109&view=rev Author: tiran Date: 2007-01-31 06:57:57 -0800 (Wed, 31 Jan 2007) Log Message: ----------- Two small fixes to make unit tests work again Modified Paths: -------------- pymoul/trunk/Makefile.in pymoul/trunk/src/moul/time/cavern.py Modified: pymoul/trunk/Makefile.in =================================================================== --- pymoul/trunk/Makefile.in 2007-01-31 14:46:54 UTC (rev 108) +++ pymoul/trunk/Makefile.in 2007-01-31 14:57:57 UTC (rev 109) @@ -38,10 +38,10 @@ ui: $(PYTHON) compileui.py -test_build: build compileui +test_build: build ui PYTHONPATH="src" $(PYTHON) test.py $(TESTFLAGS) $(TESTOPTS) -test_inplace: compileui +test_inplace: ui PYTHONPATH="src" $(PYTHON) test.py $(TESTFLAGS) $(TESTOPTS) doc_html: Modified: pymoul/trunk/src/moul/time/cavern.py =================================================================== --- pymoul/trunk/src/moul/time/cavern.py 2007-01-31 14:46:54 UTC (rev 108) +++ pymoul/trunk/src/moul/time/cavern.py 2007-01-31 14:57:57 UTC (rev 109) @@ -25,6 +25,12 @@ from datetime import datetime +# pytz is an egg +from moul.osdependent import __FROZEN__ +if not __FROZEN__: + import pkg_resources + pkg_resources.require("pytz>=2006p") + #from pytz import common_timezones from pytz import all_timezones from pytz import timezone 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:46:59
|
Revision: 108 http://pymoul.svn.sourceforge.net/pymoul/?rev=108&view=rev Author: tiran Date: 2007-01-31 06:46:54 -0800 (Wed, 31 Jan 2007) Log Message: ----------- propset fix Modified Paths: -------------- pymoul/trunk/INSTALL.txt pymoul/trunk/compileui.py pymoul/trunk/setup.py pymoul/trunk/setup_win32.py Property Changed: ---------------- pymoul/trunk/AUTHORS.txt pymoul/trunk/GPL.txt pymoul/trunk/INSTALL.txt pymoul/trunk/README.txt pymoul/trunk/compileui.py pymoul/trunk/contrib/build_exe.py pymoul/trunk/distutils_iss.py pymoul/trunk/distutils_upx.py pymoul/trunk/doc/TODO.txt pymoul/trunk/ez_setup.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/crypt/__init__.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/moulqt_rc.py pymoul/trunk/src/moul/time/__init__.py pymoul/trunk/src/moul/time/cavern.py pymoul/trunk/src/moul/time/dni.py pymoul/trunk/test.py pymoul/trunk/version.txt Property changes on: pymoul/trunk/AUTHORS.txt ___________________________________________________________________ Name: svn:keywords - Id Revisioni + Id Revision Property changes on: pymoul/trunk/GPL.txt ___________________________________________________________________ Name: svn:keywords - Id Revisioni + Id Revision Modified: pymoul/trunk/INSTALL.txt =================================================================== --- pymoul/trunk/INSTALL.txt 2007-01-31 14:41:17 UTC (rev 107) +++ pymoul/trunk/INSTALL.txt 2007-01-31 14:46:54 UTC (rev 108) @@ -5,7 +5,7 @@ * Python 2.5.x http://www.python.org/ * easy_install http://peak.telecommunity.com/DevCenter/EasyInstall * setuptools (via easy install) - * PyTz (via $ easy_install-2.5 pytz) + * PyTz (via $ easy_install-2.5 -Z pytz) * Qt4 GPL 4.2+ http://www.trolltech.com/developer/downloads/qt/ * PyQt4 4.1.1+ http://www.riverbankcomputing.co.uk/pyqt/ Property changes on: pymoul/trunk/INSTALL.txt ___________________________________________________________________ Name: svn:keywords - Id Revisioni + Id Revision Property changes on: pymoul/trunk/README.txt ___________________________________________________________________ Name: svn:keywords - Id Revisioni + Id Revision Modified: pymoul/trunk/compileui.py =================================================================== --- pymoul/trunk/compileui.py 2007-01-31 14:41:17 UTC (rev 107) +++ pymoul/trunk/compileui.py 2007-01-31 14:46:54 UTC (rev 108) @@ -3,7 +3,7 @@ """ __author__ = "Christian Heimes" __version__ = "$Id$" -__revision__ = "$Revision: 45 $" +__revision__ = "$Revision$" import os import re Property changes on: pymoul/trunk/compileui.py ___________________________________________________________________ Name: svn:keywords - Id Revisioni + Id Revision Name: eol-style - native Name: svn:executable + * Property changes on: pymoul/trunk/contrib/build_exe.py ___________________________________________________________________ Name: eol-style - native Property changes on: pymoul/trunk/distutils_iss.py ___________________________________________________________________ Name: svn:keywords - Id Revisioni + Id Revision Property changes on: pymoul/trunk/distutils_upx.py ___________________________________________________________________ Name: svn:keywords - Id Revisioni + Id Revision Property changes on: pymoul/trunk/doc/TODO.txt ___________________________________________________________________ Name: svn:keywords + Id Revision Property changes on: pymoul/trunk/ez_setup.py ___________________________________________________________________ Name: svn:keywords - Id Revisioni + Id Revision Name: eol-style - native Modified: pymoul/trunk/setup.py =================================================================== --- pymoul/trunk/setup.py 2007-01-31 14:41:17 UTC (rev 107) +++ pymoul/trunk/setup.py 2007-01-31 14:46:54 UTC (rev 108) @@ -5,7 +5,7 @@ """ __author__ = "Christian Heimes" __version__ = "$Id$" -__revision__ = "$Revision: 58 $" +__revision__ = "$Revision$" import sys import os @@ -57,7 +57,7 @@ setup_options = dict( setup_requires = ["setuptools>="+SETUPTOOLS_VERSION,], - install_requires = [], + install_requires = ["pytz>=2006p",], data_files = [ ('docs', list(glob('*.txt'))), ('i18', list(glob('src/moul/qt/i18n/pymoul_*.*'))), Property changes on: pymoul/trunk/setup.py ___________________________________________________________________ Name: svn:keywords - Id Revisioni + Id Revision Name: eol-style - native Modified: pymoul/trunk/setup_win32.py =================================================================== --- pymoul/trunk/setup_win32.py 2007-01-31 14:41:17 UTC (rev 107) +++ pymoul/trunk/setup_win32.py 2007-01-31 14:46:54 UTC (rev 108) @@ -2,7 +2,7 @@ """ __author__ = "Christian Heimes" __version__ = "$Id$" -__revision__ = "$Revision: 86 $" +__revision__ = "$Revision$" import os import sys Property changes on: pymoul/trunk/setup_win32.py ___________________________________________________________________ Name: svn:keywords - Id Revisioni + Id Revision Name: 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/crypt/__init__.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/moulqt_rc.py ___________________________________________________________________ Name: eol-style - native Property changes on: pymoul/trunk/src/moul/time/__init__.py ___________________________________________________________________ Name: eol-style - native Property changes on: pymoul/trunk/src/moul/time/cavern.py ___________________________________________________________________ Name: eol-style - native Property changes on: pymoul/trunk/src/moul/time/dni.py ___________________________________________________________________ Name: eol-style - native Property changes on: pymoul/trunk/test.py ___________________________________________________________________ Name: svn:keywords - Id Revisioni + Id Revision Property changes on: pymoul/trunk/version.txt ___________________________________________________________________ Name: svn:keywords - Id Revisioni + Id Revision 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-01-31 03:00:54
|
Revision: 106 http://pymoul.svn.sourceforge.net/pymoul/?rev=106&view=rev Author: tiran Date: 2007-01-30 19:00:50 -0800 (Tue, 30 Jan 2007) Log Message: ----------- minor windows build tweaks Modified Paths: -------------- pymoul/trunk/build.bat pymoul/trunk/setup_win32.py Added Paths: ----------- pymoul/trunk/installer.bat Modified: pymoul/trunk/build.bat =================================================================== --- pymoul/trunk/build.bat 2007-01-31 02:59:33 UTC (rev 105) +++ pymoul/trunk/build.bat 2007-01-31 03:00:50 UTC (rev 106) @@ -1,4 +1,6 @@ @echo off rd /S /Q build +cls +set PYTHONPATH=src python setup.py py2exe -pause \ No newline at end of file +pause Added: pymoul/trunk/installer.bat =================================================================== --- pymoul/trunk/installer.bat (rev 0) +++ pymoul/trunk/installer.bat 2007-01-31 03:00:50 UTC (rev 106) @@ -0,0 +1,7 @@ +@echo off +rd /S /Q build +cls +set PYTHONPATH=src +set INNOSETUP=yes +python setup.py py2exe +pause Modified: pymoul/trunk/setup_win32.py =================================================================== --- pymoul/trunk/setup_win32.py 2007-01-31 02:59:33 UTC (rev 105) +++ pymoul/trunk/setup_win32.py 2007-01-31 03:00:50 UTC (rev 106) @@ -20,24 +20,27 @@ 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 import_win32com(): + """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 # PyTz uses some import magic def findPyTz(): + import pytz packages = ['pytz.zoneinfo'] for tz in ('GMT', 'UTC'): packages.append('pytz.zoneinfo.%s' % tz) @@ -45,7 +48,6 @@ for tz in ('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') @@ -68,11 +70,13 @@ 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.*'] # SSL currently not in use but imported by socket - pexe['excludes'] = ['_ssl', 'win32pipe', 'win32evtlog', 'win32file', 'win32api'] - # added by logging.handlers.SMTPHandler but not yet required - pexe['excludes'].append('smtplib') + # mail stuff added by logging.handlers.SMTPHandler + pexe['excludes'] = ['_ssl', 'doctest', 'smtplib', 'email'] + # no need for win32 so far + pexe['excludes'].extend(['win32pipe', 'win32evtlog', 'win32file', 'win32api', + 'win32con', 'winerror']) # UPX pexe['upx'] = True pexe['upx_args'] = '--mono --best' This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ti...@us...> - 2007-01-31 02:59:58
|
Revision: 105 http://pymoul.svn.sourceforge.net/pymoul/?rev=105&view=rev Author: tiran Date: 2007-01-30 18:59:33 -0800 (Tue, 30 Jan 2007) Log Message: ----------- Added todo and coding text Added Paths: ----------- pymoul/trunk/doc/CODING.txt pymoul/trunk/doc/TODO.txt Added: pymoul/trunk/doc/CODING.txt =================================================================== --- pymoul/trunk/doc/CODING.txt (rev 0) +++ pymoul/trunk/doc/CODING.txt 2007-01-31 02:59:33 UTC (rev 105) @@ -0,0 +1,102 @@ +====== +epydoc +====== + +epydoc fields +============= + +http://epydoc.sourceforge.net/fields.html + +Functions and Methods (function or method docstrings) +----------------------------------------------------- +@param p: ... A description of the parameter p for a function or method. +@type p: ... The expected type for the parameter p. +@return: ... The return value for a function or method. +@rtype: ... The type of the return value for a function or method. +@keyword p: ... A description of the keyword parameter p. +@raise e: ... A description of the circumstances under which a function or + method raises exception e. + +Variables (module or class docstrings) +-------------------------------------- +@ivar v: ... A description of the class instance variable v. +@cvar v: ... A description of the static class variable v. +@var v: ... A description of the module variable v. +@type v: ... The type of the variable v. + +Properties (property docstrings) +-------------------------------- +@type: ... The type of the property. + +Grouping and Sorting (module, class, function, or method docstrings) +-------------------------------------------------------------------- +@group g: c1,...,cn Organizes a set of related children +@sort: c1,...,cn Specifies the sort order for the children of a module or class + +Related Topics +-------------- +@see: ... A description of a related topic. + +Notes and Warnings +------------------ +@note: ... A note about an object. +@attention: ... An important note about an object. +@bug: ... A description of a bug in an object. +@warning: ... A warning about an object. + +Status +------ +@version: ... The current version of an object. +@todo [ver]: ... A planned change to an object. +@deprecated: ... Indicates that an object is deprecated. +@since: ... The date or version when an object was first introduced. +@status: ... The current status of an object. +@change: ... A change log entry for this object. + +Formal Conditions +----------------- +@requires: ... A requirement for using an object. +@precondition: ... A condition that must be true before an object is used. +@postcondition: ... A condition that is guaranteed to be true after an object is used. +@invariant: ... A condition which should always be true for an object. + +Bibliographic Information +@author: ... The author(s) of an object. +@organiation: ... The organization that created or maintains an object. +@copyright: ... The copyright information for an object. +@license: ... The licensing information for an object. +@contact: ... Contact information for the author or maintainer. + +Summarization +------------- +@summary: ... A summary description for an object. This description overrides the + default summary. + +New field +--------- +@newfield tag: label [, plural] +@newfield qtslot: Qt slot, Qt slots +@newfield qtsignal: emits Qt signal, emit Qt signals + + +epytext markup language +======================= + +http://epydoc.sourceforge.net/epytext.html + +* literal: :: +* I{...}: Italicized text. +* B{...}: Bold-faced text. +* C{...}: Source code or a Python identifier. +* M{...}: A mathematical expression. +* U{http://www.example.org/}: URL +* U{Example<http://www.example.og/>}: URL +* L{object dotted name}: Cross reference +* L{text<dottedname>}: Cross reference +* X{index term}: index +* S{symbol}: http://epydoc.sourceforge.net/api/epydoc.markup.epytext-module.html#SYMBOLS +* E{}: escape, E{lb}E{rb} for {} +* G{classtree classes...} +* G{packagetree modules...} +* G{impotgraph modules...} +* G{callgraph functions...} Added: pymoul/trunk/doc/TODO.txt =================================================================== --- pymoul/trunk/doc/TODO.txt (rev 0) +++ pymoul/trunk/doc/TODO.txt 2007-01-31 02:59:33 UTC (rev 105) @@ -0,0 +1,14 @@ +========== +To Do list +========== + +version 0.1 +----------- + + * get official OK from Chogon + * API for create Uru Live directory with config files with default values. + * integrate log zipper + * integrate chat archiver + * complete chatlog viewer + * more checks and exceptions! Never fail silentely + * update readme.txt This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ti...@us...> - 2007-01-31 00:22:36
|
Revision: 104 http://pymoul.svn.sourceforge.net/pymoul/?rev=104&view=rev Author: tiran Date: 2007-01-30 16:22:36 -0800 (Tue, 30 Jan 2007) Log Message: ----------- Fixed mixed small errors and typos on Windows Modified Paths: -------------- pymoul/trunk/distutils_iss.py pymoul/trunk/src/moul/osdependent/processinfo.py pymoul/trunk/template.iss Modified: pymoul/trunk/distutils_iss.py =================================================================== --- pymoul/trunk/distutils_iss.py 2007-01-30 20:23:14 UTC (rev 103) +++ pymoul/trunk/distutils_iss.py 2007-01-31 00:22:36 UTC (rev 104) @@ -348,7 +348,7 @@ dist_dir - internal windows_exe_files - internal lib_files - internal - isscript=None - path to IS script output file + inno_script=None - path to IS script output file templates = None - list of template file names or single file version = "1.0" - version string interpolation - dict with additional %()s interpolation items @@ -491,7 +491,7 @@ def compile(self): import ctypes res = ctypes.windll.shell32.ShellExecuteA(0, "compile", - self.isscript, + self.inno_script, None, None, 0) Modified: pymoul/trunk/src/moul/osdependent/processinfo.py =================================================================== --- pymoul/trunk/src/moul/osdependent/processinfo.py 2007-01-30 20:23:14 UTC (rev 103) +++ pymoul/trunk/src/moul/osdependent/processinfo.py 2007-01-31 00:22:36 UTC (rev 104) @@ -184,7 +184,7 @@ hModule = c_ulong() count = c_ulong() modname = c_buffer(51) - mapping = [] + mapping = {} for pid in self.getPids(): # Get handle to the process based on PID hProcess = KERNEL.OpenProcess(PROCESS_FLAGS, False, pid) Modified: pymoul/trunk/template.iss =================================================================== --- pymoul/trunk/template.iss 2007-01-30 20:23:14 UTC (rev 103) +++ pymoul/trunk/template.iss 2007-01-31 00:22:36 UTC (rev 104) @@ -10,10 +10,10 @@ AppUpdatesURL=http://sourceforge.net/projects/pymoul/ DefaultDirName={pf}\%(appname)s DefaultGroupName=%(appname)s -LicenseFile=GPL.txt -InfoBeforeFile=README.txt -;InfoAfterFile=c:\Programme\Inno Setup 5\license.txt -OutputDir=dist\ +LicenseFile=docs\GPL.txt +;InfoBeforeFile=docs\README.txt +InfoAfterFile=docs\README.txt +OutputDir=installer\ OutputBaseFilename=setup_%(appnamestripped)s_%(version)s Compression=lzma SolidCompression=yes @@ -34,7 +34,7 @@ Name: "{group}\%(appname)s"; Filename: "{app}\%(appexe)s" Name: "{group}\{cm:ProgramOnTheWeb,%(appname)s}"; Filename: "http://pymoul.sourceforge.net/" Name: "{group}\{cm:UninstallProgram,%(appname)s}"; Filename: "{uninstallexe}" -Name: "{userappdata}\Microsoft\Internet Explorer\Quick Launch\%(appname)s"; Filename: "{app}\%(appexe)"; Tasks: quicklaunchicon +Name: "{userappdata}\Microsoft\Internet Explorer\Quick Launch\%(appname)s"; Filename: "{app}\%(appexe)s"; Tasks: quicklaunchicon [Run] -Filename: "{app}%(appexe)s"; Description: "{cm:LaunchProgram,My Program}"; Flags: nowait postinstall skipifsilent +Filename: "{app}\%(appexe)s"; Description: "{cm:LaunchProgram,My Program}"; Flags: nowait postinstall skipifsilent This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ti...@us...> - 2007-01-30 20:23:32
|
Revision: 103 http://pymoul.svn.sourceforge.net/pymoul/?rev=103&view=rev Author: tiran Date: 2007-01-30 12:23:14 -0800 (Tue, 30 Jan 2007) Log Message: ----------- Added README and GPL.txt to metadata.py for Qt4 UI Added license tab to ui Modified Paths: -------------- pymoul/trunk/Makefile.in pymoul/trunk/setup.py pymoul/trunk/src/moul/metadata.py pymoul/trunk/src/moul/qt/mainwindow.py pymoul/trunk/src/moul/qt/ui/mainwindow.py pymoul/trunk/src/moul/qt/ui/mainwindow.ui Modified: pymoul/trunk/Makefile.in =================================================================== --- pymoul/trunk/Makefile.in 2007-01-30 16:43:51 UTC (rev 102) +++ pymoul/trunk/Makefile.in 2007-01-30 20:23:14 UTC (rev 103) @@ -17,7 +17,7 @@ inplace: PYTHONPATH="src" $(PYTHON) setup.py $(SETUPFLAGS) build_ext -i -build: compileui +build: ui PYTHONPATH="src" $(PYTHON) setup.py $(SETUPFLAGS) build py2exe: @@ -29,13 +29,13 @@ bdist_egg: PYTHONPATH="src" $(PYTHON) setup.py $(SETUPFLAGS) bdist_egg -run: compileui +run: ui PYTHONPATH="src" $(PYTHON) src/moul/qt/moulqt.py -exerun: compileui py2exe +exerun: ui py2exe dist/moulqt.exe -compileui: +ui: $(PYTHON) compileui.py test_build: build compileui @@ -74,7 +74,7 @@ fixlineendings: $(FINDPY) | xargs recode -f ibmpc..latin1 -updatelangs: +languages: for L in $(LANGS); do \ pylupdate4 `$(FINDQT)` -ts src/moul/qt/i18n/pymoul_$${L}.ts;\ lrelease src/moul/qt/i18n/pymoul_$${L}.ts; \ @@ -84,5 +84,4 @@ cd dist && $(FINDHASH) | xargs md5sum >md5.txt cd dist && $(FINDHASH) | xargs sha1sum >sha1.txt cd dist && $(FINDHASH) | xargs gpg --detach-sign -a - Modified: pymoul/trunk/setup.py =================================================================== --- pymoul/trunk/setup.py 2007-01-30 16:43:51 UTC (rev 102) +++ pymoul/trunk/setup.py 2007-01-30 20:23:14 UTC (rev 103) @@ -82,6 +82,8 @@ 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() ### Modified: pymoul/trunk/src/moul/metadata.py =================================================================== --- pymoul/trunk/src/moul/metadata.py 2007-01-30 16:43:51 UTC (rev 102) +++ pymoul/trunk/src/moul/metadata.py 2007-01-30 20:23:14 UTC (rev 103) @@ -14,3 +14,346 @@ TODO: Long description of pyMoul ''' name = '''pyMoul''' + +README = '''''' + +LICENSE = ''' 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 + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + 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 +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + 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 +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + <one line to give the program's name and a brief idea of what it does.> + Copyright (C) 19yy <name of author> + + 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., 675 Mass Ave, Cambridge, MA 02139, USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) 19yy name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + <signature of Ty Coon>, 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License. +''' Modified: pymoul/trunk/src/moul/qt/mainwindow.py =================================================================== --- pymoul/trunk/src/moul/qt/mainwindow.py 2007-01-30 16:43:51 UTC (rev 102) +++ pymoul/trunk/src/moul/qt/mainwindow.py 2007-01-30 20:23:14 UTC (rev 103) @@ -44,6 +44,7 @@ from moul.server.ping import ServerList from moul.server.ping import isSocketError from moul.time.cavern import CavernTime +from moul import metadata LOG = getLogger('moul.qt') @@ -81,8 +82,9 @@ self._audio_init() self._ping_init() self._systray_init() + self._about_init() + self._documents_init() self.tab_sub_journals.setEnabled(False) - self._documents_init() # run checker self._moulrunning = None @@ -168,7 +170,11 @@ # ************************************************************************ # graphics settings - + def _about_init(self): + self.te_license.setPlainText(metadata.LICENSE) + + # ************************************************************************ + # graphics settings def _graphics_init(self): """ init graphics tab Modified: pymoul/trunk/src/moul/qt/ui/mainwindow.py =================================================================== --- pymoul/trunk/src/moul/qt/ui/mainwindow.py 2007-01-30 16:43:51 UTC (rev 102) +++ pymoul/trunk/src/moul/qt/ui/mainwindow.py 2007-01-30 20:23:14 UTC (rev 103) @@ -2,7 +2,7 @@ # Form implementation generated from reading ui file 'src/moul/qt/ui/mainwindow.ui' # -# Created: Tue Jan 30 17:23:46 2007 +# Created: Tue Jan 30 21:05:11 2007 # by: PyQt4 UI code generator 4.1.1 # # WARNING! All changes made in this file will be lost! @@ -13,33 +13,151 @@ class Ui_MainWindow(object): def setupUi(self, MainWindow): MainWindow.setObjectName("MainWindow") - MainWindow.resize(QtCore.QSize(QtCore.QRect(0,0,492,595).size()).expandedTo(MainWindow.minimumSizeHint())) - MainWindow.setMinimumSize(QtCore.QSize(492,595)) - MainWindow.setMaximumSize(QtCore.QSize(492,595)) + MainWindow.setMinimumSize(QtCore.QSize(472,595)) + MainWindow.setMaximumSize(QtCore.QSize(472,595)) MainWindow.setWindowIcon(QtGui.QIcon(":/resources/uru_icon_32x32.png")) self.centralwidget = QtGui.QWidget(MainWindow) self.centralwidget.setObjectName("centralwidget") + self.horizontalLayout_3 = QtGui.QWidget(self.centralwidget) + self.horizontalLayout_3.setGeometry(QtCore.QRect(70,70,301,31)) + self.horizontalLayout_3.setObjectName("horizontalLayout_3") + + self.hboxlayout = QtGui.QHBoxLayout(self.horizontalLayout_3) + self.hboxlayout.setMargin(0) + self.hboxlayout.setSpacing(6) + self.hboxlayout.setObjectName("hboxlayout") + + self.comboBox = QtGui.QComboBox(self.horizontalLayout_3) + self.comboBox.setEnabled(False) + + font = QtGui.QFont(self.comboBox.font()) + font.setPointSize(6) + self.comboBox.setFont(font) + self.comboBox.setObjectName("comboBox") + self.hboxlayout.addWidget(self.comboBox) + + self.main_buttonbox = QtGui.QDialogButtonBox(self.centralwidget) + self.main_buttonbox.setGeometry(QtCore.QRect(10,540,451,32)) + self.main_buttonbox.setOrientation(QtCore.Qt.Horizontal) + self.main_buttonbox.setStandardButtons(QtGui.QDialogButtonBox.Close|QtGui.QDialogButtonBox.NoButton|QtGui.QDialogButtonBox.Reset|QtGui.QDialogButtonBox.Save) + self.main_buttonbox.setObjectName("main_buttonbox") + + self.horizontalLayout = QtGui.QWidget(self.centralwidget) + self.horizontalLayout.setGeometry(QtCore.QRect(0,2,471,71)) + self.horizontalLayout.setObjectName("horizontalLayout") + + self.hboxlayout1 = QtGui.QHBoxLayout(self.horizontalLayout) + self.hboxlayout1.setMargin(0) + self.hboxlayout1.setSpacing(6) + self.hboxlayout1.setObjectName("hboxlayout1") + + spacerItem = QtGui.QSpacerItem(40,20,QtGui.QSizePolicy.Expanding,QtGui.QSizePolicy.Minimum) + self.hboxlayout1.addItem(spacerItem) + + self.lb_top_image = QtGui.QLabel(self.horizontalLayout) + self.lb_top_image.setMinimumSize(QtCore.QSize(434,61)) + self.lb_top_image.setMaximumSize(QtCore.QSize(434,61)) + self.lb_top_image.setFrameShape(QtGui.QFrame.StyledPanel) + self.lb_top_image.setFrameShadow(QtGui.QFrame.Sunken) + self.lb_top_image.setObjectName("lb_top_image") + self.hboxlayout1.addWidget(self.lb_top_image) + + spacerItem1 = QtGui.QSpacerItem(40,20,QtGui.QSizePolicy.Expanding,QtGui.QSizePolicy.Minimum) + self.hboxlayout1.addItem(spacerItem1) + self.tabwidget = QtGui.QTabWidget(self.centralwidget) - self.tabwidget.setGeometry(QtCore.QRect(0,100,491,434)) + self.tabwidget.setGeometry(QtCore.QRect(0,100,471,434)) self.tabwidget.setTabPosition(QtGui.QTabWidget.North) self.tabwidget.setObjectName("tabwidget") self.tab_tasks = QtGui.QWidget() self.tab_tasks.setObjectName("tab_tasks") - self.groupBox_3 = QtGui.QGroupBox(self.tab_tasks) - self.groupBox_3.setGeometry(QtCore.QRect(10,240,471,161)) - self.groupBox_3.setObjectName("groupBox_3") + self.groupBox = QtGui.QGroupBox(self.tab_tasks) + self.groupBox.setGeometry(QtCore.QRect(10,0,451,121)) + self.groupBox.setObjectName("groupBox") + self.buttonBox = QtGui.QDialogButtonBox(self.groupBox) + self.buttonBox.setGeometry(QtCore.QRect(160,30,110,28)) + self.buttonBox.setOrientation(QtCore.Qt.Horizontal) + self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.NoButton) + self.buttonBox.setObjectName("buttonBox") + + self.widget = QtGui.QWidget(self.groupBox) + self.widget.setGeometry(QtCore.QRect(11,21,431,86)) + self.widget.setObjectName("widget") + + self.gridlayout = QtGui.QGridLayout(self.widget) + self.gridlayout.setMargin(0) + self.gridlayout.setSpacing(6) + self.gridlayout.setObjectName("gridlayout") + + self.lb_log_archive = QtGui.QLabel(self.widget) + self.lb_log_archive.setTextFormat(QtCore.Qt.PlainText) + self.lb_log_archive.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignVCenter) + self.lb_log_archive.setWordWrap(True) + self.lb_log_archive.setTextInteractionFlags(QtCore.Qt.NoTextInteraction) + self.lb_log_archive.setObjectName("lb_log_archive") + self.gridlayout.addWidget(self.lb_log_archive,0,1,1,1) + + self.lb_log_remove = QtGui.QLabel(self.widget) + self.lb_log_remove.setObjectName("lb_log_remove") + self.gridlayout.addWidget(self.lb_log_remove,1,1,1,1) + + self.pb_log_remove = QtGui.QPushButton(self.widget) + self.pb_log_remove.setMinimumSize(QtCore.QSize(60,0)) + self.pb_log_remove.setObjectName("pb_log_remove") + self.gridlayout.addWidget(self.pb_log_remove,1,0,1,1) + + self.pb_log_archive = QtGui.QPushButton(self.widget) + self.pb_log_archive.setMinimumSize(QtCore.QSize(60,0)) + self.pb_log_archive.setObjectName("pb_log_archive") + self.gridlayout.addWidget(self.pb_log_archive,0,0,1,1) + + spacerItem2 = QtGui.QSpacerItem(40,20,QtGui.QSizePolicy.Expanding,QtGui.QSizePolicy.Minimum) + self.gridlayout.addItem(spacerItem2,0,2,1,1) + + self.vboxlayout = QtGui.QVBoxLayout() + self.vboxlayout.setMargin(0) + self.vboxlayout.setSpacing(6) + self.vboxlayout.setObjectName("vboxlayout") + + self.radio_ziplogs = QtGui.QRadioButton(self.widget) + self.radio_ziplogs.setChecked(True) + self.radio_ziplogs.setObjectName("radio_ziplogs") + self.vboxlayout.addWidget(self.radio_ziplogs) + + self.radio_deletelogs = QtGui.QRadioButton(self.widget) + self.radio_deletelogs.setObjectName("radio_deletelogs") + self.vboxlayout.addWidget(self.radio_deletelogs) + self.gridlayout.addLayout(self.vboxlayout,0,3,1,1) + self.groupBox_2 = QtGui.QGroupBox(self.tab_tasks) - self.groupBox_2.setGeometry(QtCore.QRect(10,110,471,131)) + self.groupBox_2.setGeometry(QtCore.QRect(10,120,451,61)) self.groupBox_2.setObjectName("groupBox_2") - self.groupBox = QtGui.QGroupBox(self.tab_tasks) - self.groupBox.setGeometry(QtCore.QRect(10,0,471,111)) - self.groupBox.setObjectName("groupBox") + self.widget1 = QtGui.QWidget(self.groupBox_2) + self.widget1.setGeometry(QtCore.QRect(10,20,431,30)) + self.widget1.setObjectName("widget1") + + self.hboxlayout2 = QtGui.QHBoxLayout(self.widget1) + self.hboxlayout2.setMargin(0) + self.hboxlayout2.setSpacing(6) + self.hboxlayout2.setObjectName("hboxlayout2") + + self.pb_kiimage_repair = QtGui.QPushButton(self.widget1) + self.pb_kiimage_repair.setMinimumSize(QtCore.QSize(60,0)) + self.pb_kiimage_repair.setObjectName("pb_kiimage_repair") + self.hboxlayout2.addWidget(self.pb_kiimage_repair) + + self.pb_kiimage_repair1 = QtGui.QLabel(self.widget1) + self.pb_kiimage_repair1.setObjectName("pb_kiimage_repair1") + self.hboxlayout2.addWidget(self.pb_kiimage_repair1) + + spacerItem3 = QtGui.QSpacerItem(40,20,QtGui.QSizePolicy.Expanding,QtGui.QSizePolicy.Minimum) + self.hboxlayout2.addItem(spacerItem3) self.tabwidget.addTab(self.tab_tasks,"") self.tab_settings = QtGui.QWidget() @@ -53,13 +171,13 @@ self.tab_graphics.setObjectName("tab_graphics") self.horizontalLayout_4 = QtGui.QWidget(self.tab_graphics) - self.horizontalLayout_4.setGeometry(QtCore.QRect(10,10,471,81)) + self.horizontalLayout_4.setGeometry(QtCore.QRect(10,10,451,81)) self.horizontalLayout_4.setObjectName("horizontalLayout_4") - self.hboxlayout = QtGui.QHBoxLayout(self.horizontalLayout_4) - self.hboxlayout.setMargin(0) - self.hboxlayout.setSpacing(6) - self.hboxlayout.setObjectName("hboxlayout") + self.hboxlayout3 = QtGui.QHBoxLayout(self.horizontalLayout_4) + self.hboxlayout3.setMargin(0) + self.hboxlayout3.setSpacing(6) + self.hboxlayout3.setObjectName("hboxlayout3") self.groupBox_screenres = QtGui.QGroupBox(self.horizontalLayout_4) @@ -74,10 +192,10 @@ self.verticalLayout_46.setGeometry(QtCore.QRect(20,20,181,54)) self.verticalLayout_46.setObjectName("verticalLayout_46") - self.vboxlayout = QtGui.QVBoxLayout(self.verticalLayout_46) - self.vboxlayout.setMargin(0) - self.vboxlayout.setSpacing(6) - self.vboxlayout.setObjectName("vboxlayout") + self.vboxlayout1 = QtGui.QVBoxLayout(self.verticalLayout_46) + self.vboxlayout1.setMargin(0) + self.vboxlayout1.setSpacing(6) + self.vboxlayout1.setObjectName("vboxlayout1") self.sl_gra_screenres = QtGui.QSlider(self.verticalLayout_46) self.sl_gra_screenres.setMaximum(10) @@ -88,69 +206,69 @@ self.sl_gra_screenres.setTickPosition(QtGui.QSlider.TicksBelow) self.sl_gra_screenres.setTickInterval(1) self.sl_gra_screenres.setObjectName("sl_gra_screenres") - self.vboxlayout.addWidget(self.sl_gra_screenres) + self.vboxlayout1.addWidget(self.sl_gra_screenres) self.lb_screenres = QtGui.QLabel(self.verticalLayout_46) self.lb_screenres.setAlignment(QtCore.Qt.AlignCenter) self.lb_screenres.setObjectName("lb_screenres") - self.vboxlayout.addWidget(self.lb_screenres) - self.hboxlayout.addWidget(self.groupBox_screenres) + self.vboxlayout1.addWidget(self.lb_screenres) + self.hboxlayout3.addWidget(self.groupBox_screenres) self.groupBox_gra_checkboxes = QtGui.QGroupBox(self.horizontalLayout_4) self.groupBox_gra_checkboxes.setEnabled(True) self.groupBox_gra_checkboxes.setObjectName("groupBox_gra_checkboxes") self.verticalLayout_28 = QtGui.QWidget(self.groupBox_gra_checkboxes) - self.verticalLayout_28.setGeometry(QtCore.QRect(10,10,201,61)) + self.verticalLayout_28.setGeometry(QtCore.QRect(10,10,191,61)) self.verticalLayout_28.setObjectName("verticalLayout_28") - self.vboxlayout1 = QtGui.QVBoxLayout(self.verticalLayout_28) - self.vboxlayout1.setMargin(0) - self.vboxlayout1.setSpacing(6) - self.vboxlayout1.setObjectName("vboxlayout1") + self.vboxlayout2 = QtGui.QVBoxLayout(self.verticalLayout_28) + self.vboxlayout2.setMargin(0) + self.vboxlayout2.setSpacing(6) + self.vboxlayout2.setObjectName("vboxlayout2") - self.hboxlayout1 = QtGui.QHBoxLayout() - self.hboxlayout1.setMargin(0) - self.hboxlayout1.setSpacing(6) - self.hboxlayout1.setObjectName("hboxlayout1") + self.hboxlayout4 = QtGui.QHBoxLayout() + self.hboxlayout4.setMargin(0) + self.hboxlayout4.setSpacing(6) + self.hboxlayout4.setObjectName("hboxlayout4") self.cb_gra_windowed = QtGui.QCheckBox(self.verticalLayout_28) self.cb_gra_windowed.setObjectName("cb_gra_windowed") - self.hboxlayout1.addWidget(self.cb_gra_windowed) + self.hboxlayout4.addWidget(self.cb_gra_windowed) self.cb_gra_vsync = QtGui.QCheckBox(self.verticalLayout_28) self.cb_gra_vsync.setObjectName("cb_gra_vsync") - self.hboxlayout1.addWidget(self.cb_gra_vsync) - self.vboxlayout1.addLayout(self.hboxlayout1) + self.hboxlayout4.addWidget(self.cb_gra_vsync) + self.vboxlayout2.addLayout(self.hboxlayout4) self.cb_gra_shadow = QtGui.QCheckBox(self.verticalLayout_28) self.cb_gra_shadow.setObjectName("cb_gra_shadow") - self.vboxlayout1.addWidget(self.cb_gra_shadow) - self.hboxlayout.addWidget(self.groupBox_gra_checkboxes) + self.vboxlayout2.addWidget(self.cb_gra_shadow) + self.hboxlayout3.addWidget(self.groupBox_gra_checkboxes) self.groupBox_gra_quality = QtGui.QGroupBox(self.tab_graphics) self.groupBox_gra_quality.setEnabled(True) - self.groupBox_gra_quality.setGeometry(QtCore.QRect(10,90,471,281)) + self.groupBox_gra_quality.setGeometry(QtCore.QRect(10,90,451,281)) self.groupBox_gra_quality.setObjectName("groupBox_gra_quality") self.verticalLayout_47 = QtGui.QWidget(self.groupBox_gra_quality) self.verticalLayout_47.setGeometry(QtCore.QRect(20,20,201,251)) self.verticalLayout_47.setObjectName("verticalLayout_47") - self.vboxlayout2 = QtGui.QVBoxLayout(self.verticalLayout_47) - self.vboxlayout2.setMargin(0) - self.vboxlayout2.setSpacing(6) - self.vboxlayout2.setObjectName("vboxlayout2") - - self.vboxlayout3 = QtGui.QVBoxLayout() + self.vboxlayout3 = QtGui.QVBoxLayout(self.verticalLayout_47) self.vboxlayout3.setMargin(0) self.vboxlayout3.setSpacing(6) self.vboxlayout3.setObjectName("vboxlayout3") + self.vboxlayout4 = QtGui.QVBoxLayout() + self.vboxlayout4.setMargin(0) + self.vboxlayout4.setSpacing(6) + self.vboxlayout4.setObjectName("vboxlayout4") + self.lb_gra_quality = QtGui.QLabel(self.verticalLayout_47) self.lb_gra_quality.setAlignment(QtCore.Qt.AlignCenter) self.lb_gra_quality.setObjectName("lb_gra_quality") - self.vboxlayout3.addWidget(self.lb_gra_quality) + self.vboxlayout4.addWidget(self.lb_gra_quality) self.sl_gra_quality = QtGui.QSlider(self.verticalLayout_47) self.sl_gra_quality.setMinimum(0) @@ -163,43 +281,43 @@ self.sl_gra_quality.setTickPosition(QtGui.QSlider.TicksBelow) self.sl_gra_quality.setTickInterval(1) self.sl_gra_quality.setObjectName("sl_gra_quality") - self.vboxlayout3.addWidget(self.sl_gra_quality) + self.vboxlayout4.addWidget(self.sl_gra_quality) - self.hboxlayout2 = QtGui.QHBoxLayout() - self.hboxlayout2.setMargin(0) - self.hboxlayout2.setSpacing(6) - self.hboxlayout2.setObjectName("hboxlayout2") + self.hboxlayout5 = QtGui.QHBoxLayout() + self.hboxlayout5.setMargin(0) + self.hboxlayout5.setSpacing(6) + self.hboxlayout5.setObjectName("hboxlayout5") self.lb_gra_quality_low = QtGui.QLabel(self.verticalLayout_47) self.lb_gra_quality_low.setObjectName("lb_gra_quality_low") - self.hboxlayout2.addWidget(self.lb_gra_quality_low) + self.hboxlayout5.addWidget(self.lb_gra_quality_low) self.lb_gra_quality_medium = QtGui.QLabel(self.verticalLayout_47) self.lb_gra_quality_medium.setAlignment(QtCore.Qt.AlignCenter) self.lb_gra_quality_medium.setObjectName("lb_gra_quality_medium") - self.hboxlayout2.addWidget(self.lb_gra_quality_medium) + self.hboxlayout5.addWidget(self.lb_gra_quality_medium) self.lb_gra_quality_high = QtGui.QLabel(self.verticalLayout_47) self.lb_gra_quality_high.setAlignment(QtCore.Qt.AlignCenter) self.lb_gra_quality_high.setObjectName("lb_gra_quality_high") - self.hboxlayout2.addWidget(self.lb_gra_quality_high) + self.hboxlayout5.addWidget(self.lb_gra_quality_high) self.lb_gra_quality_ultra = QtGui.QLabel(self.verticalLayout_47) self.lb_gra_quality_ultra.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter) self.lb_gra_quality_ultra.setObjectName("lb_gra_quality_ultra") - self.hboxlayout2.addWidget(self.lb_gra_quality_ultra) - self.vboxlayout3.addLayout(self.hboxlayout2) - self.vboxlayout2.addLayout(self.vboxlayout3) + self.hboxlayout5.addWidget(self.lb_gra_quality_ultra) + self.vboxlayout4.addLayout(self.hboxlayout5) + self.vboxlayout3.addLayout(self.vboxlayout4) - self.vboxlayout4 = QtGui.QVBoxLayout() - self.vboxlayout4.setMargin(0) - self.vboxlayout4.setSpacing(6) - self.vboxlayout4.setObjectName("vboxlayout4") + self.vboxlayout5 = QtGui.QVBoxLayout() + self.vboxlayout5.setMargin(0) + self.vboxlayout5.setSpacing(6) + self.vboxlayout5.setObjectName("vboxlayout5") self.lb_gra_aa = QtGui.QLabel(self.verticalLayout_47) self.lb_gra_aa.setAlignment(QtCore.Qt.AlignCenter) self.lb_gra_aa.setObjectName("lb_gra_aa") - self.vboxlayout4.addWidget(self.lb_gra_aa) + self.vboxlayout5.addWidget(self.lb_gra_aa) self.sl_gra_antialias = QtGui.QSlider(self.verticalLayout_47) self.sl_gra_antialias.setMinimum(0) @@ -213,33 +331,33 @@ self.sl_gra_antialias.setTickPosition(QtGui.QSlider.TicksBelow) self.sl_gra_antialias.setTickInterval(2) self.sl_gra_antialias.setObjectName("sl_gra_antialias") - self.vboxlayout4.addWidget(self.sl_gra_antialias) + self.vboxlayout5.addWidget(self.sl_gra_antialias) - self.hboxlayout3 = QtGui.QHBoxLayout() - self.hboxlayout3.setMargin(0) - self.hboxlayout3.setSpacing(6) - self.hboxlayout3.setObjectName("hboxlayout3") + self.hboxlayout6 = QtGui.QHBoxLayout() + self.hboxlayout6.setMargin(0) + self.hboxlayout6.setSpacing(6) + self.hboxlayout6.setObjectName("hboxlayout6") self.lb_gra_aa_low = QtGui.QLabel(self.verticalLayout_47) self.lb_gra_aa_low.setObjectName("lb_gra_aa_low") - self.hboxlayout3.addWidget(self.lb_gra_aa_low) + self.hboxlayout6.addWidget(self.lb_gra_aa_low) self.lb_gra_aa_low1 = QtGui.QLabel(self.verticalLayout_47) self.lb_gra_aa_low1.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter) self.lb_gra_aa_low1.setObjectName("lb_gra_aa_low1") - self.hboxlayout3.addWidget(self.lb_gra_aa_low1) - self.vboxlayout4.addLayout(self.hboxlayout3) - self.vboxlayout2.addLayout(self.vboxlayout4) + self.hboxlayout6.addWidget(self.lb_gra_aa_low1) + self.vboxlayout5.addLayout(self.hboxlayout6) + self.vboxlayout3.addLayout(self.vboxlayout5) - self.vboxlayout5 = QtGui.QVBoxLayout() - self.vboxlayout5.setMargin(0) - self.vboxlayout5.setSpacing(6) - self.vboxlayout5.setObjectName("vboxlayout5") + self.vboxlayout6 = QtGui.QVBoxLayout() + self.vboxlayout6.setMargin(0) + self.vboxlayout6.setSpacing(6) + self.vboxlayout6.setObjectName("vboxlayout6") self.lb_gra_sq = QtGui.QLabel(self.verticalLayout_47) self.lb_gra_sq.setAlignment(QtCore.Qt.AlignCenter) self.lb_gra_sq.setObjectName("lb_gra_sq") - self.vboxlayout5.addWidget(self.lb_gra_sq) + self.vboxlayout6.addWidget(self.lb_gra_sq) self.sl_gra_shadow = QtGui.QSlider(self.verticalLayout_47) self.sl_gra_shadow.setMinimum(0) @@ -252,42 +370,42 @@ self.sl_gra_shadow.setTickPosition(QtGui.QSlider.TicksBelow) self.sl_gra_shadow.setTickInterval(25) self.sl_gra_shadow.setObjectName("sl_gra_shadow") - self.vboxlayout5.addWidget(self.sl_gra_shadow) + self.vboxlayout6.addWidget(self.sl_gra_shadow) - self.hboxlayout4 = QtGui.QHBoxLayout() - self.hboxlayout4.setMargin(0) - self.hboxlayout4.setSpacing(6) - self.hboxlayout4.setObjectName("hboxlayout4") + self.hboxlayout7 = QtGui.QHBoxLayout() + self.hboxlayout7.setMargin(0) + self.hboxlayout7.setSpacing(6) + self.hboxlayout7.setObjectName("hboxlayout7") self.lb_gra_sq_low = QtGui.QLabel(self.verticalLayout_47) self.lb_gra_sq_low.setObjectName("lb_gra_sq_low") - self.hboxlayout4.addWidget(self.lb_gra_sq_low) + self.hboxlayout7.addWidget(self.lb_gra_sq_low) self.lb_gra_sq_high = QtGui.QLabel(self.verticalLayout_47) self.lb_gra_sq_high.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter) self.lb_gra_sq_high.setObjectName("lb_gra_sq_high") - self.hboxlayout4.addWidget(self.lb_gra_sq_high) - self.vboxlayout5.addLayout(self.hboxlayout4) - self.vboxlayout2.addLayout(self.vboxlayout5) + self.hboxlayout7.addWidget(self.lb_gra_sq_high) + self.vboxlayout6.addLayout(self.hboxlayout7) + self.vboxlayout3.addLayout(self.vboxlayout6) self.verticalLayout_48 = QtGui.QWidget(self.groupBox_gra_quality) - self.verticalLayout_48.setGeometry(QtCore.QRect(250,20,201,166)) + self.verticalLayout_48.setGeometry(QtCore.QRect(240,20,201,166)) self.verticalLayout_48.setObjectName("verticalLayout_48") - self.vboxlayout6 = QtGui.QVBoxLayout(self.verticalLayout_48) - self.vboxlayout6.setMargin(0) - self.vboxlayout6.setSpacing(6) - self.vboxlayout6.setObjectName("vboxlayout6") - - self.vboxlayout7 = QtGui.QVBoxLayout() + self.vboxlayout7 = QtGui.QVBoxLayout(self.verticalLayout_48) self.vboxlayout7.setMargin(0) self.vboxlayout7.setSpacing(6) self.vboxlayout7.setObjectName("vboxlayout7") + self.vboxlayout8 = QtGui.QVBoxLayout() + self.vboxlayout8.setMargin(0) + self.vboxlayout8.setSpacing(6) + self.vboxlayout8.setObjectName("vboxlayout8") + self.lb_gra_tq = QtGui.QLabel(self.verticalLayout_48) self.lb_gra_tq.setAlignment(QtCore.Qt.AlignCenter) self.lb_gra_tq.setObjectName("lb_gra_tq") - self.vboxlayout7.addWidget(self.lb_gra_tq) + self.vboxlayout8.addWidget(self.lb_gra_tq) self.sl_gra_texture = QtGui.QSlider(self.verticalLayout_48) self.sl_gra_texture.setMinimum(0) @@ -300,33 +418,33 @@ self.sl_gra_texture.setTickPosition(QtGui.QSlider.TicksBelow) self.sl_gra_texture.setTickInterval(1) self.sl_gra_texture.setObjectName("sl_gra_texture") - self.vboxlayout7.addWidget(self.sl_gra_texture) + self.vboxlayout8.addWidget(self.sl_gra_texture) - self.hboxlayout5 = QtGui.QHBoxLayout() - self.hboxlayout5.setMargin(0) - self.hboxlayout5.setSpacing(6) - self.hboxlayout5.setObjectName("hboxlayout5") + self.hboxlayout8 = QtGui.QHBoxLayout() + self.hboxlayout8.setMargin(0) + self.hboxlayout8.setSpacing(6) + self.hboxlayout8.setObjectName("hboxlayout8") self.lb_gra_tq_low = QtGui.QLabel(self.verticalLayout_48) self.lb_gra_tq_low.setObjectName("lb_gra_tq_low") - self.hboxlayout5.addWidget(self.lb_gra_tq_low) + self.hboxlayout8.addWidget(self.lb_gra_tq_low) self.lb_gra_tq_high = QtGui.QLabel(self.verticalLayout_48) self.lb_gra_tq_high.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter) self.lb_gra_tq_high.setObjectName("lb_gra_tq_high") - self.hboxlayout5.addWidget(self.lb_gra_tq_high) - self.vboxlayout7.addLayout(self.hboxlayout5) - self.vboxlayout6.addLayout(self.vboxlayout7) + self.hboxlayout8.addWidget(self.lb_gra_tq_high) + self.vboxlayout8.addLayout(self.hboxlayout8) + self.vboxlayout7.addLayout(self.vboxlayout8) - self.vboxlayout8 = QtGui.QVBoxLayout() - self.vboxlayout8.setMargin(0) - self.vboxlayout8.setSpacing(6) - self.vboxlayout8.setObjectName("vboxlayout8") + self.vboxlayout9 = QtGui.QVBoxLayout() + self.vboxlayout9.setMargin(0) + self.vboxlayout9.setSpacing(6) + self.vboxlayout9.setObjectName("vboxlayout9") self.lb_gra_af = QtGui.QLabel(self.verticalLayout_48) self.lb_gra_af.setAlignment(QtCore.Qt.AlignCenter) self.lb_gra_af.setObjectName("lb_gra_af") - self.vboxlayout8.addWidget(self.lb_gra_af) + self.vboxlayout9.addWidget(self.lb_gra_af) self.sl_gra_anisotropic = QtGui.QSlider(self.verticalLayout_48) self.sl_gra_anisotropic.setMinimum(1) @@ -339,156 +457,117 @@ self.sl_gra_anisotropic.setTickPosition(QtGui.QSlider.TicksBelow) self.sl_gra_anisotropic.setTickInterval(5) self.sl_gra_anisotropic.setObjectName("sl_gra_anisotropic") - self.vboxlayout8.addWidget(self.sl_gra_anisotropic) + self.vboxlayout9.addWidget(self.sl_gra_anisotropic) - self.hboxlayout6 = QtGui.QHBoxLayout() - self.hboxlayout6.setMargin(0) - self.hboxlayout6.setSpacing(6) - self.hboxlayout6.setObjectName("hboxlayout6") + self.hboxlayout9 = QtGui.QHBoxLayout() + self.hboxlayout9.setMargin(0) + self.hboxlayout9.setSpacing(6) + self.hboxlayout9.setObjectName("hboxlayout9") self.lb_gra_af_low = QtGui.QLabel(self.verticalLayout_48) self.lb_gra_af_low.setObjectName("lb_gra_af_low") - self.hboxlayout6.addWidget(self.lb_gra_af_low) + self.hboxlayout9.addWidget(self.lb_gra_af_low) self.lb_gra_af_high = QtGui.QLabel(self.verticalLayout_48) self.lb_gra_af_high.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter) self.lb_gra_af_high.setObjectName("lb_gra_af_high") - self.hboxlayout6.addWidget(self.lb_gra_af_high) - self.vboxlayout8.addLayout(self.hboxlayout6) - self.vboxlayout6.addLayout(self.vboxlayout8) + self.hboxlayout9.addWidget(self.lb_gra_af_high) + self.vboxlayout9.addLayout(self.hboxlayout9) + self.vboxlayout7.addLayout(self.vboxlayout9) self.tab_sub_settings.addTab(self.tab_graphics,"") self.tab_audio = QtGui.QWidget() self.tab_audio.setObjectName("tab_audio") - self.groupBox_aud_hardware = QtGui.QGroupBox(self.tab_audio) - self.groupBox_aud_hardware.setEnabled(True) - self.groupBox_aud_hardware.setGeometry(QtCore.QRect(10,260,471,111)) - self.groupBox_aud_hardware.setObjectName("groupBox_aud_hardware") + self.groupBox_aud_level = QtGui.QGroupBox(self.tab_audio) + self.groupBox_aud_level.setEnabled(True) + self.groupBox_aud_level.setGeometry(QtCore.QRect(10,0,451,171)) + self.groupBox_aud_level.setObjectName("groupBox_aud_level") - self.verticalLayout_61 = QtGui.QWidget(self.groupBox_aud_hardware) - self.verticalLayout_61.setGeometry(QtCore.QRect(20,20,191,75)) - self.verticalLayout_61.setObjectName("verticalLayout_61") + self.layoutWidget = QtGui.QWidget(self.groupBox_aud_level) + self.layoutWidget.setGeometry(QtCore.QRect(20,20,191,112)) + self.layoutWidget.setObjectName("layoutWidget") - self.vboxlayout9 = QtGui.QVBoxLayout(self.verticalLayout_61) - self.vboxlayout9.setMargin(0) - self.vboxlayout9.setSpacing(6) - self.vboxlayout9.setObjectName("vboxlayout9") - - self.lb_aud_device_modes = QtGui.QLabel(self.verticalLayout_61) - self.lb_aud_device_modes.setAlignment(QtCore.Qt.AlignCenter) - self.lb_aud_device_modes.setObjectName("lb_aud_device_modes") - self.vboxlayout9.addWidget(self.lb_aud_device_modes) - - self.lb_aud_device = QtGui.QLabel(self.verticalLayout_61) - self.lb_aud_device.setAlignment(QtCore.Qt.AlignCenter) - self.lb_aud_device.setObjectName("lb_aud_device") - self.vboxlayout9.addWidget(self.lb_aud_device) - - self.sl_aud_device = QtGui.QSlider(self.verticalLayout_61) - self.sl_aud_device.setMaximum(2) - self.sl_aud_device.setPageStep(1) - self.sl_aud_device.setSliderPosition(0) - self.sl_aud_device.setTracking(False) - self.sl_aud_device.setOrientation(QtCore.Qt.Horizontal) - self.sl_aud_device.setTickPosition(QtGui.QSlider.TicksBelow) - self.sl_aud_device.setTickInterval(1) - self.sl_aud_device.setObjectName("sl_aud_device") - self.vboxlayout9.addWidget(self.sl_aud_device) - - self.verticalLayout_60 = QtGui.QWidget(self.groupBox_aud_hardware) - self.verticalLayout_60.setGeometry(QtCore.QRect(250,15,191,79)) - self.verticalLayout_60.setObjectName("verticalLayout_60") - - self.vboxlayout10 = QtGui.QVBoxLayout(self.verticalLayout_60) + self.vboxlayout10 = QtGui.QVBoxLayout(self.layoutWidget) self.vboxlayout10.setMargin(0) self.vboxlayout10.setSpacing(6) self.vboxlayout10.setObjectName("vboxlayout10") - self.cb_aud_eax = QtGui.QCheckBox(self.verticalLayout_60) - self.cb_aud_eax.setObjectName("cb_aud_eax") - self.vboxlayout10.addWidget(self.cb_aud_eax) + self.verticalLayout_57 = QtGui.QWidget(self.layoutWidget) + self.verticalLayout_57.setObjectName("verticalLayout_57") - self.lb_aud_priority_3 = QtGui.QLabel(self.verticalLayout_60) - self.lb_aud_priority_3.setAlignment(QtCore.Qt.AlignCenter) - self.lb_aud_priority_3.setObjectName("lb_aud_priority_3") - self.vboxlayout10.addWidget(self.lb_aud_priority_3) - - self.sl_aud_priority = QtGui.QSlider(self.verticalLayout_60) - self.sl_aud_priority.setMaximum(9) - self.sl_aud_priority.setPageStep(1) - self.sl_aud_priority.setSliderPosition(0) - self.sl_aud_priority.setTracking(False) - self.sl_aud_priority.setOrientation(QtCore.Qt.Horizontal) - self.sl_aud_priority.setTickPosition(QtGui.QSlider.TicksBelow) - self.sl_aud_priority.setTickInterval(3) - self.sl_aud_priority.setObjectName("sl_aud_priority") - self.vboxlayout10.addWidget(self.sl_aud_priority) - - self.groupBox_voicechat = QtGui.QGroupBox(self.tab_audio) - self.groupBox_voicechat.setEnabled(True) - self.groupBox_voicechat.setGeometry(QtCore.QRect(10,170,471,91)) - self.groupBox_voicechat.setObjectName("groupBox_voicechat") - - self.cb_aud_voicechat = QtGui.QCheckBox(self.groupBox_voicechat) - self.cb_aud_voicechat.setGeometry(QtCore.QRect(250,40,171,19)) - self.cb_aud_voicechat.setObjectName("cb_aud_voicechat") - - self.verticalLayout_62 = QtGui.QWidget(self.groupBox_voicechat) - self.verticalLayout_62.setGeometry(QtCore.QRect(20,20,191,54)) - self.verticalLayout_62.setObjectName("verticalLayout_62") - - self.vboxlayout11 = QtGui.QVBoxLayout(self.verticalLayout_62) + self.vboxlayout11 = QtGui.QVBoxLayout(self.verticalLayout_57) self.vboxlayout11.setMargin(0) self.vboxlayout11.setSpacing(6) self.vboxlayout11.setObjectName("vboxlayout11") - self.lb_aud_microphon = QtGui.QLabel(self.verticalLayout_62) - self.lb_aud_microphon.setEnabled(False) - self.lb_aud_microphon.setAlignment(QtCore.Qt.AlignCenter) - self.lb_aud_microphon.setObjectName("lb_aud_microphon") - self.vboxlayout11.addWidget(self.lb_aud_microphon) + self.lb_aud_fx_3 = QtGui.QLabel(self.verticalLayout_57) + self.lb_aud_fx_3.setAlignment(QtCore.Qt.AlignCenter) + self.lb_aud_fx_3.setObjectName("lb_aud_fx_3") + self.vboxlayout11.addWidget(self.lb_aud_fx_3) - self.sl_aud_microphon = QtGui.QSlider(self.verticalLayout_62) - self.sl_aud_microphon.setEnabled(False) - self.sl_aud_microphon.setMinimum(0) - self.sl_aud_microphon.setMaximum(100) - self.sl_aud_microphon.setPageStep(10) - self.sl_aud_microphon.setProperty("value",QtCore.QVariant(0)) - self.sl_aud_microphon.setSliderPosition(0) - self.sl_aud_microphon.setTracking(False) - self.sl_aud_microphon.setOrientation(QtCore.Qt.Horizontal) - self.sl_aud_microphon.setTickPosition(QtGui.QSlider.TicksBelow) - self.sl_aud_microphon.setTickInterval(25) - self.sl_aud_microphon.setObjectName("sl_aud_microphon") - self.vboxlayout11.addWidget(self.sl_aud_microphon) + self.sl_aud_fx = QtGui.QSlider(self.verticalLayout_57) + self.sl_aud_fx.setMinimum(0) + self.sl_aud_fx.setMaximum(100) + self.sl_aud_fx.setPageStep(10) + self.sl_aud_fx.setProperty("value",QtCore.QVariant(0)) + self.sl_aud_fx.setSliderPosition(0) + self.sl_aud_fx.setTracking(False) + self.sl_aud_fx.setOrientation(QtCore.Qt.Horizontal) + self.sl_aud_fx.setTickPosition(QtGui.QSlider.TicksBelow) + self.sl_aud_fx.setTickInterval(25) + self.sl_aud_fx.setObjectName("sl_aud_fx") + self.vboxlayout11.addWidget(self.sl_aud_fx) + self.vboxlayout10.addWidget(self.verticalLayout_57) - self.groupBox_aud_level = QtGui.QGroupBox(self.tab_audio) - self.groupBox_aud_level.setEnabled(True) - self.groupBox_aud_level.setGeometry(QtCore.QRect(10,0,471,171)) - self.groupBox_aud_level.setObjectName("groupBox_aud_level") + self.verticalLayout_59 = QtGui.QWidget(self.layoutWidget) + self.verticalLayout_59.setObjectName("verticalLayout_59") - self.widget = QtGui.QWidget(self.groupBox_aud_level) - self.widget.setGeometry(QtCore.QRect(250,20,191,139)) - self.widget.setObjectName("widget") - - self.vboxlayout12 = QtGui.QVBoxLayout(self.widget) + self.vboxlayout12 = QtGui.QVBoxLayout(self.verticalLayout_59) self.vboxlayout12.setMargin(0) self.vboxlayout12.setSpacing(6) self.vboxlayout12.setObjectName("vboxlayout12") - self.verticalLayout_58 = QtGui.QWidget(self.widget) - self.verticalLayout_58.setObjectName("verticalLayout_58") + self.lb_aud_music = QtGui.QLabel(self.verticalLayout_59) + self.lb_aud_music.setAlignment(QtCore.Qt.AlignCenter) + self.lb_aud_music.setObjectName("lb_aud_music") + self.vboxlayout12.addWidget(self.lb_aud_music) - self.vboxlayout13 = QtGui.QVBoxLayout(self.verticalLayout_58) + self.sl_aud_music = QtGui.QSlider(self.verticalLayout_59) + self.sl_aud_music.setMinimum(0) + self.sl_aud_music.setMaximum(100) + self.sl_aud_music.setPageStep(10) + self.sl_aud_music.setProperty("value",QtCore.QVariant(0)) + self.sl_aud_music.setSliderPosition(0) + self.sl_aud_music.setTracking(False) + self.sl_aud_music.setOrientation(QtCore.Qt.Horizontal) + self.sl_aud_music.setTickPosition(QtGui.QSlider.TicksBelow) + self.sl_aud_music.setTickInterval(25) + self.sl_aud_music.setObjectName("sl_aud_music") + self.vboxlayout12.addWidget(self.sl_aud_music) + self.vboxlayout10.addWidget(self.verticalLayout_59) + + self.layoutWidget1 = QtGui.QWidget(self.groupBox_aud_level) + self.layoutWidget1.setGeometry(QtCore.QRect(240,20,191,139)) + self.layoutWidget1.setObjectName("layoutWidget1") + + self.vboxlayout13 = QtGui.QVBoxLayout(self.layoutWidget1) self.vboxlayout13.setMargin(0) self.vboxlayout13.setSpacing(6) self.vboxlayout13.setObjectName("vboxlayout13") + self.verticalLayout_58 = QtGui.QWidget(self.layoutWidget1) + self.verticalLayout_58.setObjectName("verticalLayout_58") + + self.vboxlayout14 = QtGui.QVBoxLayout(self.verticalLayout_58) + self.vboxlayout14.setMargin(0) + self.vboxlayout14.setSpacing(6) + self.vboxlayout14.setObjectName("vboxlayout14") + self.lb_aud_ambience = QtGui.QLabel(self.verticalLayout_58) self.lb_aud_ambience.setAlignment(QtCore.Qt.AlignCenter) self.lb_aud_ambience.setObjectName("lb_aud_ambience") - self.vboxlayout13.addWidget(self.lb_aud_ambience) + self.vboxlayout14.addWidget(self.lb_aud_ambience) self.sl_aud_ambience = QtGui.QSlider(self.verticalLayout_58) self.sl_aud_ambience.setMinimum(0) @@ -501,21 +580,21 @@ self.sl_aud_ambience.setTickPosition(QtGui.QSlider.TicksBelow) self.sl_aud_ambience.setTickInterval(25) self.sl_aud_ambience.setObjectName("sl_aud_ambience") - self.vboxlayout13.addWidget(self.sl_aud_ambience) - self.vboxlayout12.addWidget(self.verticalLayout_58) + self.vboxlayout14.addWidget(self.sl_aud_ambience) + self.vboxlayout13.addWidget(self.verticalLayout_58) - self.verticalLayout_56 = QtGui.QWidget(self.widget) + self.verticalLayout_56 = QtGui.QWidget(self.layoutWidget1) self.verticalLayout_56.setObjectName("verticalLayout_56") - self.vboxlayout14 = QtGui.QVBoxLayout(self.verticalLayout_56) - self.vboxlayout14.setMargin(0) - self.vboxlayout14.setSpacing(6) - self.vboxlayout14.setObjectName("vboxlayout14") + self.vboxlayout15 = QtGui.QVBoxLayout(self.verticalLayout_56) + self.vboxlayout15.setMargin(0) + self.vboxlayout15.setSpacing(6) + self.vboxlayout15.setObjectName("vboxlayout15") self.lb_aud_npc = QtGui.QLabel(self.verticalLayout_56) self.lb_aud_npc.setAlignment(QtCore.Qt.AlignCenter) self.lb_aud_npc.setObjectName("lb_aud_npc") - self.vboxlayout14.addWidget(self.lb_aud_npc) + self.vboxlayout15.addWidget(self.lb_aud_npc) self.sl_aud_npc = QtGui.QSlider(self.verticalLayout_56) self.sl_aud_npc.setMinimum(0) @@ -528,82 +607,122 @@ self.sl_aud_npc.setTickPosition(QtGui.QSlider.TicksBelow) self.sl_aud_npc.setTickInterval(25) self.sl_aud_npc.setObjectName("sl_aud_npc") - self.vboxlayout14.addWidget(self.sl_aud_npc) - self.vboxlayout12.addWidget(self.verticalLayout_56) + self.vboxlayout15.addWidget(self.sl_aud_npc) + self.vboxlayout13.addWidget(self.verticalLayout_56) - self.cb_aud_mute = QtGui.QCheckBox(self.widge... [truncated message content] |
From: <ti...@us...> - 2007-01-30 16:43:56
|
Revision: 102 http://pymoul.svn.sourceforge.net/pymoul/?rev=102&view=rev Author: tiran Date: 2007-01-30 08:43:51 -0800 (Tue, 30 Jan 2007) Log Message: ----------- Disabled moulcli Added chatview and directoryview Modified Paths: -------------- pymoul/trunk/src/moul/cli/moullauncher.py pymoul/trunk/src/moul/file/chatlog.py pymoul/trunk/src/moul/file/tests/test_plasmalog.py pymoul/trunk/src/moul/qt/ui/mainwindow.py Modified: pymoul/trunk/src/moul/cli/moullauncher.py =================================================================== --- pymoul/trunk/src/moul/cli/moullauncher.py 2007-01-30 14:39:03 UTC (rev 101) +++ pymoul/trunk/src/moul/cli/moullauncher.py 2007-01-30 16:43:51 UTC (rev 102) @@ -102,5 +102,5 @@ ml() if __name__ == '__main__': - main(sys.argv) - + #main(sys.argv) + raise NotImplementedError("Moul Launcher disabled!") Modified: pymoul/trunk/src/moul/file/chatlog.py =================================================================== --- pymoul/trunk/src/moul/file/chatlog.py 2007-01-30 14:39:03 UTC (rev 101) +++ pymoul/trunk/src/moul/file/chatlog.py 2007-01-30 16:43:51 UTC (rev 102) @@ -41,28 +41,40 @@ from moul.log import getLogger +RE_FLAGS = re.LOCALE CHAT_RE = re.compile( r"^\((?P<M>\d{1,2})/(?P<D>\d{1,2})\ " # MM/DD r"(?P<h>\d{1,2}):(?P<m>\d\d{1,2}):(?P<s>\d{1,2})\)" # hh:mm:ss - r"(?P<space>\ {1,2})(?P<msg>.*)$") # text + r"(?P<space>\s{1,2})(?P<msg>.*)$", # text + RE_FLAGS) +CHAT_SIMPLE_RE = re.compile( + r"^\((?P<date>[\d/]*)\ (?P<time>[\d:]*)\)" # (date time) + r"(?P<space>\s{1,2})" # spaces + r"(?P<msg>.*)$", # message + RE_FLAGS) CHATLOG_STARTED = "Chat.log started..." CHATLOG_STOPPED = "...Chat.log stopped." -TEXT_MSGFROM = re.compile( - r"From (?P<user>.*) in (?P<location>.*): (?P<msg>.*)" +TEXT_MSGFROM_RE = re.compile( # From USER in LOCATION: msg + r"From (?P<user>.*) in (?P<location>.*): (?P<msg>.*)", + RE_FLAGS) +TEXT_MSGTO_RE = re.compile( + r"To (?P<user>.*): (?P<msg>.*)", # From USER in LOCATION: msg + RE_FLAGS) +TEXT_ERROR_RE = re.compile( + r"Error: (?P<msg>.*)", # Error: message + RE_FLAGS) +TEXT_RE = re.compile( + r"(?P<user>.*): (?P<msg>.*)", # User: message + RE_FLAGS) +CHATLOG_DATE_FNAME_RE = re.compile( + r"chatlog_(?P<Y>\d{4})(?P<M>\d{2})(?P<D>\d{2})_" # chatlog_YYMMDD_ + r"(?P<ch>\d{2})(?P<cm>\d{2})_(?P<sh>\d{2})(?P<sm>\d{2})\.txt", # hhmm_hhmm.txt + RE_FLAGS ) -TEXT_MSGTO = re.compile( - r"To (?P<user>.*): (?P<msg>.*)" - # From USER in LOCATION: msg - ) -TEXT_ERROR = re.compile( - r"Error: (?P<msg>.*)" - # Error: message - ) -TEXT = re.compile( - r"(?P<user>.*): (?P<msg>.*)" - # User: message - ) +#CHATLOG_FNAME_RE = re.compile( +# r"[cC]hat.*\.log", # chat*.log +# RE_FLAGS) LOG = getLogger('moul.chat') @@ -162,3 +174,95 @@ def __call__(self): self.findLogs() self.moveChatlogs() + +class ChatlogDirectoryView(object): + """A view of a chat log directory + + Lists all chat logs in the directory + """ + def __init__(self, logdir): + self._logdir = logdir + self._logfiles = [] # list of ChatlogViews + + if not os.path.isdir(logdir): + LOG.critical("%s is not a directory" % logdir) + self._findChatlogs() + + def _findChatlogs(self): + """Find chat logs in logdir directory + """ + for name in os.listdir(self._logdir): + fname = os.path.join(self._logdir, name) + if not os.path.isfile(fname): + continue + chatlog = ChatlogView(fname) + if chatlog.date is not None: + self._logfiles.append(chatlog) + + @property + def names(self): + return [clv.name for clv in self] + + def __iter__(self): + return iter(self._logfiles) + +class ChatlogView(object): + """A view of a single chat log file + """ + + def __init__(self, fname): + self._fname = fname + self._name = os.path.basename(fname) + self._opened = False + + self._parsed = None + self._fd = None + self._date = None + + if not os.path.isfile(fname): + LOG.critical("%s is not a file" % fname) + + @property + def name(self): + """Plain file name + """ + return self._name + + @property + def date(self): + """Date + """ + if self._date: + return self._date + mo = CHATLOG_DATE_FNAME_RE.match(self.name) + if not mo: + # urks + return None + d = mo.groupdict() + self._date = d + return d + + def open(self): + """Open fhe file + """ + if not self._opened: + self._fd = open(self._fname, 'r') + self._opened = True + + def close(self): + """Close the file + """ + if self._opened: + self._fd.close() + self._fd = None + self._parsed = None + self._opened = False + + def view(self): + """View the file + + Returns an iterator which iterates over the lines of the file + """ + self.open() + # TODO: add parser, currently simply iterates over the file + return iter(self._fd) Modified: pymoul/trunk/src/moul/file/tests/test_plasmalog.py =================================================================== --- pymoul/trunk/src/moul/file/tests/test_plasmalog.py 2007-01-30 14:39:03 UTC (rev 101) +++ pymoul/trunk/src/moul/file/tests/test_plasmalog.py 2007-01-30 16:43:51 UTC (rev 102) @@ -30,6 +30,8 @@ from moul.file.plasmalog import PlasmalogZipper from moul.file.chatlog import ChatlogMover +from moul.file.chatlog import ChatlogDirectoryView +from moul.file.chatlog import ChatlogView from moul.file.kiimage import KIImageFixer from moul.file.kiimage import KIImage @@ -124,7 +126,17 @@ self.failUnless(c.startswith("chatlog_")) self.failUnless(c.endswith(".txt")) self.failUnlessEqual(len(c), length, c) + + def test_chatlogview(self): + clm = ChatlogMover(self._logdir, self._chatdest) + clm.findLogs() + clm.moveChatlogs() + cdv = ChatlogDirectoryView(self._chatdest) + names = cdv.names + self.failUnlessEqual(len(names), 1, names) + self.failUnless(names[0].startswith("chatlog_")) + def test_kiImageMover(self): kif = KIImageFixer(self._kidir, self._kidest) self.failUnless(os.path.isdir(self._kidest), self._kidest) Modified: pymoul/trunk/src/moul/qt/ui/mainwindow.py =================================================================== --- pymoul/trunk/src/moul/qt/ui/mainwindow.py 2007-01-30 14:39:03 UTC (rev 101) +++ pymoul/trunk/src/moul/qt/ui/mainwindow.py 2007-01-30 16:43:51 UTC (rev 102) @@ -2,7 +2,7 @@ # Form implementation generated from reading ui file 'src/moul/qt/ui/mainwindow.ui' # -# Created: Tue Jan 30 15:36:49 2007 +# Created: Tue Jan 30 17:23:46 2007 # by: PyQt4 UI code generator 4.1.1 # # WARNING! All changes made in this file will be lost! @@ -849,7 +849,7 @@ MainWindow.setStatusBar(self.statusbar) self.retranslateUi(MainWindow) - self.tabwidget.setCurrentIndex(4) + self.tabwidget.setCurrentIndex(0) self.tab_sub_settings.setCurrentIndex(0) self.tabWidget.setCurrentIndex(0) QtCore.QObject.connect(self.main_buttonbox,QtCore.SIGNAL("rejected()"),MainWindow.close) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ti...@us...> - 2007-01-30 14:39:11
|
Revision: 101 http://pymoul.svn.sourceforge.net/pymoul/?rev=101&view=rev Author: tiran Date: 2007-01-30 06:39:03 -0800 (Tue, 30 Jan 2007) Log Message: ----------- Rework of the UI Modified Paths: -------------- pymoul/trunk/src/moul/log.py pymoul/trunk/src/moul/qt/mainwindow.py pymoul/trunk/src/moul/qt/ui/mainwindow.py pymoul/trunk/src/moul/qt/ui/mainwindow.ui Modified: pymoul/trunk/src/moul/log.py =================================================================== --- pymoul/trunk/src/moul/log.py 2007-01-30 01:20:56 UTC (rev 100) +++ pymoul/trunk/src/moul/log.py 2007-01-30 14:39:03 UTC (rev 101) @@ -122,8 +122,8 @@ _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) + #sys.stdout = LoggingStdout(getLogger('stdout').info) + #sys.stderr = LoggingStdout(getLogger('stderr').error) __LOG_SIGNALS__ = not __FROZEN__ def signalLogDecorator(__logger__): Modified: pymoul/trunk/src/moul/qt/mainwindow.py =================================================================== --- pymoul/trunk/src/moul/qt/mainwindow.py 2007-01-30 01:20:56 UTC (rev 100) +++ pymoul/trunk/src/moul/qt/mainwindow.py 2007-01-30 14:39:03 UTC (rev 101) @@ -81,7 +81,7 @@ self._audio_init() self._ping_init() self._systray_init() - self.tab_documents.setEnabled(False) + self.tab_sub_journals.setEnabled(False) self._documents_init() # run checker Modified: pymoul/trunk/src/moul/qt/ui/mainwindow.py =================================================================== --- pymoul/trunk/src/moul/qt/ui/mainwindow.py 2007-01-30 01:20:56 UTC (rev 100) +++ pymoul/trunk/src/moul/qt/ui/mainwindow.py 2007-01-30 14:39:03 UTC (rev 101) @@ -2,7 +2,7 @@ # Form implementation generated from reading ui file 'src/moul/qt/ui/mainwindow.ui' # -# Created: Sun Jan 28 15:25:00 2007 +# Created: Tue Jan 30 15:36:49 2007 # by: PyQt4 UI code generator 4.1.1 # # WARNING! All changes made in this file will be lost! @@ -13,116 +13,73 @@ class Ui_MainWindow(object): def setupUi(self, MainWindow): MainWindow.setObjectName("MainWindow") - MainWindow.setWindowModality(QtCore.Qt.NonModal) - MainWindow.resize(QtCore.QSize(QtCore.QRect(0,0,460,534).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) + MainWindow.resize(QtCore.QSize(QtCore.QRect(0,0,492,595).size()).expandedTo(MainWindow.minimumSizeHint())) + MainWindow.setMinimumSize(QtCore.QSize(492,595)) + MainWindow.setMaximumSize(QtCore.QSize(492,595)) MainWindow.setWindowIcon(QtGui.QIcon(":/resources/uru_icon_32x32.png")) self.centralwidget = QtGui.QWidget(MainWindow) - self.centralwidget.setEnabled(True) self.centralwidget.setObjectName("centralwidget") - self.lb_top_image = QtGui.QLabel(self.centralwidget) - self.lb_top_image.setGeometry(QtCore.QRect(15,10,430,58)) - self.lb_top_image.setFrameShape(QtGui.QFrame.StyledPanel) - self.lb_top_image.setFrameShadow(QtGui.QFrame.Sunken) - self.lb_top_image.setPixmap(QtGui.QPixmap(":/resources/moul_logo.png")) - self.lb_top_image.setObjectName("lb_top_image") + self.tabwidget = QtGui.QTabWidget(self.centralwidget) + self.tabwidget.setGeometry(QtCore.QRect(0,100,491,434)) + self.tabwidget.setTabPosition(QtGui.QTabWidget.North) + self.tabwidget.setObjectName("tabwidget") - self.horizontalLayout = QtGui.QWidget(self.centralwidget) - self.horizontalLayout.setGeometry(QtCore.QRect(60,70,341,31)) - self.horizontalLayout.setObjectName("horizontalLayout") + self.tab_tasks = QtGui.QWidget() + self.tab_tasks.setObjectName("tab_tasks") - self.hboxlayout = QtGui.QHBoxLayout(self.horizontalLayout) - self.hboxlayout.setMargin(0) - self.hboxlayout.setSpacing(6) - self.hboxlayout.setObjectName("hboxlayout") + self.groupBox_3 = QtGui.QGroupBox(self.tab_tasks) + self.groupBox_3.setGeometry(QtCore.QRect(10,240,471,161)) + self.groupBox_3.setObjectName("groupBox_3") - self.comboBox = QtGui.QComboBox(self.horizontalLayout) - self.comboBox.setEnabled(False) + self.groupBox_2 = QtGui.QGroupBox(self.tab_tasks) + self.groupBox_2.setGeometry(QtCore.QRect(10,110,471,131)) + self.groupBox_2.setObjectName("groupBox_2") - font = QtGui.QFont(self.comboBox.font()) - font.setPointSize(6) - self.comboBox.setFont(font) - self.comboBox.setObjectName("comboBox") - self.hboxlayout.addWidget(self.comboBox) + self.groupBox = QtGui.QGroupBox(self.tab_tasks) + self.groupBox.setGeometry(QtCore.QRect(10,0,471,111)) + self.groupBox.setObjectName("groupBox") + self.tabwidget.addTab(self.tab_tasks,"") - self.pushButton = QtGui.QPushButton(self.horizontalLayout) - self.pushButton.setEnabled(False) + self.tab_settings = QtGui.QWidget() + self.tab_settings.setObjectName("tab_settings") - sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Policy(0),QtGui.QSizePolicy.Policy(0)) - sizePolicy.setHorizontalStretch(0) - sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth(self.pushButton.sizePolicy().hasHeightForWidth()) - self.pushButton.setSizePolicy(sizePolicy) - self.pushButton.setMaximumSize(QtCore.QSize(16777215,20)) - self.pushButton.setBaseSize(QtCore.QSize(0,20)) + self.tab_sub_settings = QtGui.QTabWidget(self.tab_settings) + self.tab_sub_settings.setGeometry(QtCore.QRect(0,0,491,411)) + self.tab_sub_settings.setObjectName("tab_sub_settings") - font = QtGui.QFont(self.pushButton.font()) - font.setPointSize(8) - self.pushButton.setFont(font) - self.pushButton.setObjectName("pushButton") - self.hboxlayout.addWidget(self.pushButton) + self.tab_graphics = QtGui.QWidget() + self.tab_graphics.setObjectName("tab_graphics") - self.main_buttonbox = QtGui.QDialogButtonBox(self.centralwidget) - self.main_buttonbox.setGeometry(QtCore.QRect(10,480,441,32)) - self.main_buttonbox.setOrientation(QtCore.Qt.Horizontal) - self.main_buttonbox.setStandardButtons(QtGui.QDialogButtonBox.Close|QtGui.QDialogButtonBox.NoButton|QtGui.QDialogButtonBox.Reset|QtGui.QDialogButtonBox.Save) - self.main_buttonbox.setObjectName("main_buttonbox") + self.horizontalLayout_4 = QtGui.QWidget(self.tab_graphics) + self.horizontalLayout_4.setGeometry(QtCore.QRect(10,10,471,81)) + self.horizontalLayout_4.setObjectName("horizontalLayout_4") - self.tabwidget = QtGui.QTabWidget(self.centralwidget) - self.tabwidget.setGeometry(QtCore.QRect(5,100,450,375)) - self.tabwidget.setTabPosition(QtGui.QTabWidget.North) - self.tabwidget.setObjectName("tabwidget") + self.hboxlayout = QtGui.QHBoxLayout(self.horizontalLayout_4) + self.hboxlayout.setMargin(0) + self.hboxlayout.setSpacing(6) + self.hboxlayout.setObjectName("hboxlayout") - self.tab_graphics = QtGui.QWidget() - self.tab_graphics.setObjectName("tab_graphics") + self.groupBox_screenres = QtGui.QGroupBox(self.horizontalLayout_4) - self.groupBox_gra_checkboxes = QtGui.QGroupBox(self.tab_graphics) - self.groupBox_gra_checkboxes.setEnabled(True) - self.groupBox_gra_checkboxes.setGeometry(QtCore.QRect(240,10,201,71)) - self.groupBox_gra_checkboxes.setObjectName("groupBox_gra_checkboxes") + sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Policy(1),QtGui.QSizePolicy.Policy(1)) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.groupBox_screenres.sizePolicy().hasHeightForWidth()) + self.groupBox_screenres.setSizePolicy(sizePolicy) + self.groupBox_screenres.setObjectName("groupBox_screenres") - self.verticalLayout = QtGui.QWidget(self.groupBox_gra_checkboxes) - self.verticalLayout.setGeometry(QtCore.QRect(10,0,160,71)) - self.verticalLayout.setObjectName("verticalLayout") + self.verticalLayout_46 = QtGui.QWidget(self.groupBox_screenres) + self.verticalLayout_46.setGeometry(QtCore.QRect(20,20,181,54)) + self.verticalLayout_46.setObjectName("verticalLayout_46") - self.vboxlayout = QtGui.QVBoxLayout(self.verticalLayout) + self.vboxlayout = QtGui.QVBoxLayout(self.verticalLayout_46) self.vboxlayout.setMargin(0) self.vboxlayout.setSpacing(6) self.vboxlayout.setObjectName("vboxlayout") - self.cb_gra_windowed = QtGui.QCheckBox(self.verticalLayout) - self.cb_gra_windowed.setObjectName("cb_gra_windowed") - self.vboxlayout.addWidget(self.cb_gra_windowed) - - self.cb_gra_vsync = QtGui.QCheckBox(self.verticalLayout) - self.cb_gra_vsync.setObjectName("cb_gra_vsync") - self.vboxlayout.addWidget(self.cb_gra_vsync) - - self.cb_gra_shadow = QtGui.QCheckBox(self.verticalLayout) - self.cb_gra_shadow.setObjectName("cb_gra_shadow") - self.vboxlayout.addWidget(self.cb_gra_shadow) - - self.groupBox_screenres = QtGui.QGroupBox(self.tab_graphics) - self.groupBox_screenres.setGeometry(QtCore.QRect(10,0,220,81)) - self.groupBox_screenres.setObjectName("groupBox_screenres") - - self.verticalLayout_2 = QtGui.QWidget(self.groupBox_screenres) - self.verticalLayout_2.setGeometry(QtCore.QRect(20,20,181,51)) - self.verticalLayout_2.setObjectName("verticalLayout_2") - - self.vboxlayout1 = QtGui.QVBoxLayout(self.verticalLayout_2) - self.vboxlayout1.setMargin(0) - self.vboxlayout1.setSpacing(6) - self.vboxlayout1.setObjectName("vboxlayout1") - - self.sl_gra_screenres = QtGui.QSlider(self.verticalLayout_2) + self.sl_gra_screenres = QtGui.QSlider(self.verticalLayout_46) self.sl_gra_screenres.setMaximum(10) self.sl_gra_screenres.setPageStep(1) self.sl_gra_screenres.setSliderPosition(0) @@ -131,118 +88,71 @@ self.sl_gra_screenres.setTickPosition(QtGui.QSlider.TicksBelow) self.sl_gra_screenres.setTickInterval(1) self.sl_gra_screenres.setObjectName("sl_gra_screenres") - self.vboxlayout1.addWidget(self.sl_gra_screenres) + self.vboxlayout.addWidget(self.sl_gra_screenres) - self.lb_screenres = QtGui.QLabel(self.verticalLayout_2) + self.lb_screenres = QtGui.QLabel(self.verticalLayout_46) self.lb_screenres.setAlignment(QtCore.Qt.AlignCenter) self.lb_screenres.setObjectName("lb_screenres") - self.vboxlayout1.addWidget(self.lb_screenres) + self.vboxlayout.addWidget(self.lb_screenres) + self.hboxlayout.addWidget(self.groupBox_screenres) - self.groupBox_gra_quality = QtGui.QGroupBox(self.tab_graphics) - self.groupBox_gra_quality.setEnabled(True) - self.groupBox_gra_quality.setGeometry(QtCore.QRect(10,79,430,261)) - self.groupBox_gra_quality.setObjectName("groupBox_gra_quality") + self.groupBox_gra_checkboxes = QtGui.QGroupBox(self.horizontalLayout_4) + self.groupBox_gra_checkboxes.setEnabled(True) + self.groupBox_gra_checkboxes.setObjectName("groupBox_gra_checkboxes") - self.verticalLayout_7 = QtGui.QWidget(self.groupBox_gra_quality) - self.verticalLayout_7.setGeometry(QtCore.QRect(230,20,179,71)) - self.verticalLayout_7.setObjectName("verticalLayout_7") + self.verticalLayout_28 = QtGui.QWidget(self.groupBox_gra_checkboxes) + self.verticalLayout_28.setGeometry(QtCore.QRect(10,10,201,61)) + self.verticalLayout_28.setObjectName("verticalLayout_28") - self.vboxlayout2 = QtGui.QVBoxLayout(self.verticalLayout_7) - self.vboxlayout2.setMargin(0) - self.vboxlayout2.setSpacing(6) - self.vboxlayout2.setObjectName("vboxlayout2") + self.vboxlayout1 = QtGui.QVBoxLayout(self.verticalLayout_28) + self.vboxlayout1.setMargin(0) + self.vboxlayout1.setSpacing(6) + self.vboxlayout1.setObjectName("vboxlayout1") - self.lb_gra_tq = QtGui.QLabel(self.verticalLayout_7) - self.lb_gra_tq.setAlignment(QtCore.Qt.AlignCenter) - self.lb_gra_tq.setObjectName("lb_gra_tq") - self.vboxlayout2.addWidget(self.lb_gra_tq) - - self.sl_gra_texture = QtGui.QSlider(self.verticalLayout_7) - self.sl_gra_texture.setMinimum(0) - self.sl_gra_texture.setMaximum(2) - self.sl_gra_texture.setPageStep(1) - self.sl_gra_texture.setProperty("value",QtCore.QVariant(0)) - self.sl_gra_texture.setSliderPosition(0) - self.sl_gra_texture.setTracking(False) - self.sl_gra_texture.setOrientation(QtCore.Qt.Horizontal) - self.sl_gra_texture.setTickPosition(QtGui.QSlider.TicksBelow) - self.sl_gra_texture.setTickInterval(1) - self.sl_gra_texture.setObjectName("sl_gra_texture") - self.vboxlayout2.addWidget(self.sl_gra_texture) - self.hboxlayout1 = QtGui.QHBoxLayout() self.hboxlayout1.setMargin(0) self.hboxlayout1.setSpacing(6) self.hboxlayout1.setObjectName("hboxlayout1") - self.lb_gra_tq_low = QtGui.QLabel(self.verticalLayout_7) - self.lb_gra_tq_low.setObjectName("lb_gra_tq_low") - self.hboxlayout1.addWidget(self.lb_gra_tq_low) + self.cb_gra_windowed = QtGui.QCheckBox(self.verticalLayout_28) + self.cb_gra_windowed.setObjectName("cb_gra_windowed") + self.hboxlayout1.addWidget(self.cb_gra_windowed) - self.lb_gra_tq_high = QtGui.QLabel(self.verticalLayout_7) - self.lb_gra_tq_high.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter) - self.lb_gra_tq_high.setObjectName("lb_gra_tq_high") - self.hboxlayout1.addWidget(self.lb_gra_tq_high) - self.vboxlayout2.addLayout(self.hboxlayout1) + self.cb_gra_vsync = QtGui.QCheckBox(self.verticalLayout_28) + self.cb_gra_vsync.setObjectName("cb_gra_vsync") + self.hboxlayout1.addWidget(self.cb_gra_vsync) + self.vboxlayout1.addLayout(self.hboxlayout1) - self.verticalLayout_5 = QtGui.QWidget(self.groupBox_gra_quality) - self.verticalLayout_5.setGeometry(QtCore.QRect(20,100,179,71)) - self.verticalLayout_5.setObjectName("verticalLayout_5") + self.cb_gra_shadow = QtGui.QCheckBox(self.verticalLayout_28) + self.cb_gra_shadow.setObjectName("cb_gra_shadow") + self.vboxlayout1.addWidget(self.cb_gra_shadow) + self.hboxlayout.addWidget(self.groupBox_gra_checkboxes) - self.vboxlayout3 = QtGui.QVBoxLayout(self.verticalLayout_5) + self.groupBox_gra_quality = QtGui.QGroupBox(self.tab_graphics) + self.groupBox_gra_quality.setEnabled(True) + self.groupBox_gra_quality.setGeometry(QtCore.QRect(10,90,471,281)) + self.groupBox_gra_quality.setObjectName("groupBox_gra_quality") + + self.verticalLayout_47 = QtGui.QWidget(self.groupBox_gra_quality) + self.verticalLayout_47.setGeometry(QtCore.QRect(20,20,201,251)) + self.verticalLayout_47.setObjectName("verticalLayout_47") + + self.vboxlayout2 = QtGui.QVBoxLayout(self.verticalLayout_47) + self.vboxlayout2.setMargin(0) + self.vboxlayout2.setSpacing(6) + self.vboxlayout2.setObjectName("vboxlayout2") + + self.vboxlayout3 = QtGui.QVBoxLayout() self.vboxlayout3.setMargin(0) self.vboxlayout3.setSpacing(6) self.vboxlayout3.setObjectName("vboxlayout3") - self.lb_gra_aa = QtGui.QLabel(self.verticalLayout_5) - self.lb_gra_aa.setAlignment(QtCore.Qt.AlignCenter) - self.lb_gra_aa.setObjectName("lb_gra_aa") - self.vboxlayout3.addWidget(self.lb_gra_aa) - - self.sl_gra_antialias = QtGui.QSlider(self.verticalLayout_5) - self.sl_gra_antialias.setMinimum(0) - self.sl_gra_antialias.setMaximum(6) - self.sl_gra_antialias.setSingleStep(2) - self.sl_gra_antialias.setPageStep(2) - self.sl_gra_antialias.setProperty("value",QtCore.QVariant(0)) - self.sl_gra_antialias.setSliderPosition(0) - self.sl_gra_antialias.setTracking(False) - self.sl_gra_antialias.setOrientation(QtCore.Qt.Horizontal) - self.sl_gra_antialias.setTickPosition(QtGui.QSlider.TicksBelow) - self.sl_gra_antialias.setTickInterval(2) - self.sl_gra_antialias.setObjectName("sl_gra_antialias") - self.vboxlayout3.addWidget(self.sl_gra_antialias) - - self.hboxlayout2 = QtGui.QHBoxLayout() - self.hboxlayout2.setMargin(0) - self.hboxlayout2.setSpacing(6) - self.hboxlayout2.setObjectName("hboxlayout2") - - self.lb_gra_aa_low = QtGui.QLabel(self.verticalLayout_5) - self.lb_gra_aa_low.setObjectName("lb_gra_aa_low") - self.hboxlayout2.addWidget(self.lb_gra_aa_low) - - self.lb_gra_aa_low1 = QtGui.QLabel(self.verticalLayout_5) - self.lb_gra_aa_low1.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter) - self.lb_gra_aa_low1.setObjectName("lb_gra_aa_low1") - self.hboxlayout2.addWidget(self.lb_gra_aa_low1) - self.vboxlayout3.addLayout(self.hboxlayout2) - - self.verticalLayout_3 = QtGui.QWidget(self.groupBox_gra_quality) - self.verticalLayout_3.setGeometry(QtCore.QRect(20,20,179,71)) - self.verticalLayout_3.setObjectName("verticalLayout_3") - - self.vboxlayout4 = QtGui.QVBoxLayout(self.verticalLayout_3) - self.vboxlayout4.setMargin(0) - self.vboxlayout4.setSpacing(6) - self.vboxlayout4.setObjectName("vboxlayout4") - - self.lb_gra_quality = QtGui.QLabel(self.verticalLayout_3) + self.lb_gra_quality = QtGui.QLabel(self.verticalLayout_47) self.lb_gra_quality.setAlignment(QtCore.Qt.AlignCenter) self.lb_gra_quality.setObjectName("lb_gra_quality") - self.vboxlayout4.addWidget(self.lb_gra_quality) + self.vboxlayout3.addWidget(self.lb_gra_quality) - self.sl_gra_quality = QtGui.QSlider(self.verticalLayout_3) + self.sl_gra_quality = QtGui.QSlider(self.verticalLayout_47) self.sl_gra_quality.setMinimum(0) self.sl_gra_quality.setMaximum(3) self.sl_gra_quality.setPageStep(1) @@ -253,48 +163,85 @@ self.sl_gra_quality.setTickPosition(QtGui.QSlider.TicksBelow) self.sl_gra_quality.setTickInterval(1) self.sl_gra_quality.setObjectName("sl_gra_quality") - self.vboxlayout4.addWidget(self.sl_gra_quality) + self.vboxlayout3.addWidget(self.sl_gra_quality) - self.hboxlayout3 = QtGui.QHBoxLayout() - self.hboxlayout3.setMargin(0) - self.hboxlayout3.setSpacing(6) - self.hboxlayout3.setObjectName("hboxlayout3") + self.hboxlayout2 = QtGui.QHBoxLayout() + self.hboxlayout2.setMargin(0) + self.hboxlayout2.setSpacing(6) + self.hboxlayout2.setObjectName("hboxlayout2") - self.lb_gra_quality_low = QtGui.QLabel(self.verticalLayout_3) + self.lb_gra_quality_low = QtGui.QLabel(self.verticalLayout_47) self.lb_gra_quality_low.setObjectName("lb_gra_quality_low") - self.hboxlayout3.addWidget(self.lb_gra_quality_low) + self.hboxlayout2.addWidget(self.lb_gra_quality_low) - self.lb_gra_quality_medium = QtGui.QLabel(self.verticalLayout_3) + self.lb_gra_quality_medium = QtGui.QLabel(self.verticalLayout_47) self.lb_gra_quality_medium.setAlignment(QtCore.Qt.AlignCenter) self.lb_gra_quality_medium.setObjectName("lb_gra_quality_medium") - self.hboxlayout3.addWidget(self.lb_gra_quality_medium) + self.hboxlayout2.addWidget(self.lb_gra_quality_medium) - self.lb_gra_quality_high = QtGui.QLabel(self.verticalLayout_3) + self.lb_gra_quality_high = QtGui.QLabel(self.verticalLayout_47) self.lb_gra_quality_high.setAlignment(QtCore.Qt.AlignCenter) self.lb_gra_quality_high.setObjectName("lb_gra_quality_high") - self.hboxlayout3.addWidget(self.lb_gra_quality_high) + self.hboxlayout2.addWidget(self.lb_gra_quality_high) - self.lb_gra_quality_ultra = QtGui.QLabel(self.verticalLayout_3) + self.lb_gra_quality_ultra = QtGui.QLabel(self.verticalLayout_47) self.lb_gra_quality_ultra.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter) self.lb_gra_quality_ultra.setObjectName("lb_gra_quality_ultra") - self.hboxlayout3.addWidget(self.lb_gra_quality_ultra) + self.hboxlayout2.addWidget(self.lb_gra_quality_ultra) + self.vboxlayout3.addLayout(self.hboxlayout2) + self.vboxlayout2.addLayout(self.vboxlayout3) + + self.vboxlayout4 = QtGui.QVBoxLayout() + self.vboxlayout4.setMargin(0) + self.vboxlayout4.setSpacing(6) + self.vboxlayout4.setObjectName("vboxlayout4") + + self.lb_gra_aa = QtGui.QLabel(self.verticalLayout_47) + self.lb_gra_aa.setAlignment(QtCore.Qt.AlignCenter) + self.lb_gra_aa.setObjectName("lb_gra_aa") + self.vboxlayout4.addWidget(self.lb_gra_aa) + + self.sl_gra_antialias = QtGui.QSlider(self.verticalLayout_47) + self.sl_gra_antialias.setMinimum(0) + self.sl_gra_antialias.setMaximum(6) + self.sl_gra_antialias.setSingleStep(2) + self.sl_gra_antialias.setPageStep(2) + self.sl_gra_antialias.setProperty("value",QtCore.QVariant(0)) + self.sl_gra_antialias.setSliderPosition(0) + self.sl_gra_antialias.setTracking(False) + self.sl_gra_antialias.setOrientation(QtCore.Qt.Horizontal) + self.sl_gra_antialias.setTickPosition(QtGui.QSlider.TicksBelow) + self.sl_gra_antialias.setTickInterval(2) + self.sl_gra_antialias.setObjectName("sl_gra_antialias") + self.vboxlayout4.addWidget(self.sl_gra_antialias) + + self.hboxlayout3 = QtGui.QHBoxLayout() + self.hboxlayout3.setMargin(0) + self.hboxlayout3.setSpacing(6) + self.hboxlayout3.setObjectName("hboxlayout3") + + self.lb_gra_aa_low = QtGui.QLabel(self.verticalLayout_47) + self.lb_gra_aa_low.setObjectName("lb_gra_aa_low") + self.hboxlayout3.addWidget(self.lb_gra_aa_low) + + self.lb_gra_aa_low1 = QtGui.QLabel(self.verticalLayout_47) + self.lb_gra_aa_low1.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter) + self.lb_gra_aa_low1.setObjectName("lb_gra_aa_low1") + self.hboxlayout3.addWidget(self.lb_gra_aa_low1) self.vboxlayout4.addLayout(self.hboxlayout3) + self.vboxlayout2.addLayout(self.vboxlayout4) - self.verticalLayout_8 = QtGui.QWidget(self.groupBox_gra_quality) - self.verticalLayout_8.setGeometry(QtCore.QRect(20,180,179,71)) - self.verticalLayout_8.setObjectName("verticalLayout_8") - - self.vboxlayout5 = QtGui.QVBoxLayout(self.verticalLayout_8) + self.vboxlayout5 = QtGui.QVBoxLayout() self.vboxlayout5.setMargin(0) self.vboxlayout5.setSpacing(6) self.vboxlayout5.setObjectName("vboxlayout5") - self.lb_gra_sq = QtGui.QLabel(self.verticalLayout_8) + self.lb_gra_sq = QtGui.QLabel(self.verticalLayout_47) self.lb_gra_sq.setAlignment(QtCore.Qt.AlignCenter) self.lb_gra_sq.setObjectName("lb_gra_sq") self.vboxlayout5.addWidget(self.lb_gra_sq) - self.sl_gra_shadow = QtGui.QSlider(self.verticalLayout_8) + self.sl_gra_shadow = QtGui.QSlider(self.verticalLayout_47) self.sl_gra_shadow.setMinimum(0) self.sl_gra_shadow.setMaximum(100) self.sl_gra_shadow.setPageStep(10) @@ -312,31 +259,76 @@ self.hboxlayout4.setSpacing(6) self.hboxlayout4.setObjectName("hboxlayout4") - self.lb_gra_sq_low = QtGui.QLabel(self.verticalLayout_8) + self.lb_gra_sq_low = QtGui.QLabel(self.verticalLayout_47) self.lb_gra_sq_low.setObjectName("lb_gra_sq_low") self.hboxlayout4.addWidget(self.lb_gra_sq_low) - self.lb_gra_sq_high = QtGui.QLabel(self.verticalLayout_8) + self.lb_gra_sq_high = QtGui.QLabel(self.verticalLayout_47) self.lb_gra_sq_high.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter) self.lb_gra_sq_high.setObjectName("lb_gra_sq_high") self.hboxlayout4.addWidget(self.lb_gra_sq_high) self.vboxlayout5.addLayout(self.hboxlayout4) + self.vboxlayout2.addLayout(self.vboxlayout5) - self.verticalLayout_6 = QtGui.QWidget(self.groupBox_gra_quality) - self.verticalLayout_6.setGeometry(QtCore.QRect(230,100,179,73)) - self.verticalLayout_6.setObjectName("verticalLayout_6") + self.verticalLayout_48 = QtGui.QWidget(self.groupBox_gra_quality) + self.verticalLayout_48.setGeometry(QtCore.QRect(250,20,201,166)) + self.verticalLayout_48.setObjectName("verticalLayout_48") - self.vboxlayout6 = QtGui.QVBoxLayout(self.verticalLayout_6) + self.vboxlayout6 = QtGui.QVBoxLayout(self.verticalLayout_48) self.vboxlayout6.setMargin(0) self.vboxlayout6.setSpacing(6) self.vboxlayout6.setObjectName("vboxlayout6") - self.lb_gra_af = QtGui.QLabel(self.verticalLayout_6) + self.vboxlayout7 = QtGui.QVBoxLayout() + self.vboxlayout7.setMargin(0) + self.vboxlayout7.setSpacing(6) + self.vboxlayout7.setObjectName("vboxlayout7") + + self.lb_gra_tq = QtGui.QLabel(self.verticalLayout_48) + self.lb_gra_tq.setAlignment(QtCore.Qt.AlignCenter) + self.lb_gra_tq.setObjectName("lb_gra_tq") + self.vboxlayout7.addWidget(self.lb_gra_tq) + + self.sl_gra_texture = QtGui.QSlider(self.verticalLayout_48) + self.sl_gra_texture.setMinimum(0) + self.sl_gra_texture.setMaximum(2) + self.sl_gra_texture.setPageStep(1) + self.sl_gra_texture.setProperty("value",QtCore.QVariant(0)) + self.sl_gra_texture.setSliderPosition(0) + self.sl_gra_texture.setTracking(False) + self.sl_gra_texture.setOrientation(QtCore.Qt.Horizontal) + self.sl_gra_texture.setTickPosition(QtGui.QSlider.TicksBelow) + self.sl_gra_texture.setTickInterval(1) + self.sl_gra_texture.setObjectName("sl_gra_texture") + self.vboxlayout7.addWidget(self.sl_gra_texture) + + self.hboxlayout5 = QtGui.QHBoxLayout() + self.hboxlayout5.setMargin(0) + self.hboxlayout5.setSpacing(6) + self.hboxlayout5.setObjectName("hboxlayout5") + + self.lb_gra_tq_low = QtGui.QLabel(self.verticalLayout_48) + self.lb_gra_tq_low.setObjectName("lb_gra_tq_low") + self.hboxlayout5.addWidget(self.lb_gra_tq_low) + + self.lb_gra_tq_high = QtGui.QLabel(self.verticalLayout_48) + self.lb_gra_tq_high.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter) + self.lb_gra_tq_high.setObjectName("lb_gra_tq_high") + self.hboxlayout5.addWidget(self.lb_gra_tq_high) + self.vboxlayout7.addLayout(self.hboxlayout5) + self.vboxlayout6.addLayout(self.vboxlayout7) + + self.vboxlayout8 = QtGui.QVBoxLayout() + self.vboxlayout8.setMargin(0) + self.vboxlayout8.setSpacing(6) + self.vboxlayout8.setObjectName("vboxlayout8") + + self.lb_gra_af = QtGui.QLabel(self.verticalLayout_48) self.lb_gra_af.setAlignment(QtCore.Qt.AlignCenter) self.lb_gra_af.setObjectName("lb_gra_af") - self.vboxlayout6.addWidget(self.lb_gra_af) + self.vboxlayout8.addWidget(self.lb_gra_af) - self.sl_gra_anisotropic = QtGui.QSlider(self.verticalLayout_6) + self.sl_gra_anisotropic = QtGui.QSlider(self.verticalLayout_48) self.sl_gra_anisotropic.setMinimum(1) self.sl_gra_anisotropic.setMaximum(16) self.sl_gra_anisotropic.setSingleStep(3) @@ -347,47 +339,185 @@ self.sl_gra_anisotropic.setTickPosition(QtGui.QSlider.TicksBelow) self.sl_gra_anisotropic.setTickInterval(5) self.sl_gra_anisotropic.setObjectName("sl_gra_anisotropic") - self.vboxlayout6.addWidget(self.sl_gra_anisotropic) + self.vboxlayout8.addWidget(self.sl_gra_anisotropic) - self.hboxlayout5 = QtGui.QHBoxLayout() - self.hboxlayout5.setMargin(0) - self.hboxlayout5.setSpacing(6) - self.hboxlayout5.setObjectName("hboxlayout5") + self.hboxlayout6 = QtGui.QHBoxLayout() + self.hboxlayout6.setMargin(0) + self.hboxlayout6.setSpacing(6) + self.hboxlayout6.setObjectName("hboxlayout6") - self.lb_gra_af_low = QtGui.QLabel(self.verticalLayout_6) + self.lb_gra_af_low = QtGui.QLabel(self.verticalLayout_48) self.lb_gra_af_low.setObjectName("lb_gra_af_low") - self.hboxlayout5.addWidget(self.lb_gra_af_low) + self.hboxlayout6.addWidget(self.lb_gra_af_low) - self.lb_gra_af_high = QtGui.QLabel(self.verticalLayout_6) + self.lb_gra_af_high = QtGui.QLabel(self.verticalLayout_48) self.lb_gra_af_high.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter) self.lb_gra_af_high.setObjectName("lb_gra_af_high") - self.hboxlayout5.addWidget(self.lb_gra_af_high) - self.vboxlayout6.addLayout(self.hboxlayout5) - self.tabwidget.addTab(self.tab_graphics,"") + self.hboxlayout6.addWidget(self.lb_gra_af_high) + self.vboxlayout8.addLayout(self.hboxlayout6) + self.vboxlayout6.addLayout(self.vboxlayout8) + self.tab_sub_settings.addTab(self.tab_graphics,"") self.tab_audio = QtGui.QWidget() self.tab_audio.setObjectName("tab_audio") + self.groupBox_aud_hardware = QtGui.QGroupBox(self.tab_audio) + self.groupBox_aud_hardware.setEnabled(True) + self.groupBox_aud_hardware.setGeometry(QtCore.QRect(10,260,471,111)) + self.groupBox_aud_hardware.setObjectName("groupBox_aud_hardware") + + self.verticalLayout_61 = QtGui.QWidget(self.groupBox_aud_hardware) + self.verticalLayout_61.setGeometry(QtCore.QRect(20,20,191,75)) + self.verticalLayout_61.setObjectName("verticalLayout_61") + + self.vboxlayout9 = QtGui.QVBoxLayout(self.verticalLayout_61) + self.vboxlayout9.setMargin(0) + self.vboxlayout9.setSpacing(6) + self.vboxlayout9.setObjectName("vboxlayout9") + + self.lb_aud_device_modes = QtGui.QLabel(self.verticalLayout_61) + self.lb_aud_device_modes.setAlignment(QtCore.Qt.AlignCenter) + self.lb_aud_device_modes.setObjectName("lb_aud_device_modes") + self.vboxlayout9.addWidget(self.lb_aud_device_modes) + + self.lb_aud_device = QtGui.QLabel(self.verticalLayout_61) + self.lb_aud_device.setAlignment(QtCore.Qt.AlignCenter) + self.lb_aud_device.setObjectName("lb_aud_device") + self.vboxlayout9.addWidget(self.lb_aud_device) + + self.sl_aud_device = QtGui.QSlider(self.verticalLayout_61) + self.sl_aud_device.setMaximum(2) + self.sl_aud_device.setPageStep(1) + self.sl_aud_device.setSliderPosition(0) + self.sl_aud_device.setTracking(False) + self.sl_aud_device.setOrientation(QtCore.Qt.Horizontal) + self.sl_aud_device.setTickPosition(QtGui.QSlider.TicksBelow) + self.sl_aud_device.setTickInterval(1) + self.sl_aud_device.setObjectName("sl_aud_device") + self.vboxlayout9.addWidget(self.sl_aud_device) + + self.verticalLayout_60 = QtGui.QWidget(self.groupBox_aud_hardware) + self.verticalLayout_60.setGeometry(QtCore.QRect(250,15,191,79)) + self.verticalLayout_60.setObjectName("verticalLayout_60") + + self.vboxlayout10 = QtGui.QVBoxLayout(self.verticalLayout_60) + self.vboxlayout10.setMargin(0) + self.vboxlayout10.setSpacing(6) + self.vboxlayout10.setObjectName("vboxlayout10") + + self.cb_aud_eax = QtGui.QCheckBox(self.verticalLayout_60) + self.cb_aud_eax.setObjectName("cb_aud_eax") + self.vboxlayout10.addWidget(self.cb_aud_eax) + + self.lb_aud_priority_3 = QtGui.QLabel(self.verticalLayout_60) + self.lb_aud_priority_3.setAlignment(QtCore.Qt.AlignCenter) + self.lb_aud_priority_3.setObjectName("lb_aud_priority_3") + self.vboxlayout10.addWidget(self.lb_aud_priority_3) + + self.sl_aud_priority = QtGui.QSlider(self.verticalLayout_60) + self.sl_aud_priority.setMaximum(9) + self.sl_aud_priority.setPageStep(1) + self.sl_aud_priority.setSliderPosition(0) + self.sl_aud_priority.setTracking(False) + self.sl_aud_priority.setOrientation(QtCore.Qt.Horizontal) + self.sl_aud_priority.setTickPosition(QtGui.QSlider.TicksBelow) + self.sl_aud_priority.setTickInterval(3) + self.sl_aud_priority.setObjectName("sl_aud_priority") + self.vboxlayout10.addWidget(self.sl_aud_priority) + + self.groupBox_voicechat = QtGui.QGroupBox(self.tab_audio) + self.groupBox_voicechat.setEnabled(True) + self.groupBox_voicechat.setGeometry(QtCore.QRect(10,170,471,91)) + self.groupBox_voicechat.setObjectName("groupBox_voicechat") + + self.cb_aud_voicechat = QtGui.QCheckBox(self.groupBox_voicechat) + self.cb_aud_voicechat.setGeometry(QtCore.QRect(250,40,171,19)) + self.cb_aud_voicechat.setObjectName("cb_aud_voicechat") + + self.verticalLayout_62 = QtGui.QWidget(self.groupBox_voicechat) + self.verticalLayout_62.setGeometry(QtCore.QRect(20,20,191,54)) + self.verticalLayout_62.setObjectName("verticalLayout_62") + + self.vboxlayout11 = QtGui.QVBoxLayout(self.verticalLayout_62) + self.vboxlayout11.setMargin(0) + self.vboxlayout11.setSpacing(6) + self.vboxlayout11.setObjectName("vboxlayout11") + + self.lb_aud_microphon = QtGui.QLabel(self.verticalLayout_62) + self.lb_aud_microphon.setEnabled(False) + self.lb_aud_microphon.setAlignment(QtCore.Qt.AlignCenter) + self.lb_aud_microphon.setObjectName("lb_aud_microphon") + self.vboxlayout11.addWidget(self.lb_aud_microphon) + + self.sl_aud_microphon = QtGui.QSlider(self.verticalLayout_62) + self.sl_aud_microphon.setEnabled(False) + self.sl_aud_microphon.setMinimum(0) + self.sl_aud_microphon.setMaximum(100) + self.sl_aud_microphon.setPageStep(10) + self.sl_aud_microphon.setProperty("value",QtCore.QVariant(0)) + self.sl_aud_microphon.setSliderPosition(0) + self.sl_aud_microphon.setTracking(False) + self.sl_aud_microphon.setOrientation(QtCore.Qt.Horizontal) + self.sl_aud_microphon.setTickPosition(QtGui.QSlider.TicksBelow) + self.sl_aud_microphon.setTickInterval(25) + self.sl_aud_microphon.setObjectName("sl_aud_microphon") + self.vboxlayout11.addWidget(self.sl_aud_microphon) + self.groupBox_aud_level = QtGui.QGroupBox(self.tab_audio) self.groupBox_aud_level.setEnabled(True) - self.groupBox_aud_level.setGeometry(QtCore.QRect(10,10,431,141)) + self.groupBox_aud_level.setGeometry(QtCore.QRect(10,0,471,171)) self.groupBox_aud_level.setObjectName("groupBox_aud_level") - self.verticalLayout_12 = QtGui.QWidget(self.groupBox_aud_level) - self.verticalLayout_12.setGeometry(QtCore.QRect(230,80,179,43)) - self.verticalLayout_12.setObjectName("verticalLayout_12") + self.widget = QtGui.QWidget(self.groupBox_aud_level) + self.widget.setGeometry(QtCore.QRect(250,20,191,139)) + self.widget.setObjectName("widget") - self.vboxlayout7 = QtGui.QVBoxLayout(self.verticalLayout_12) - self.vboxlayout7.setMargin(0) - self.vboxlayout7.setSpacing(6) - self.vboxlayout7.setObjectName("vboxlayout7") + self.vboxlayout12 = QtGui.QVBoxLayout(self.widget) + self.vboxlayout12.setMargin(0) + self.vboxlayout12.setSpacing(6) + self.vboxlayout12.setObjectName("vboxlayout12") - self.lb_aud_npc = QtGui.QLabel(self.verticalLayout_12) + self.verticalLayout_58 = QtGui.QWidget(self.widget) + self.verticalLayout_58.setObjectName("verticalLayout_58") + + self.vboxlayout13 = QtGui.QVBoxLayout(self.verticalLayout_58) + self.vboxlayout13.setMargin(0) + self.vboxlayout13.setSpacing(6) + self.vboxlayout13.setObjectName("vboxlayout13") + + self.lb_aud_ambience = QtGui.QLabel(self.verticalLayout_58) + self.lb_aud_ambience.setAlignment(QtCore.Qt.AlignCenter) + self.lb_aud_ambience.setObjectName("lb_aud_ambience") + self.vboxlayout13.addWidget(self.lb_aud_ambience) + + self.sl_aud_ambience = QtGui.QSlider(self.verticalLayout_58) + self.sl_aud_ambience.setMinimum(0) + self.sl_aud_ambience.setMaximum(100) + self.sl_aud_ambience.setPageStep(10) + self.sl_aud_ambience.setProperty("value",QtCore.QVariant(0)) + self.sl_aud_ambience.setSliderPosition(0) + self.sl_aud_ambience.setTracking(False) + self.sl_aud_ambience.setOrientation(QtCore.Qt.Horizontal) + self.sl_aud_ambience.setTickPosition(QtGui.QSlider.TicksBelow) + self.sl_aud_ambience.setTickInterval(25) + self.sl_aud_ambience.setObjectName("sl_aud_ambience") + self.vboxlayout13.addWidget(self.sl_aud_ambience) + self.vboxlayout12.addWidget(self.verticalLayout_58) + + self.verticalLayout_56 = QtGui.QWidget(self.widget) + self.verticalLayout_56.setObjectName("verticalLayout_56") + + self.vboxlayout14 = QtGui.QVBoxLayout(self.verticalLayout_56) + self.vboxlayout14.setMargin(0) + self.vboxlayout14.setSpacing(6) + self.vboxlayout14.setObjectName("vboxlayout14") + + self.lb_aud_npc = QtGui.QLabel(self.verticalLayout_56) self.lb_aud_npc.setAlignment(QtCore.Qt.AlignCenter) self.lb_aud_npc.setObjectName("lb_aud_npc") - self.vboxlayout7.addWidget(self.lb_aud_npc) + self.vboxlayout14.addWidget(self.lb_aud_npc) - self.sl_aud_npc = QtGui.QSlider(self.verticalLayout_12) + self.sl_aud_npc = QtGui.QSlider(self.verticalLayout_56) self.sl_aud_npc.setMinimum(0) self.sl_aud_npc.setMaximum(100) self.sl_aud_npc.setPageStep(10) @@ -398,23 +528,36 @@ self.sl_aud_npc.setTickPosition(QtGui.QSlider.TicksBelow) self.sl_aud_npc.setTickInterval(25) self.sl_aud_npc.setObjectName("sl_aud_npc") - self.vboxlayout7.addWidget(self.sl_aud_npc) + self.vboxlayout14.addWidget(self.sl_aud_npc) + self.vboxlayout12.addWidget(self.verticalLayout_56) - self.verticalLayout_9 = QtGui.QWidget(self.groupBox_aud_level) - self.verticalLayout_9.setGeometry(QtCore.QRect(20,30,179,43)) - self.verticalLayout_9.setObjectName("verticalLayout_9") + self.cb_aud_mute = QtGui.QCheckBox(self.widget) + self.cb_aud_mute.setObjectName("cb_aud_mute") + self.vboxlayout12.addWidget(self.cb_aud_mute) - self.vboxlayout8 = QtGui.QVBoxLayout(self.verticalLayout_9) - self.vboxlayout8.setMargin(0) - self.vboxlayout8.setSpacing(6) - self.vboxlayout8.setObjectName("vboxlayout8") + self.widget1 = QtGui.QWidget(self.groupBox_aud_level) + self.widget1.setGeometry(QtCore.QRect(20,20,191,112)) + self.widget1.setObjectName("widget1") - self.lb_aud_fx = QtGui.QLabel(self.verticalLayout_9) - self.lb_aud_fx.setAlignment(QtCore.Qt.AlignCenter) - self.lb_aud_fx.setObjectName("lb_aud_fx") - self.vboxlayout8.addWidget(self.lb_aud_fx) + self.vboxlayout15 = QtGui.QVBoxLayout(self.widget1) + self.vboxlayout15.setMargin(0) + self.vboxlayout15.setSpacing(6) + self.vboxlayout15.setObjectName("vboxlayout15") - self.sl_aud_fx = QtGui.QSlider(self.verticalLayout_9) + self.verticalLayout_57 = QtGui.QWidget(self.widget1) + self.verticalLayout_57.setObjectName("verticalLayout_57") + + self.vboxlayout16 = QtGui.QVBoxLayout(self.verticalLayout_57) + self.vboxlayout16.setMargin(0) + self.vboxlayout16.setSpacing(6) + self.vboxlayout16.setObjectName("vboxlayout16") + + self.lb_aud_fx_3 = QtGui.QLabel(self.verticalLayout_57) + self.lb_aud_fx_3.setAlignment(QtCore.Qt.AlignCenter) + self.lb_aud_fx_3.setObjectName("lb_aud_fx_3") + self.vboxlayout16.addWidget(self.lb_aud_fx_3) + + self.sl_aud_fx = QtGui.QSlider(self.verticalLayout_57) self.sl_aud_fx.setMinimum(0) self.sl_aud_fx.setMaximum(100) self.sl_aud_fx.setPageStep(10) @@ -425,50 +568,23 @@ self.sl_aud_fx.setTickPosition(QtGui.QSlider.TicksBelow) self.sl_aud_fx.setTickInterval(25) self.sl_aud_fx.setObjectName("sl_aud_fx") - self.vboxlayout8.addWidget(self.sl_aud_fx) + self.vboxlayout16.addWidget(self.sl_aud_fx) + self.vboxlayout15.addWidget(self.verticalLayout_57) - self.verticalLayout_10 = QtGui.QWidget(self.groupBox_aud_level) - self.verticalLayout_10.setGeometry(QtCore.QRect(230,30,179,43)) - self.verticalLayout_10.setObjectName("verticalLayout_10") + self.verticalLayout_59 = QtGui.QWidget(self.widget1) + self.verticalLayout_59.setObjectName("verticalLayout_59") - self.vboxlayout9 = QtGui.QVBoxLayout(self.verticalLayout_10) - self.vboxlayout9.setMargin(0) - self.vboxlayout9.setSpacing(6) - self.vboxlayout9.setObjectName("vboxlayout9") + self.vboxlayout17 = QtGui.QVBoxLayout(self.verticalLayout_59) + self.vboxlayout17.setMargin(0) + self.vboxlayout17.setSpacing(6) + self.vboxlayout17.setObjectName("vboxlayout17") - self.lb_aud_ambience = QtGui.QLabel(self.verticalLayout_10) - self.lb_aud_ambience.setAlignment(QtCore.Qt.AlignCenter) - self.lb_aud_ambience.setObjectName("lb_aud_ambience") - self.vboxlayout9.addWidget(self.lb_aud_ambience) - - self.sl_aud_ambience = QtGui.QSlider(self.verticalLayout_10) - self.sl_aud_ambience.setMinimum(0) - self.sl_aud_ambience.setMaximum(100) - self.sl_aud_ambience.setPageStep(10) - self.sl_aud_ambience.setProperty("value",QtCore.QVariant(0)) - self.sl_aud_ambience.setSliderPosition(0) - self.sl_aud_ambience.setTracking(False) - self.sl_aud_ambience.setOrientation(QtCore.Qt.Horizontal) - self.sl_aud_ambience.setTickPosition(QtGui.QSlider.TicksBelow) - self.sl_aud_ambience.setTickInterval(25) - self.sl_aud_ambience.setObjectName("sl_aud_ambience") - self.vboxlayout9.addWidget(self.sl_aud_ambience) - - self.verticalLayout_11 = QtGui.QWidget(self.groupBox_aud_level) - self.verticalLayout_11.setGeometry(QtCore.QRect(20,80,179,43)) - self.verticalLayout_11.setObjectName("verticalLayout_11") - - self.vboxlayout10 = QtGui.QVBoxLayout(self.verticalLayout_11) - self.vboxlayout10.setMargin(0) - self.vboxlayout10.setSpacing(6) - self.vboxlayout10.setObjectName("vboxlayout10") - - self.lb_aud_music = QtGui.QLabel(self.verticalLayout_11) + self.lb_aud_music = QtGui.QLabel(self.verticalLayout_59) self.lb_aud_music.setAlignment(QtCore.Qt.AlignCenter) self.lb_aud_music.setObjectName("lb_aud_music") - self.vboxlayout10.addWidget(self.lb_aud_music) + self.vboxlayout17.addWidget(self.lb_aud_music) - self.sl_aud_music = QtGui.QSlider(self.verticalLayout_11) + self.sl_aud_music = QtGui.QSlider(self.verticalLayout_59) self.sl_aud_music.setMinimum(0) self.sl_aud_music.setMaximum(100) self.sl_aud_music.setPageStep(10) @@ -479,124 +595,28 @@ self.sl_aud_music.setTickPosition(QtGui.QSlider.TicksBelow) self.sl_aud_music.setTickInterval(25) self.sl_aud_music.setObjectName("sl_aud_music") - self.vboxlayout10.addWidget(self.sl_aud_music) + self.vboxlayout17.addWidget(self.sl_aud_music) + self.vboxlayout15.addWidget(self.verticalLayout_59) + self.tab_sub_settings.addTab(self.tab_audio,"") - self.cb_aud_mute = QtGui.QCheckBox(self.groupBox_aud_level) - self.cb_aud_mute.setGeometry(QtCore.QRect(180,10,70,19)) - self.cb_aud_mute.setObjectName("cb_aud_mute") + self.tab_pymoul = QtGui.QWidget() + self.tab_pymoul.setObjectName("tab_pymoul") - self.groupBox_aud_hardware = QtGui.QGroupBox(self.tab_audio) - self.groupBox_aud_hardware.setEnabled(True) - self.groupBox_aud_hardware.setGeometry(QtCore.QRect(10,230,431,101)) - self.groupBox_aud_hardware.setObjectName("groupBox_aud_hardware") + self.groupBox_4 = QtGui.QGroupBox(self.tab_pymoul) + self.groupBox_4.setGeometry(QtCore.QRect(10,0,471,371)) + self.groupBox_4.setObjectName("groupBox_4") + self.tab_sub_settings.addTab(self.tab_pymoul,"") + self.tabwidget.addTab(self.tab_settings,"") - self.verticalLayout_14 = QtGui.QWidget(self.groupBox_aud_hardware) - self.verticalLayout_14.setGeometry(QtCore.QRect(230,40,179,43)) - self.verticalLayout_14.setObjectName("verticalLayout_14") - - self.vboxlayout11 = QtGui.QVBoxLayout(self.verticalLayout_14) - self.vboxlayout11.setMargin(0) - self.vboxlayout11.setSpacing(6) - self.vboxlayout11.setObjectName("vboxlayout11") - - self.lb_aud_priority = QtGui.QLabel(self.verticalLayout_14) - self.lb_aud_priority.setAlignment(QtCore.Qt.AlignCenter) - self.lb_aud_priority.setObjectName("lb_aud_priority") - self.vboxlayout11.addWidget(self.lb_aud_priority) - - self.sl_aud_priority = QtGui.QSlider(self.verticalLayout_14) - self.sl_aud_priority.setMaximum(9) - self.sl_aud_priority.setPageStep(1) - self.sl_aud_priority.setSliderPosition(0) - self.sl_aud_priority.setTracking(False) - self.sl_aud_priority.setOrientation(QtCore.Qt.Horizontal) - self.sl_aud_priority.setTickPosition(QtGui.QSlider.TicksBelow) - self.sl_aud_priority.setTickInterval(3) - self.sl_aud_priority.setObjectName("sl_aud_priority") - self.vboxlayout11.addWidget(self.sl_aud_priority) - - self.verticalLayout_15 = QtGui.QWidget(self.groupBox_aud_hardware) - self.verticalLayout_15.setGeometry(QtCore.QRect(20,20,179,63)) - self.verticalLayout_15.setObjectName("verticalLayout_15") - - self.vboxlayout12 = QtGui.QVBoxLayout(self.verticalLayout_15) - self.vboxlayout12.setMargin(0) - self.vboxlayout12.setSpacing(6) - self.vboxlayout12.setObjectName("vboxlayout12") - - self.lb_aud_device_modes = QtGui.QLabel(self.verticalLayout_15) - self.lb_aud_device_modes.setAlignment(QtCore.Qt.AlignCenter) - self.lb_aud_device_modes.setObjectName("lb_aud_device_modes") - self.vboxlayout12.addWidget(self.lb_aud_device_modes) - - self.lb_aud_device = QtGui.QLabel(self.verticalLayout_15) - self.lb_aud_device.setAlignment(QtCore.Qt.AlignCenter) - self.lb_aud_device.setObjectName("lb_aud_device") - self.vboxlayout12.addWidget(self.lb_aud_device) - - self.sl_aud_device = QtGui.QSlider(self.verticalLayout_15) - self.sl_aud_device.setMaximum(2) - self.sl_aud_device.setPageStep(1) - self.sl_aud_device.setSliderPosition(0) - self.sl_aud_device.setTracking(False) - self.sl_aud_device.setOrientation(QtCore.Qt.Horizontal) - self.sl_aud_device.setTickPosition(QtGui.QSlider.TicksBelow) - self.sl_aud_device.setTickInterval(1) - self.sl_aud_device.setObjectName("sl_aud_device") - self.vboxlayout12.addWidget(self.sl_aud_device) - - self.cb_aud_eax = QtGui.QCheckBox(self.groupBox_aud_hardware) - self.cb_aud_eax.setGeometry(QtCore.QRect(260,10,111,19)) - self.cb_aud_eax.setObjectName("cb_aud_eax") - - self.groupBox_voicechat = QtGui.QGroupBox(self.tab_audio) - self.groupBox_voicechat.setEnabled(True) - self.groupBox_voicechat.setGeometry(QtCore.QRect(10,150,431,71)) - self.groupBox_voicechat.setObjectName("groupBox_voicechat") - - self.verticalLayout_13 = QtGui.QWidget(self.groupBox_voicechat) - self.verticalLayout_13.setGeometry(QtCore.QRect(20,20,179,43)) - self.verticalLayout_13.setObjectName("verticalLayout_13") - - self.vboxlayout13 = QtGui.QVBoxLayout(self.verticalLayout_13) - self.vboxlayout13.setMargin(0) - self.vboxlayout13.setSpacing(6) - self.vboxlayout13.setObjectName("vboxlayout13") - - self.lb_aud_microphon = QtGui.QLabel(self.verticalLayout_13) - self.lb_aud_microphon.setEnabled(False) - self.lb_aud_microphon.setAlignment(QtCore.Qt.AlignCenter) - self.lb_aud_microphon.setObjectName("lb_aud_microphon") - self.vboxlayout13.addWidget(self.lb_aud_microphon) - - self.sl_aud_microphon = QtGui.QSlider(self.verticalLayout_13) - self.sl_aud_microphon.setEnabled(False) - self.sl_aud_microphon.setMinimum(0) - self.sl_aud_microphon.setMaximum(100) - self.sl_aud_microphon.setPageStep(10) - self.sl_aud_microphon.setProperty("value",QtCore.QVariant(0)) - self.sl_aud_microphon.setSliderPosition(0) - self.sl_aud_microphon.setTracking(False) - self.sl_aud_microphon.setOrientation(QtCore.Qt.Horizontal) - self.sl_aud_microphon.setTickPosition(QtGui.QSlider.TicksBelow) - self.sl_aud_microphon.setTickInterval(25) - self.sl_aud_microphon.setObjectName("sl_aud_microphon") - self.vboxlayout13.addWidget(self.sl_aud_microphon) - - self.cb_aud_voicechat = QtGui.QCheckBox(self.groupBox_voicechat) - self.cb_aud_voicechat.setGeometry(QtCore.QRect(250,30,171,19)) - self.cb_aud_voicechat.setObjectName("cb_aud_voicechat") - 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,10,431,101)) + self.gb_caverntime.setGeometry(QtCore.QRect(10,10,471,101)) self.gb_caverntime.setObjectName("gb_caverntime") self.gridLayout = QtGui.QWidget(self.gb_caverntime) - self.gridLayout.setGeometry(QtCore.QRect(10,20,411,71)) + self.gridLayout.setGeometry(QtCore.QRect(10,20,476,74)) self.gridLayout.setObjectName("gridLayout") self.gridlayout = QtGui.QGridLayout(self.gridLayout) @@ -649,17 +669,9 @@ self.lb_cavern_utc.setObjectName("lb_cavern_utc") self.gridlayout.addWidget(self.lb_cavern_utc,0,2,1,1) - self.label_11 = QtGui.QLabel(self.gridLayout) - self.label_11.setObjectName("label_11") - self.gridlayout.addWidget(self.label_11,0,3,1,1) - - self.label_12 = QtGui.QLabel(self.gridLayout) - self.label_12.setObjectName("label_12") - self.gridlayout.addWidget(self.label_12,1,3,1,1) - self.gb_dnitime = QtGui.QGroupBox(self.tab_time) self.gb_dnitime.setEnabled(False) - self.gb_dnitime.setGeometry(QtCore.QRect(10,120,431,221)) + self.gb_dnitime.setGeometry(QtCore.QRect(10,110,471,291)) self.gb_dnitime.setObjectName("gb_dnitime") self.tabwidget.addTab(self.tab_time,"") @@ -667,30 +679,37 @@ self.tab_ping.setObjectName("tab_ping") self.gb_servers = QtGui.QGroupBox(self.tab_ping) - self.gb_servers.setGeometry(QtCore.QRect(10,0,421,341)) + self.gb_servers.setGeometry(QtCore.QRect(10,0,471,401)) self.gb_servers.setObjectName("gb_servers") self.button_ping = QtGui.QPushButton(self.gb_servers) - self.button_ping.setGeometry(QtCore.QRect(330,310,75,24)) + self.button_ping.setGeometry(QtCore.QRect(380,370,75,24)) self.button_ping.setObjectName("button_ping") self.text_ping = QtGui.QTextEdit(self.gb_servers) - self.text_ping.setGeometry(QtCore.QRect(10,20,401,281)) - self.text_ping.setVerticalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOff) + self.text_ping.setGeometry(QtCore.QRect(10,20,451,341)) + self.text_ping.setVerticalScrollBarPolicy(QtCore.Qt.ScrollBarAsNeeded) self.text_ping.setHorizontalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOff) self.text_ping.setReadOnly(True) self.text_ping.setObjectName("text_ping") self.tabwidget.addTab(self.tab_ping,"") - self.tab_documents = QtGui.QWidget() - self.tab_documents.setObjectName("tab_documents") + self.tab_browse = QtGui.QWidget() + self.tab_browse.setObjectName("tab_browse") - self.gb_documents = QtGui.QGroupBox(self.tab_documents) - self.gb_documents.setGeometry(QtCore.QRect(10,0,431,341)) + self.tabWidget = QtGui.QTabWidget(self.tab_browse) + self.tabWidget.setGeometry(QtCore.QRect(0,0,491,411)) + self.tabWidget.setObjectName("tabWidget") + + self.tab_sub_journals = QtGui.QWidget() + self.tab_sub_journals.setObjectName("tab_sub_journals") + + self.gb_documents = QtGui.QGroupBox(self.tab_sub_journals) + self.gb_documents.setGeometry(QtCore.QRect(10,0,471,371)) 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.setGeometry(QtCore.QRect(30,20,411,108)) self.gridLayout_2.setObjectName("gridLayout_2") self.gridlayout1 = QtGui.QGridLayout(self.gridLayout_2) @@ -738,19 +757,91 @@ 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.setGeometry(QtCore.QRect(10,130,451,231)) self.te_doc_view.setReadOnly(True) self.te_doc_view.setObjectName("te_doc_view") - self.tabwidget.addTab(self.tab_documents,"") + self.tabWidget.addTab(self.tab_sub_journals,"") + self.tab_sub_chatlogs = QtGui.QWidget() + self.tab_sub_chatlogs.setObjectName("tab_sub_chatlogs") + + self.groupBox_5 = QtGui.QGroupBox(self.tab_sub_chatlogs) + self.groupBox_5.setGeometry(QtCore.QRect(10,0,471,371)) + self.groupBox_5.setObjectName("groupBox_5") + + self.cb_chatlog = QtGui.QComboBox(self.groupBox_5) + self.cb_chatlog.setGeometry(QtCore.QRect(80,20,323,22)) + + sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Policy(7),QtGui.QSizePolicy.Policy(0)) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.cb_chatlog.sizePolicy().hasHeightForWidth()) + self.cb_chatlog.setSizePolicy(sizePolicy) + self.cb_chatlog.setObjectName("cb_chatlog") + + self.te_chatlog_view = QtGui.QTextEdit(self.groupBox_5) + self.te_chatlog_view.setGeometry(QtCore.QRect(10,50,451,311)) + self.te_chatlog_view.setReadOnly(True) + self.te_chatlog_view.setObjectName("te_chatlog_view") + self.tabWidget.addTab(self.tab_sub_chatlogs,"") + self.tabwidget.addTab(self.tab_browse,"") + self.tab_about = QtGui.QWidget() self.tab_about.setObjectName("tab_about") self.label_6 = QtGui.QLabel(self.tab_about) - self.label_6.setGeometry(QtCore.QRect(120,170,181,20)) + self.label_6.setGeometry(QtCore.QRect(180,210,181,20)) self.label_6.setAlignment(QtCore.Qt.AlignCenter) self.label_6.setObjectName("label_6") self.tabwidget.addTab(self.tab_about,"") + + self.main_buttonbox = QtGui.QDialogButtonBox(self.centralwidget) + self.main_buttonbox.setGeometry(QtCore.QRect(10,540,471,32)) + self.main_buttonbox.setOrientation(QtCore.Qt.Horizontal) + self.main_buttonbox.setStandardButtons(QtGui.QDialogButtonBox.Close|QtGui.QDialogButtonBox.NoButton|QtGui.QDialogButtonBox.Reset|QtGui.QDialogButtonBox.Save) + self.main_buttonbox.setObjectName("main_buttonbox") + + self.horizontalLayout = QtGui.QWidget(self.centralwidget) + self.horizontalLayout.setGeometry(QtCore.QRect(0,2,491,71)) + self.horizontalLayout.setObjectName("horizontalLayout") + + self.hboxlayout7 = QtGui.QHBoxLayout(self.horizontalLayout) + self.hboxlayout7.setMargin(0) + self.hboxlayout7.setSpacing(6) + self.hboxlayout7.setObjectName("hboxlayout7") + + spacerItem = QtGui.QSpacerItem(40,20,QtGui.QSizePolicy.Expanding,QtGui.QSizePolicy.Minimum) + self.hboxlayout7.addItem(spacerItem) + + self.lb_top_image = QtGui.QLabel(self.horizontalLayout) + self.lb_top_image.setMinimumSize(QtCore.QSize(434,61)) + self.lb_top_image.setMaximumSize(QtCore.QSize(434,61)) + self.lb_top_image.setFrameShape(QtGui.QFrame.StyledPanel) + self.lb_top_image.setFrameShadow(QtGui.QFrame.Sunken) + self.lb_top_image.setPixmap(QtGui.QPixmap(":/resources/moul_logo.png")) + self.lb_top_image.setObjectName("lb_top_image") + self.hboxlayout7.addWidget(self.lb_top_image) + + spacerItem1 = QtGui.QSpacerItem(40,20,QtGui.QSizePolicy.Expanding,QtGui.QSizePolicy.Minimum) + self.hboxlayout7.addItem(spacerItem1) + + self.horizontalLayout_3 = QtGui.QWidget(self.centralwidget) + self.horizontalLayout_3.setGeometry(QtCore.QRect(100,70,301,31)) + self.horizontalLayout_3.setObjectName("horizontalLayout_3") + + self.hboxlayout8 = QtGui.QHBoxLayout(self.horizontalLayout_3) + self.hboxlayout8.setMargin(0) + self.hboxlayout8.setSpacing(6) + self.hboxlayout8.setObjectName("hboxlayout8") + + self.comboBox = QtGui.QComboBox(self.horizontalLayout_3) + self.comboBox.setEnabled(False) + + font = QtGui.QFont(self.comboBox.font()) + font.setPointSize(6) + self.comboBox.setFont(font) + self.comboBox.setObjectName("comboBox") + self.hboxlayout8.addWidget(self.comboBox) MainWindow.setCentralWidget(self.centralwidget) self.statusbar = QtGui.QStatusBar(MainWindow) @@ -758,74 +849,84 @@ MainWindow.setStatusBar(self.statusbar) self.retranslateUi(MainWindow) - self.tabwidget.setCurrentIndex(0) + self.tabwidget.setCurrentIndex(4) + self.tab_sub_settings.setCurrentIndex(0) + self.tabWidget.setCurrentIndex(0) QtCore.QObject.connect(self.main_buttonbox,QtCore.SIGNAL("rejected()"),MainWindow.close) QtCore.QMetaObject.connectSlotsByName(MainWindow) def retranslateUi(self, MainWindow): - 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)) + MainWindow.setWindowTitle(QtGui.QApplication.translate("MainWindow", "MainWindow", None, QtGui.QApplication.UnicodeUTF8)) + self.groupBox_3.setTitle(QtGui.QApplication.translate("MainWindow", "GroupBox", None, QtGui.QApplication.UnicodeUTF8)) + self.groupBox_2.setTitle(QtGui.QApplication.translate("MainWindow", "GroupBox", None, QtGui.QApplication.UnicodeUTF8)) + self.groupBox.setTitle(QtGui.QApplication.translate("MainWindow", "GroupBox", None, QtGui.QApplication.UnicodeUTF8)) + self.tabwidget.setTabText(self.tabwidget.indexOf(self.tab_tasks), QtGui.QApplication.translate("MainWindow", "Tasks", None, QtGui.QApplication.UnicodeUTF8)) + self.groupBox_screenres.setTitle(QtGui.QApplication.translate("MainWindow", "Screen Resolution", None, QtGui.QApplication.UnicodeUTF8)) + self.lb_screenres.setText(QtGui.QApplication.translate("MainWindow... [truncated message content] |
From: <ti...@us...> - 2007-01-30 01:20:57
|
Revision: 100 http://pymoul.svn.sourceforge.net/pymoul/?rev=100&view=rev Author: tiran Date: 2007-01-29 17:20:56 -0800 (Mon, 29 Jan 2007) Log Message: ----------- Fixed misc bugs in plasmalog and chatlog Added KIImageFixer class with tests Modified Paths: -------------- pymoul/trunk/src/moul/file/chatlog.py pymoul/trunk/src/moul/file/kiimage.py pymoul/trunk/src/moul/file/plasmalog.py pymoul/trunk/src/moul/file/tests/test_kiimage.py pymoul/trunk/src/moul/file/tests/test_plasmalog.py Modified: pymoul/trunk/src/moul/file/chatlog.py =================================================================== --- pymoul/trunk/src/moul/file/chatlog.py 2007-01-29 22:07:42 UTC (rev 99) +++ pymoul/trunk/src/moul/file/chatlog.py 2007-01-30 01:20:56 UTC (rev 100) @@ -22,7 +22,7 @@ (MM/DD hh:mm:ss) Chat.log started... (MM/DD hh:mm:ss) ...Chat.log stopped. -(MM/DD hh:mm:ss) From USER in LOCATION: msg +(MM/DD hh:mm:ss) From USER in LOCATION: MSG (MM/DD hh:mm:ss) Error: ERRORMSG (MM/DD hh:mm:ss) USER: TEXT (note the two spaces!) (MM/DD hh:mm:ss) To USER: TEXT @@ -64,7 +64,6 @@ # User: message ) - LOG = getLogger('moul.chat') def modtime(pathname): Modified: pymoul/trunk/src/moul/file/kiimage.py =================================================================== --- pymoul/trunk/src/moul/file/kiimage.py 2007-01-29 22:07:42 UTC (rev 99) +++ pymoul/trunk/src/moul/file/kiimage.py 2007-01-30 01:20:56 UTC (rev 100) @@ -24,13 +24,38 @@ import os import tempfile import struct +from stat import ST_SIZE +from stat import ST_MTIME +from fnmatch import fnmatch +from moul.log import getLogger + JPEG_HEADER = "\377\330\377" -class KiImageError(ValueError): +LOG = getLogger("moul.kiimage") + +class KIImageError(ValueError): pass -class KiImage(object): +def fixedNewer(ki, fixed): + """Check file size and mod date to see if the fixed image is newer + """ + kistat = os.stat(ki) + fixedstat = os.stat(fixed) + if kistat[ST_SIZE] +4 == fixedstat[ST_SIZE]: + # ok, KI is 4 bytes larger + if fixed[ST_MTIME] > ki[ST_MTIME]: + # ok, fixed is newer + return True + else: + return False + else: + return None + +MOUL_IMAGE = 1 +JPEG_IMAGE = 2 + +class KIImage(object): """Ki image handler MOUL's KI images have four leading bytes of junk that encode the file @@ -44,17 +69,26 @@ else: name = getattr(fd_name, 'name', '<UNKNOWN>') fd = fd_name - + self._filename = name self._fd = fd self._size = None + self._filetype = None def close(self): + """Close file handler + """ if self._fd: self._fd.close() self._fd = None - def getSize(self): + def getFileSize(self): + """Get size of file + + Uses the standard seek(0,2)+tell() syntax to get the size of the file. + The file size is cached in self._size. The function resets the + position of the file pointer at the end of the call. + """ if self._size is not None: return self._size fd = self._fd @@ -69,6 +103,12 @@ return size def moulHeaderToSize(self, header=None): + """Convert a MOUL header to file size in int + + NOTE: A MOUL file is jpeg size + 4 bytes header size + + If header is not given the header of the current file is used. + """ # XXX use struct if header is None: fd = self._fd @@ -80,9 +120,13 @@ return size def sizeToMoulHeader(self, size=None): + """Converts a file size in int to a MOUL header string + + NOTE: A MOUL file is jpeg size + 4 bytes header size + """ # XXX use struct if size is None: - size = self.getSize() + size = self.getFileSize() leading = 4* [None] for i in (3,2,1,0): l = size >> 8*i @@ -92,31 +136,54 @@ def verifyMoulHeader(self, header=None): header_size = self.moulHeaderToSize(header) - file_size = self.getSize() + file_size = self.getFileSize() if (header_size + 4) == file_size: return True return False def isJpeg(self): + """Check if file is a JPEG image w/o MOUL header + + The method only checks the header. It doesn't verify the whole + file. + """ + if self._filetype is not None: + return self._filetype == JPEG_IMAGE fd = self._fd fd.seek(0) data = fd.read(3) if data == JPEG_HEADER and not self.isMoulImage(): + self._filetype = JPEG_IMAGE return True - return False + else: + return False def isMoulImage(self): + """Check if file is a MOUL file (JPEG file with MOUL header) + + The method only checks the header. It doesn't verify the whole + file but it verifies the MOUL header. + """ + if self._filetype is not None: + return self._filetype == MOUL_IMAGE fd = self._fd opos = fd.tell() fd.seek(4) data = fd.read(3) if data == JPEG_HEADER and self.verifyMoulHeader(): + self._filetype = MOUL_IMAGE return True - return False + else: + return False + + def removeMoulHeader(self): + """Remove MOUL header from an image - def removeMoulHeader(self): + The method doesn't chance the current file. It returns a file + descriptor to a temporary file. + """ if not self.isMoulImage(): - raise KiImageError('Image has no MOUL header') + raise KIImageError('Image has no MOUL header') out = tempfile.TemporaryFile() fd = self._fd fd.seek(4) @@ -125,10 +192,15 @@ return out def addMoulHeader(self): + """Add MOUL header to an image + + The method doesn't chance the current file. It returns a file + descriptor to a temporary file. + """ if self.isMoulImage(): - raise KiImageError('Image has already a MOUL header') + raise KIImageError('Image has already a MOUL header') if not self.isJpeg(): - raise KiImageError('File is not a JPEG') + raise KIImageError('File is not a JPEG') out = tempfile.TemporaryFile() header = self.sizeToMoulHeader() fd = self._fd @@ -138,3 +210,62 @@ out.write(fd.read()) out.seek(0) return out + +class KIImageFixer(object): + """Create fixed images in a new directory + """ + _pat = ("*.jpg",) + + def __init__(self, srcdir, destdir): + self._srcdir = srcdir + self._destdir = destdir + self._found = [] # all found files + self._tocheck = [] # found files to check + self._fixed = [] # fixed files + + if not os.path.isdir(srcdir): + LOG.critical("%s is not a directory" % srcdir) + return False + if not os.path.isdir(destdir): + LOG.info("Creating chatlog directory %s" % destdir) + os.mkdir(destdir) + + def findFiles(self): + """Find filess + """ + for root, dirs, files in os.walk(self._srcdir): + for name in files: + matches = [pat for pat in self._pat + if fnmatch(name, pat)] + if matches: + ki = os.path.join(root, name) + fixed = os.path.join(self._destdir, name) + self._found.append(ki) + if os.path.isfile(fixed): + if fixedNewer(ki, fixed): + LOG.debug("File %s exists but was changed." % name) + self._tocheck.append((ki, fixed)) + else: + LOG.debug("File %s exists and is fixed." % name) + else: + self._tocheck.append((ki, fixed)) + def checkAndCopyFiles(self): + """Check files if they are KI images + + If the file is a KI image than copy the file to the new location + """ + for kiname, fixedname in self._tocheck: + ki = KIImage(kiname) + if ki.isMoulImage(): + tmp = ki.removeMoulHeader() + fixed = open(fixedname, 'wb') + while True: + buf = tmp.read(4096) + if not buf: + break + fixed.write(buf) + LOG.info("Created fixed image %s" % fixedname) + self._fixed.append((kiname, fixedname)) + fixed.close() + tmp.close() + ki.close() Modified: pymoul/trunk/src/moul/file/plasmalog.py =================================================================== --- pymoul/trunk/src/moul/file/plasmalog.py 2007-01-29 22:07:42 UTC (rev 99) +++ pymoul/trunk/src/moul/file/plasmalog.py 2007-01-30 01:20:56 UTC (rev 100) @@ -106,20 +106,30 @@ The removeLogs function removes only files considered as safe """ + rmdir = [] for root, dirs, files in os.walk(self._srcdir, topdown=False): for name in files: matches = [pat for pat in self._save_patterns if fnmatch(name, pat)] - fpath = os.path.join(root, name) if matches: - os.remove(fpath) + os.remove(os.path.join(root, name)) else: - self._not_removed.append(fpath) + self._not_removed.append((root, name)) LOG.warning("Won't remove %s from %s" % (name, root)) for name in dirs: - os.rmdir(os.path.join(root, name)) + rmdir.append(os.path.join(root, name)) - os.rmdir(self._srcdir) + rmdir.append(self._srcdir) + for d in rmdir: + try: + os.rmdir(d) + except OSError, err: + LOG.exception("Could not delete directory") + self._not_removed.append(d) + if self._not_removed: + return False + else: + return True def __call__(self): self.zipLogDir() Modified: pymoul/trunk/src/moul/file/tests/test_kiimage.py =================================================================== --- pymoul/trunk/src/moul/file/tests/test_kiimage.py 2007-01-29 22:07:42 UTC (rev 99) +++ pymoul/trunk/src/moul/file/tests/test_kiimage.py 2007-01-30 01:20:56 UTC (rev 100) @@ -26,15 +26,15 @@ import unittest from doctest import DocTestSuite -from moul.file.kiimage import KiImage -from moul.file.kiimage import KiImageError +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') kiclean = os.path.join(base, 'avatar_clean.jpg') -class KiImageTest(unittest.TestCase): +class KIImageTest(unittest.TestCase): def setUp(self): self._ki = open(kiimg, 'rb') @@ -45,29 +45,29 @@ self._clean.close() def test_openname(self): - k = KiImage(kiimg) + k = KIImage(kiimg) self.failUnless(k.verifyMoulHeader()) self.failUnless(k.isMoulImage()) self.failIf(k.isJpeg()) - k = KiImage(kiclean) + k = KIImage(kiclean) self.failIf(k.verifyMoulHeader()) self.failIf(k.isMoulImage()) self.failUnless(k.isJpeg()) def test_openfd(self): - k = KiImage(self._ki) + k = KIImage(self._ki) self.failUnless(k.verifyMoulHeader()) self.failUnless(k.isMoulImage()) self.failIf(k.isJpeg()) - k = KiImage(self._clean) + k = KIImage(self._clean) self.failIf(k.verifyMoulHeader()) self.failIf(k.isMoulImage()) self.failUnless(k.isJpeg()) def test_removeheader(self): - k = KiImage(self._ki) + k = KIImage(self._ki) fd = k.removeMoulHeader() data = fd.read() cleandata = self._clean.read() @@ -76,7 +76,7 @@ "file mismatch %r:%r" % (data[:8], cleandata[:8])) def test_addheader(self): - k = KiImage(self._clean) + k = KIImage(self._clean) fd = k.addMoulHeader() data = fd.read() kidata = self._ki.read() @@ -86,7 +86,7 @@ def test_suite(): return unittest.TestSuite(( - unittest.makeSuite(KiImageTest), + unittest.makeSuite(KIImageTest), DocTestSuite('moul.file.kiimage') )) Modified: pymoul/trunk/src/moul/file/tests/test_plasmalog.py =================================================================== --- pymoul/trunk/src/moul/file/tests/test_plasmalog.py 2007-01-29 22:07:42 UTC (rev 99) +++ pymoul/trunk/src/moul/file/tests/test_plasmalog.py 2007-01-30 01:20:56 UTC (rev 100) @@ -30,6 +30,8 @@ from moul.file.plasmalog import PlasmalogZipper from moul.file.chatlog import ChatlogMover +from moul.file.kiimage import KIImageFixer +from moul.file.kiimage import KIImage FILE_LIST = ['audio.0.elf', 'audiocaps.0.elf', 'audioTimes.0.elf', 'Avatar.0.elf', 'impacts.0.elf', 'LocalizationDataMgr.0.elf', @@ -70,6 +72,8 @@ _fakeLogdir(os.path.join(path, 'Logs', 'faketest')) shutil.copyfile(os.path.join(base, 'avatar.jpg'), os.path.join(path, 'Avatars', '001.jpg')) + shutil.copyfile(os.path.join(base, 'avatar.jpg'), + os.path.join(path, 'KIimages', 'KIimage001.jpg')) shutil.copyfile(os.path.join(base, 'graphics.ini'), os.path.join(path, 'init', 'graphics.ini')) shutil.copyfile(os.path.join(base, 'audio.ini'), @@ -78,19 +82,24 @@ class PlasmaChatTest(unittest.TestCase): def setUp(self): self._tmpdir = mkdtemp() + self._logdir = os.path.join(self._tmpdir, 'Logs') + self._kidir = os.path.join(self._tmpdir, 'KIimages') + self._avatardir = os.path.join(self._tmpdir, 'Avatars') + self._chatdest = os.path.join(self._tmpdir, 'Chatlogs') self._logdest = os.path.join(self._tmpdir, 'ZippedLogs') - self._logdir = os.path.join(self._tmpdir, 'Logs') + + self._kidest = os.path.join(self._tmpdir, 'FixedImages') _fakeUruLiveDir(self._tmpdir) - self._clm = ChatlogMover(self._logdir, self._chatdest) - self._plz = PlasmalogZipper(self._logdir, self._logdest) - def test_createDir(self): + def test_000dirs(self): + for d in (self._tmpdir, self._logdir, self._kidir, self._avatardir): + self.failUnless(os.path.isdir(d), d) + + def test_plasmaLogZipper(self): + plz = PlasmalogZipper(self._logdir, self._logdest) self.failUnless(os.path.isdir(self._logdest), self._logdest) - self.failUnless(os.path.isdir(self._chatdest), self._chatdest) - def test_plasmaLogZipper(self): - plz = self._plz self.failUnless(plz.isPlasmaLogDir()) plz.zipLogDir() content = os.listdir(self._logdest) @@ -103,7 +112,9 @@ self.failIf(os.path.isdir(self._logdir)) def test_chatLogMover(self): - clm = self._clm + clm = ChatlogMover(self._logdir, self._chatdest) + self.failUnless(os.path.isdir(self._chatdest), self._chatdest) + clm.findLogs() clm.moveChatlogs() content = os.listdir(self._chatdest) @@ -114,6 +125,22 @@ self.failUnless(c.endswith(".txt")) self.failUnlessEqual(len(c), length, c) + def test_kiImageMover(self): + kif = KIImageFixer(self._kidir, self._kidest) + self.failUnless(os.path.isdir(self._kidest), self._kidest) + + kif.findFiles() + kif.checkAndCopyFiles() + content = os.listdir(self._kidest) + self.failUnlessEqual(len(content), 1, content) + self.failUnlessEqual(content, ["KIimage001.jpg"]) + + cleandata = open(os.path.join(base, 'avatar_clean.jpg'), 'rb').read() + newdata = open(os.path.join(self._kidest, "KIimage001.jpg"), 'rb').read() + + self.failUnlessEqual(len(cleandata), len(newdata)) + self.failUnlessEqual(cleandata, newdata) + def tearDown(self): shutil.rmtree(self._tmpdir) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |