Thread: [Pymoul-svn] SF.net SVN: pymoul: [86] pymoul/trunk (Page 2)
Status: Alpha
Brought to you by:
tiran
|
From: <ti...@us...> - 2007-01-26 18:46:01
|
Revision: 86
http://pymoul.svn.sourceforge.net/pymoul/?rev=86&view=rev
Author: tiran
Date: 2007-01-26 10:30:56 -0800 (Fri, 26 Jan 2007)
Log Message:
-----------
More cleanups: removed unused processinfo module
Removed dependency on pywin32 again. Apparently windows locks the file
Modified Paths:
--------------
pymoul/trunk/setup_win32.py
pymoul/trunk/src/moul/osdependent/singleapp.py
pymoul/trunk/src/moul/osdependent/tests/test_singleapp.py
Removed Paths:
-------------
pymoul/trunk/src/moul/osdependent/processinfo.py
Modified: pymoul/trunk/setup_win32.py
===================================================================
--- pymoul/trunk/setup_win32.py 2007-01-26 17:37:52 UTC (rev 85)
+++ pymoul/trunk/setup_win32.py 2007-01-26 18:30:56 UTC (rev 86)
@@ -71,9 +71,7 @@
pexe['includes'] = ['sip', 'PyQt4', 'encodings', 'encodings.*',
'moul.osdependent.win32', 'moul.osdependent.win32.*']
# SSL currently not in use but imported by socket
- pexe['excludes'] = ['_ssl']
- # added by platform but not yet required
- #pexe['excludes'].extend(('win32pipe', 'win32api', 'win32con', 'win32evtlog'))
+ pexe['excludes'] = ['_ssl', 'win32pipe', 'win32evtlog', 'win32file', 'win32api']
# added by logging.handlers.SMTPHandler but not yet required
pexe['excludes'].append('smtplib')
# UPX
Deleted: pymoul/trunk/src/moul/osdependent/processinfo.py
===================================================================
--- pymoul/trunk/src/moul/osdependent/processinfo.py 2007-01-26 17:37:52 UTC (rev 85)
+++ pymoul/trunk/src/moul/osdependent/processinfo.py 2007-01-26 18:30:56 UTC (rev 86)
@@ -1,219 +0,0 @@
-#!/usr/bin/env python
-# -*- coding: iso-8859-1 -*-
-"""Process info
-
-Based on http://gelb.bcom.at/trac/misc/browser/processinfo
-
-Modified and optimized by Christian Heimes
-"""
-
-import sys
-import os
-
-__all__ = ['PLATFORM', 'UnsupportedOsError', 'getCurrentPids',
- 'getCurrentPidNames', 'getCurrentPidDetails']
-
-class UnsupportedOsError(NotImplementedError):
- pass
-
-PLATFORM = None
-
-_plat = sys.platform.startswith
-if _plat('win'):
- PLATFORM = 'win'
- win32process = None
- ctypes = None
- import csv
- try:
- import win32process
- except ImportError:
- try:
- import ctypes
- except ImportError:
- pass
-elif _plat('linux2') or _plat('cygwin'):
- PLATFORM = 'linux' # Linux or Cygwin
-elif _plat('darwin'):
- # XXX: unsupported
- PLATFORM = 'mac' # Mac OS X
-elif _plat('freebsd') or _plat('netbsd') or _plat('openbsd'):
- # XXX: unsupported
- PLATFORM = 'bsd' # *BSD
-else:
- PLATFORM = 'unknown'
- raise UnsupportedOsError(sys.platform)
-
-# ****************************************************************************
-# Linux / cygwin implementation
-
-def _getCurrentPids_linux():
- """
- Returns current process-id's.
-
- :return: list with process-id's.
- """
- pids = []
- for fname in os.listdir("/proc"):
- if os.path.isdir(os.path.join("/proc", fname)):
- try:
- pids.append(int(fname))
- except ValueError:
- continue
- return pids
-
-def _getCurrentPidDetails_linux():
- """Returns mapping pid -> detailed informations
- """
- mapping = {}
- for pid in getCurrentPids():
- try:
- try:
- # read entiry file to avoid race condition bugs
- fd = open('/proc/%i/status' % pid, 'rb')
- status = fd.read().split('\n')
- finally:
- if fd:
- fd.close()
- except IoError:
- continue
- details = {}
- for line in status:
- try:
- key, value = line.split(':\t')
- except ValueError:
- continue
- details[key.lower()] = value.strip()
- mapping[pid] = details
-
- return mapping
-
-def _getCurrentPidNames_linux():
- """Returns mapping pid -> name
- """
- mapping = {}
- for pid, details in getCurrentPidDetails().items():
- mapping[pid] = details.get('name', None)
- return mapping
-
-
-# ****************************************************************************
-# Windows / win32 implementaton
-
-def _getCurrentPids_win():
- """
- Returns current process-id's.
-
- :return: List with process-id's.
- """
- if win32process is not None:
- return list(win32process.EnumProcesses())
- elif ctypes is not None:
- # ctypes is installed --> try psapi.dll
- psapi = ct.windll.psapi
- arr = ct.c_long * 1024
- process_ids = arr()
- cb = ct.sizeof(process_ids)
- bytes_returned = ct.c_ulong()
- psapi.EnumProcesses(ct.byref(process_ids), cb, ct.byref(bytes_returned))
- return sorted(list(set(process_ids)))
- else:
- csvlines = []
- current_pids = []
- for line in os.popen("tasklist.exe /fo csv /nh"):
- line = line.strip()
- if line:
- csvlines.append(line)
- for line in csv.reader(csvlines):
- current_pids.append(int(line[1]))
- if not csvlines:
- raise NotImplementedError("tasklist.exe not found (>WinXP)")
- return current_pids
-
-def _getCurrentPidNames_win():
- """Returns mapping pid -> name
- """
- mapping = {}
- for pid, details in getCurrentPidDetails().items():
- mapping[pid] = details.get('name', None)
- return mapping
-
-def _getCurrentPidDetails_win():
- """
- Returns processinfos. (pid, name and size_kb)
- """
- result = {}
-
- # tasklist.exe runs on Windows XP and higher. (To parse the ouput of
- # tasklist.exe is faster than WMI.)
- csvlines = []
- for line in os.popen("tasklist.exe /fo csv /nh"):
- line = line.strip()
- if line:
- csvlines.append(line)
- for line in csv.reader(csvlines):
- pid = int(line[1])
- details = {
- "name": line[0].decode("cp850"), # to unicode
- "pid": pid,
- }
- value = "".join(
- char for char in line[4]
- if char.isdigit()
- )
- details["size_kb"] = int(value)
- retdict[pid] = details
- if not csvlines:
- try:
- from win32com.client import GetObject
- # pywin32 is installed --> use WMI
- wmi = GetObject('winmgmts:')
- processes = wmi.InstancesOf('Win32_Process')
- for process in processes:
- pid = int(process.Properties_("ProcessId").value)
- details = {
- "name": process.Properties_("Name").value,
- "pid": pid,
- "size_kb": int(process.Properties_("WorkingSetSize").value) / 1000
- }
- retdict[pid] = details
- except ImportError:
- raise NotImplementedError("No tasklist.exe and no WMI.")
- return retdict
-
-# ****************************************************************************
-# general
-
-def unsupported():
- """Platform not supported
- """
- raise UnsupportedOsError(PLATFORM)
-unsupported.__unsupported__ = True
-
-def _initialize():
- mod = sys.modules[__name__]
- for name in ('getCurrentPids','getCurrentPidDetails', 'getCurrentPidNames'):
- func = getattr(mod, "_%s_%s" % (name, PLATFORM), None)
- if func is None:
- func = unsupported
- else:
- func.__name__ = name
- setattr(mod, name, func)
-_initialize()
-
-def main():
- """Testing"""
-
- from pprint import pformat
- # Current PIDs
- current_pids = getCurrentPids()
- print "Current PIDs: %s" % pformat(current_pids)
- print
- print "Current PID Count: %s" % len(current_pids)
- print
-
- print "Current PIDs with names: %s" % pformat(getCurrentPidNames())
- print
-
-if __name__ == "__main__":
- main()
-
Modified: pymoul/trunk/src/moul/osdependent/singleapp.py
===================================================================
--- pymoul/trunk/src/moul/osdependent/singleapp.py 2007-01-26 17:37:52 UTC (rev 85)
+++ pymoul/trunk/src/moul/osdependent/singleapp.py 2007-01-26 18:30:56 UTC (rev 86)
@@ -25,11 +25,12 @@
Boiler plate
>>> import sys
>>> from shutil import rmtree
->>> from subprocess import call
+>>> from subprocess import Popen
+>>> from StringIO import StringIO
>>> tmpdir = tempfile.mkdtemp()
>>> testfile = os.path.join(tmpdir, 'test.lck')
>>> if os.name == 'nt':
-... rm = "del"
+... rm = "cmd /c del"
... else:
... rm = "rm"
@@ -39,20 +40,29 @@
>>> fn1 = fd1.fileno()
>>> lock(fd1, flags)
>>> fd1.write('testdata')
+>>> os.path.isfile(testfile)
+True
Try to delete the file from another process
->>> try:
-... retcode = call("%s %s" % (rm, testfile))
-... except:
-... typ, value, tb = sys.exc_info()
-... del tb
-... else:
-... print "Should have raised an error!"
+>>> stdout = tempfile.TemporaryFile(mode="w+")
+>>> stderr = tempfile.TemporaryFile(mode="w+")
+>>> popen = Popen("%s %s" % (rm, testfile), stdout=stdout, stderr=stderr)
+>>> popen.wait()
+0
-On Windows the error is WindowsError based on OSError
->>> issubclass(typ, OSError) or typ
+>>> stdout.seek(0)
+>>> out = stdout.read()
+>>> if os.name == 'nt':
+... out.endswith('test.lck\\n') or out
True
+>>> stderr.seek(0)
+>>> stderr.read() != ''
+True
+
+>>> os.path.isfile(testfile)
+True
+
Clean up
>>> unlock(fd1)
>>> fd1.close()
@@ -86,17 +96,19 @@
USER = getpass.getuser()
PID = os.getpid()
+# PYWIN32: Apparently windows locks a file automatically
if os.name == 'nt':
- import win32con
- import win32file
- import pywintypes
- LOCK_EX = win32con.LOCKFILE_EXCLUSIVE_LOCK
- LOCK_SH = 0 # the default
- LOCK_NB = win32con.LOCKFILE_FAIL_IMMEDIATELY
- lowbits, highbits = 0, -65536
+# import win32con
+# import win32file
+# import pywintypes
+# LOCK_EX = win32con.LOCKFILE_EXCLUSIVE_LOCK
+# LOCK_SH = 0 # the default
+# LOCK_NB = win32con.LOCKFILE_FAIL_IMMEDIATELY
+# lowbits, highbits = 0, -65536
+ LOCK_SH, LOCK_NB = 0, 1
elif os.name == 'posix':
import fcntl
- LOCK_EX = fcntl.LOCK_EX
+ #LOCK_EX = fcntl.LOCK_EX
LOCK_SH = fcntl.LOCK_SH
LOCK_NB = fcntl.LOCK_NB
else:
@@ -104,11 +116,13 @@
if os.name == 'nt':
def lock(file, flags):
- hfile = win32file._get_osfhandle(file.fileno())
- return win32file.LockFileEx(hfile, flags, lowbits, highbits, pywintypes.OVERLAPPED())
+ #hfile = win32file._get_osfhandle(file.fileno())
+ #return win32file.LockFileEx(hfile, flags, lowbits, highbits, pywintypes.OVERLAPPED())
+ pass
def unlock(file):
- hfile = win32file._get_osfhandle(file.fileno())
- return win32file.UnlockFileEx(hfile, lowbits, highbits, pywintypes.OVERLAPPED())
+ #hfile = win32file._get_osfhandle(file.fileno())
+ #return win32file.UnlockFileEx(hfile, lowbits, highbits, pywintypes.OVERLAPPED())
+ pass
elif os.name =='posix':
def lock(file, flags):
return fcntl.flock(file.fileno(), flags)
@@ -141,6 +155,12 @@
May raise an OSError
"""
+ if os.path.isfile(self.lckfile):
+ try:
+ os.unlink(self.lckfile)
+ except OSError, IOError:
+ self._fd = None
+ raise SingleAppError("Another instance is already running")
try:
self._fd = open(self.lckfile, 'w')
self._fd.write(str(self.pid))
Modified: pymoul/trunk/src/moul/osdependent/tests/test_singleapp.py
===================================================================
--- pymoul/trunk/src/moul/osdependent/tests/test_singleapp.py 2007-01-26 17:37:52 UTC (rev 85)
+++ pymoul/trunk/src/moul/osdependent/tests/test_singleapp.py 2007-01-26 18:30:56 UTC (rev 86)
@@ -27,7 +27,7 @@
from moul.osdependent.singleapp import SimpleSingleApp
from moul.osdependent.singleapp import lock
from moul.osdependent.singleapp import unlock
-from moul.osdependent.singleapp import LOCK_EX, LOCK_SH, LOCK_NB
+from moul.osdependent.singleapp import LOCK_SH, LOCK_NB
def test_suite():
return unittest.TestSuite((
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ti...@us...> - 2007-01-27 22:29:40
|
Revision: 89
http://pymoul.svn.sourceforge.net/pymoul/?rev=89&view=rev
Author: tiran
Date: 2007-01-27 14:29:40 -0800 (Sat, 27 Jan 2007)
Log Message:
-----------
Propset eol-style and keywords
Renamed Makefile to Makefile.in
Tests and better implementation for locking and singleapp
Modified Paths:
--------------
pymoul/trunk/compileui.py
pymoul/trunk/setup.py
pymoul/trunk/setup_win32.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_singleapp.py
pymoul/trunk/src/moul/osdependent/win32/__init__.py
pymoul/trunk/src/moul/qt/moulqt.py
Added Paths:
-----------
pymoul/trunk/Makefile.in
pymoul/trunk/src/moul/osdependent/tests/test_processinfo.py
Removed Paths:
-------------
pymoul/trunk/Makefile
Property Changed:
----------------
pymoul/trunk/AUTHORS.txt
pymoul/trunk/GPL.txt
pymoul/trunk/INSTALL.txt
pymoul/trunk/README.txt
pymoul/trunk/compileui.py
pymoul/trunk/distutils_upx.py
pymoul/trunk/ez_setup.py
pymoul/trunk/setup.py
pymoul/trunk/setup_win32.py
pymoul/trunk/src/moul/config/tests/test_config.py
pymoul/trunk/src/moul/file/tests/audio.txt
pymoul/trunk/src/moul/file/tests/audiocaps.0.txt
pymoul/trunk/src/moul/file/tests/graphics.txt
pymoul/trunk/src/moul/file/tests/test_chatlog.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/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/__init__.py
pymoul/trunk/src/moul/osdependent/tests/test_osdependent.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/localization.py
pymoul/trunk/src/moul/qt/ui/README.txt
pymoul/trunk/src/moul/server/__init__.py
pymoul/trunk/src/moul/server/ping.py
pymoul/trunk/src/moul/server/serverlist.py
pymoul/trunk/src/moul/server/tests/__init__.py
pymoul/trunk/src/moul/server/tests/test_ping.py
pymoul/trunk/src/moul/server/tests/test_serverlist.py
pymoul/trunk/src/moul/time/README.txt
pymoul/trunk/src/moul/time/tests/test_dni.py
pymoul/trunk/test.py
pymoul/trunk/version.txt
Property changes on: pymoul/trunk/AUTHORS.txt
___________________________________________________________________
Name: svn:keywords
+ Id Revisioni
Property changes on: pymoul/trunk/GPL.txt
___________________________________________________________________
Name: svn:keywords
+ Id Revisioni
Property changes on: pymoul/trunk/INSTALL.txt
___________________________________________________________________
Name: svn:keywords
+ Id Revisioni
Deleted: pymoul/trunk/Makefile
===================================================================
--- pymoul/trunk/Makefile 2007-01-27 21:30:28 UTC (rev 88)
+++ pymoul/trunk/Makefile 2007-01-27 22:29:40 UTC (rev 89)
@@ -1,61 +0,0 @@
-PYTHON?=python
-EPYDOC=$(PYTHON) -c "import epydoc.cli; epydoc.cli.cli()"
-TESTFLAGS=-v
-TESTOPTS=
-SETUPFLAGS=
-
-all: inplace
-
-# Build in-place
-inplace:
- PYTHONPATH="src" $(PYTHON) setup.py $(SETUPFLAGS) build_ext -i
-
-build: compileui
- PYTHONPATH="src" $(PYTHON) setup.py $(SETUPFLAGS) build
-
-py2exe:
- PYTHONPATH="src" $(PYTHON) setup.py $(SETUPFLAGS) py2exe
-
-innosetup:
- PYTHONPATH="src" INNOSETUP="yes" $(PYTHON) setup.py $(SETUPFLAGS) py2exe
-
-bdist_egg:
- PYTHONPATH="src" $(PYTHON) setup.py $(SETUPFLAGS) bdist_egg
-
-run: compileui
- PYTHONPATH="src" $(PYTHON) src/moul/qt/moulqt.py
-
-exerun: compileui py2exe
- dist/moulqt.exe
-
-compileui:
- $(PYTHON) compileui.py
-
-test_build: build compileui
- PYTHONPATH="src" $(PYTHON) test.py $(TESTFLAGS) $(TESTOPTS)
-
-test_inplace: compileui
- PYTHONPATH="src" $(PYTHON) test.py $(TESTFLAGS) $(TESTOPTS)
-
-doc_html:
- PYTHONPATH="src" $(EPYDOC) -v --html --output="doc/html" moul
-
-# What should the default be?
-test: test_inplace
-
-exe: py2exe
-
-installer: innosetup
-
-egg: bdist_egg
-
-doc: doc_html
-
-clean:
- find . \( -name '*.o' -o -name '*.c' -o -name '*.so' -o -name '*.py[cod]' -o -name '*.dll' \) -exec rm -f {} \;
- rm -rf build
-
-realclean: clean
- rm -f TAGS
- $(PYTHON) setup.py clean -a
-
Copied: pymoul/trunk/Makefile.in (from rev 88, pymoul/trunk/Makefile)
===================================================================
--- pymoul/trunk/Makefile.in (rev 0)
+++ pymoul/trunk/Makefile.in 2007-01-27 22:29:40 UTC (rev 89)
@@ -0,0 +1,67 @@
+PYTHON?=python
+EPYDOC=$(PYTHON) -c "import epydoc.cli; epydoc.cli.cli()"
+TESTFLAGS=-v
+TESTOPTS=
+SETUPFLAGS=
+
+all: inplace
+
+# Build in-place
+inplace:
+ PYTHONPATH="src" $(PYTHON) setup.py $(SETUPFLAGS) build_ext -i
+
+build: compileui
+ PYTHONPATH="src" $(PYTHON) setup.py $(SETUPFLAGS) build
+
+py2exe:
+ PYTHONPATH="src" $(PYTHON) setup.py $(SETUPFLAGS) py2exe
+
+innosetup:
+ PYTHONPATH="src" INNOSETUP="yes" $(PYTHON) setup.py $(SETUPFLAGS) py2exe
+
+bdist_egg:
+ PYTHONPATH="src" $(PYTHON) setup.py $(SETUPFLAGS) bdist_egg
+
+run: compileui
+ PYTHONPATH="src" $(PYTHON) src/moul/qt/moulqt.py
+
+exerun: compileui py2exe
+ dist/moulqt.exe
+
+compileui:
+ $(PYTHON) compileui.py
+
+test_build: build compileui
+ PYTHONPATH="src" $(PYTHON) test.py $(TESTFLAGS) $(TESTOPTS)
+
+test_inplace: compileui
+ PYTHONPATH="src" $(PYTHON) test.py $(TESTFLAGS) $(TESTOPTS)
+
+doc_html:
+ PYTHONPATH="src" $(EPYDOC) -v --html --output="doc/html" moul
+
+# What should the default be?
+test: test_inplace
+
+exe: py2exe
+
+installer: innosetup
+
+egg: bdist_egg
+
+doc: doc_html
+
+clean:
+ find . \( -name '*.o' -o -name '*.c' -o -name '*.so' -o -name '*.py[cod]' -o -name '*.dll' \) -exec rm -f {} \;
+ rm -rf build
+
+realclean: clean
+ rm -f TAGS
+ $(PYTHON) setup.py clean -a
+
+propset:
+ find src/moul \( -name '*.py' -o -name '*.txt' \) -a -not -wholename '*.svn*' | xargs svn propset svn:keywords "Id Revision"
+ find src/moul \( -name '*.py' -o -name '*.txt' -o -name '*.qrc' -o -name '*.ui' \) -a -not -wholename '*.svn*' | xargs svn propset svn:eol-style "native"
+ find . -maxdepth 1 \( -name '*.py' -o -name '*.txt' \) | xargs svn propset svn:keywords "Id Revisioni"
+ find . -maxdepth 1 \( -name '*.py' -o -name '*.txt' \) | xargs svn propset svn:eol-style "native"
+
Property changes on: pymoul/trunk/README.txt
___________________________________________________________________
Name: svn:keywords
+ Id Revisioni
Modified: pymoul/trunk/compileui.py
===================================================================
--- pymoul/trunk/compileui.py 2007-01-27 21:30:28 UTC (rev 88)
+++ pymoul/trunk/compileui.py 2007-01-27 22:29:40 UTC (rev 89)
@@ -3,7 +3,7 @@
"""
__author__ = "Christian Heimes"
__version__ = "$Id$"
-__revision__ = "$Revision$"
+__revision__ = "$Revision: 45 $"
import os
import re
Property changes on: pymoul/trunk/compileui.py
___________________________________________________________________
Name: svn:keywords
- Id Revision
+ Id Revisioni
Property changes on: pymoul/trunk/distutils_upx.py
___________________________________________________________________
Name: svn:keywords
+ Id Revisioni
Property changes on: pymoul/trunk/ez_setup.py
___________________________________________________________________
Name: svn:keywords
- Id Revision
+ Id Revisioni
Modified: pymoul/trunk/setup.py
===================================================================
--- pymoul/trunk/setup.py 2007-01-27 21:30:28 UTC (rev 88)
+++ pymoul/trunk/setup.py 2007-01-27 22:29:40 UTC (rev 89)
@@ -5,7 +5,7 @@
"""
__author__ = "Christian Heimes"
__version__ = "$Id$"
-__revision__ = "$Revision$"
+__revision__ = "$Revision: 58 $"
import sys
import os
Property changes on: pymoul/trunk/setup.py
___________________________________________________________________
Name: svn:keywords
- Id Revision
+ Id Revisioni
Modified: pymoul/trunk/setup_win32.py
===================================================================
--- pymoul/trunk/setup_win32.py 2007-01-27 21:30:28 UTC (rev 88)
+++ pymoul/trunk/setup_win32.py 2007-01-27 22:29:40 UTC (rev 89)
@@ -2,7 +2,7 @@
"""
__author__ = "Christian Heimes"
__version__ = "$Id$"
-__revision__ = "$Revision$"
+__revision__ = "$Revision: 86 $"
import os
import sys
Property changes on: pymoul/trunk/setup_win32.py
___________________________________________________________________
Name: svn:keywords
- Id Revision
+ Id Revisioni
Property changes on: pymoul/trunk/src/moul/config/tests/test_config.py
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Property changes on: pymoul/trunk/src/moul/file/tests/audio.txt
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Property changes on: pymoul/trunk/src/moul/file/tests/audiocaps.0.txt
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Property changes on: pymoul/trunk/src/moul/file/tests/graphics.txt
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Property changes on: pymoul/trunk/src/moul/file/tests/test_chatlog.py
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Property changes on: pymoul/trunk/src/moul/file/tests/test_kiimage.py
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Property changes on: pymoul/trunk/src/moul/file/tests/test_localization.py
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Property changes on: pymoul/trunk/src/moul/file/tests/test_plasmalog.py
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Property changes on: pymoul/trunk/src/moul/file/tests/test_wdysini.py
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Modified: pymoul/trunk/src/moul/osdependent/__init__.py
===================================================================
--- pymoul/trunk/src/moul/osdependent/__init__.py 2007-01-27 21:30:28 UTC (rev 88)
+++ pymoul/trunk/src/moul/osdependent/__init__.py 2007-01-27 22:29:40 UTC (rev 89)
@@ -1,136 +1,136 @@
-# 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
-#
-"""OS dependent code for linux, mac and win32
-
->>> pids = getPids()
->>> len(pids) > 1
-True
-
->>> pids = getPidNames()
->>> found = False
->>> for pid, name in pids.items():
-... if name.lower().startswith('python'):
-... found = True
->>> found
-True
-"""
-__author__ = "Christian Heimes"
-__version__ = "$Id$"
-__revision__ = "$Revision$"
-
-import os
-import sys
-from moul.log import getLogger
-from moul.osdependent.processinfo import getPids
-from moul.osdependent.processinfo import getPidNames
-
-LOG = getLogger('moul.osdependent')
-
-# a program under py2exe is sys.frozen
-__FROZEN__ = bool(getattr(sys, 'frozen', False))
-# OS stuff
-_plat = sys.platform.startswith
-__WIN32__ = _plat('win32') # win64, cygwin?
-__CYGWIN__ = _plat('cygwin')
-__LINUX__ = _plat('linux2')
-__MACOSX__ = _plat('darwin')
-__BSD__ = _plat('freebsd') or _plat('netbsd') or _plat('openbsd')
-__POSIX__ = os.name.lower() == 'posix'
-__NT__ = os.name.lower() == 'nt'
-__INFO__ = (__WIN32__, __CYGWIN__, __LINUX__, __MACOSX__, __BSD__,
- __POSIX__, __NT__)
-
-# names to import: from moul.osdependent.ID import NAME (as NAME)
-NAMES = ('getMoulUserDataDir',
- ('getPyMoulDataDir', '_getPyMoulDataDir'), # as
- 'startMoul', 'isMoulRunning',
- )
-
-_marker = object()
-
-def _importHelper(modname, names=None, target=None):
- """Import a list of variables from a module
-
- >>> mod = _importHelper('moul.osdependent')
- >>> mod == _thismodule or mod
- True
- >>> vars = _importHelper('moul.osdependent', ('_marker', ))
- >>> vars[0] is _marker
- True
- >>> class Target(object):
- ... pass
- >>> target = Target()
- >>> vars = _importHelper('moul.osdependent', ('_marker', ), target=target)
- >>> target._marker is _marker
- True
- >>> vars[0] is _marker
- True
-
- >>> vars = _importHelper('moul.osdependent', (('_marker', 'another'), ),
- ... target=target)
- >>> target.another is _marker
- True
- >>> vars[0] is _marker
- True
- """
- mod = __import__(modname, globals(), locals(), [''])
- if names is None:
- return mod
- else:
- vars = []
- for name in names:
- if isinstance(name, (tuple, list)):
- name, nameas = name
- else:
- nameas = name
- var = getattr(mod, name)
- vars.append(var)
- if target is not None:
- setattr(target, nameas, var)
- return vars
-
-# XXX: what about cygwin, bsd and others?
-_thismodule = sys.modules[__name__]
-if __WIN32__:
- _importHelper('moul.osdependent.win32', NAMES, target=_thismodule)
-elif __LINUX__:
- _importHelper('moul.osdependent.linux', NAMES, target=_thismodule)
-elif __MACOSX__:
- _importHelper('moul.osdependent.darwin', NAMES, target=_thismodule)
-else:
- raise RuntimeError('platform %s not supported' % sys.platform)
-
-def getPyMoulDataDir(check=False):
- """Get pyMoul data directory
-
- The directory contains log files, ini files and other local stuff
- """
- datadir = _getPyMoulDataDir()
- if check:
- if os.path.abspath(datadir) != datadir:
- raise ValueError("Datadir is not absolute %s" % datadir)
- if not os.path.isdir(datadir):
- parent = os.path.abspath(os.path.join(datadir, os.pardir))
- if not os.path.isdir(parent):
- raise ValueError("Datadir's parent dir does not exist: %s"
- % par)
- else:
- LOG.debug("Creating pyMoul data dir %s" % datadir)
- os.mkdir(datadir, 0750)
- LOG.debug("Using pyMoul data dir %s" % datadir)
- return datadir
+# 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
+#
+"""OS dependent code for linux, mac and win32
+
+>>> pids = getPids()
+>>> len(pids) > 1
+True
+
+>>> pids = getPidNames()
+>>> found = False
+>>> for pid, name in pids.items():
+... if name.lower().startswith('python'):
+... found = True
+>>> found
+True
+"""
+__author__ = "Christian Heimes"
+__version__ = "$Id$"
+__revision__ = "$Revision$"
+
+import os
+import sys
+from moul.log import getLogger
+from moul.osdependent.processinfo import getPids
+from moul.osdependent.processinfo import getPidNames
+
+LOG = getLogger('moul.osdependent')
+
+# a program under py2exe is sys.frozen
+__FROZEN__ = bool(getattr(sys, 'frozen', False))
+# OS stuff
+_plat = sys.platform.startswith
+__WIN32__ = _plat('win32') # win64, cygwin?
+__CYGWIN__ = _plat('cygwin')
+__LINUX__ = _plat('linux2')
+__MACOSX__ = _plat('darwin')
+__BSD__ = _plat('freebsd') or _plat('netbsd') or _plat('openbsd')
+__POSIX__ = os.name.lower() == 'posix'
+__NT__ = os.name.lower() == 'nt'
+__INFO__ = (__WIN32__, __CYGWIN__, __LINUX__, __MACOSX__, __BSD__,
+ __POSIX__, __NT__)
+
+# names to import: from moul.osdependent.ID import NAME (as NAME)
+NAMES = ('getMoulUserDataDir',
+ ('getPyMoulDataDir', '_getPyMoulDataDir'), # as
+ 'startMoul', 'isMoulRunning',
+ )
+
+_marker = object()
+
+def _importHelper(modname, names=None, target=None):
+ """Import a list of variables from a module
+
+ >>> mod = _importHelper('moul.osdependent')
+ >>> mod == _thismodule or mod
+ True
+ >>> vars = _importHelper('moul.osdependent', ('_marker', ))
+ >>> vars[0] is _marker
+ True
+ >>> class Target(object):
+ ... pass
+ >>> target = Target()
+ >>> vars = _importHelper('moul.osdependent', ('_marker', ), target=target)
+ >>> target._marker is _marker
+ True
+ >>> vars[0] is _marker
+ True
+
+ >>> vars = _importHelper('moul.osdependent', (('_marker', 'another'), ),
+ ... target=target)
+ >>> target.another is _marker
+ True
+ >>> vars[0] is _marker
+ True
+ """
+ mod = __import__(modname, globals(), locals(), [''])
+ if names is None:
+ return mod
+ else:
+ vars = []
+ for name in names:
+ if isinstance(name, (tuple, list)):
+ name, nameas = name
+ else:
+ nameas = name
+ var = getattr(mod, name)
+ vars.append(var)
+ if target is not None:
+ setattr(target, nameas, var)
+ return vars
+
+# XXX: what about cygwin, bsd and others?
+_thismodule = sys.modules[__name__]
+if __WIN32__:
+ _importHelper('moul.osdependent.win32', NAMES, target=_thismodule)
+elif __LINUX__:
+ _importHelper('moul.osdependent.linux', NAMES, target=_thismodule)
+elif __MACOSX__:
+ _importHelper('moul.osdependent.darwin', NAMES, target=_thismodule)
+else:
+ raise RuntimeError('platform %s not supported' % sys.platform)
+
+def getPyMoulDataDir(check=False):
+ """Get pyMoul data directory
+
+ The directory contains log files, ini files and other local stuff
+ """
+ datadir = _getPyMoulDataDir()
+ if check:
+ if os.path.abspath(datadir) != datadir:
+ raise ValueError("Datadir is not absolute %s" % datadir)
+ if not os.path.isdir(datadir):
+ parent = os.path.abspath(os.path.join(datadir, os.pardir))
+ if not os.path.isdir(parent):
+ raise ValueError("Datadir's parent dir does not exist: %s"
+ % par)
+ else:
+ LOG.debug("Creating pyMoul data dir %s" % datadir)
+ os.mkdir(datadir, 0750)
+ LOG.debug("Using pyMoul data dir %s" % datadir)
+ return datadir
Property changes on: pymoul/trunk/src/moul/osdependent/__init__.py
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ native
Modified: pymoul/trunk/src/moul/osdependent/darwin/__init__.py
===================================================================
--- pymoul/trunk/src/moul/osdependent/darwin/__init__.py 2007-01-27 21:30:28 UTC (rev 88)
+++ pymoul/trunk/src/moul/osdependent/darwin/__init__.py 2007-01-27 22:29:40 UTC (rev 89)
@@ -1,57 +1,57 @@
-# 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.osdependent.darwin
-"""
-__author__ = "Christian Heimes"
-__version__ = "$Id$"
-__revision__ = "$Revision$"
-
-import os
-from subprocess import Popen
-from moul.log import getLogger
-
-LOG = getLogger('moul.darwin')
-LOG.critical('Darwin/Mac support is not tested')
-
-MOUL_DIR = "Uru Live"
-EXEC_NAME = "UruLauncher"
-HOME = os.environ['HOME']
-
-def getMoulUserDataDir():
- """Get path of MOUL data directory
-
- The MOUL data directory contains log files, chatlogs, KI images and many
- more things.
- """
- moul_data = os.path.join(HOME, MOUL_DIR)
-
-def getPyMoulDataDir():
- """Get path to the pyMoul ini directory
- """
- inidir= os.path.join(HOME, '.pymoul')
- return inidir
-
-def startMoul(installdir, *args, **kwargs):
- """Start MOUL - returns a Popen instance
-
- args are applied to the program while kwargs are applied to
- subprocess.Popen()
- """
- path = os.path.join(installdir, EXEC_NAME)
- args = ' '.join(args)
- return Popen("%s %s" % (path, args), cwd=installdir, **kwargs)
+# 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.osdependent.darwin
+"""
+__author__ = "Christian Heimes"
+__version__ = "$Id$"
+__revision__ = "$Revision$"
+
+import os
+from subprocess import Popen
+from moul.log import getLogger
+
+LOG = getLogger('moul.darwin')
+LOG.critical('Darwin/Mac support is not tested')
+
+MOUL_DIR = "Uru Live"
+EXEC_NAME = "UruLauncher"
+HOME = os.environ['HOME']
+
+def getMoulUserDataDir():
+ """Get path of MOUL data directory
+
+ The MOUL data directory contains log files, chatlogs, KI images and many
+ more things.
+ """
+ moul_data = os.path.join(HOME, MOUL_DIR)
+
+def getPyMoulDataDir():
+ """Get path to the pyMoul ini directory
+ """
+ inidir= os.path.join(HOME, '.pymoul')
+ return inidir
+
+def startMoul(installdir, *args, **kwargs):
+ """Start MOUL - returns a Popen instance
+
+ args are applied to the program while kwargs are applied to
+ subprocess.Popen()
+ """
+ path = os.path.join(installdir, EXEC_NAME)
+ args = ' '.join(args)
+ return Popen("%s %s" % (path, args), cwd=installdir, **kwargs)
Property changes on: pymoul/trunk/src/moul/osdependent/darwin/__init__.py
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ native
Modified: pymoul/trunk/src/moul/osdependent/linux/__init__.py
===================================================================
--- pymoul/trunk/src/moul/osdependent/linux/__init__.py 2007-01-27 21:30:28 UTC (rev 88)
+++ pymoul/trunk/src/moul/osdependent/linux/__init__.py 2007-01-27 22:29:40 UTC (rev 89)
@@ -1,115 +1,115 @@
-# 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.osdependent.linux
-"""
-__author__ = "Christian Heimes"
-__version__ = "$Id$"
-__revision__ = "$Revision$"
-
-import os
-from subprocess import Popen
-from moul.log import getLogger
-
-LOG = getLogger('moul.linux')
-LOG.critical('Darwin/Mac support is not tested')
-
-MOUL_DIR = "Uru Live"
-INI_FILE = ('pyMoul', 'pymoul.ini')
-EXEC_NAME = "UruLauncher"
-HOME = os.environ['HOME']
-PROCESSES = ('urulauncher', 'uruexplorer')
-
-def getMoulUserDataDir():
- """Get path of MOUL data directory
-
- The MOUL data directory contains log files, chatlogs, KI images and many
- more things.
- """
- return os.path.join(HOME, MOUL_DIR)
-
-def getPyMoulDataDir():
- """Get path to the pyMoul ini directory
- """
- inidir= os.path.join(HOME, '.pymoul')
- return inidir
-
-def startMoul(installdir, *args, **kwargs):
- """Start MOUL - returns a Popen instance
-
- args are applied to the program while kwargs are applied to
- subprocess.Popen()
- """
- path = os.path.join(installdir, EXEC_NAME)
- args = ' '.join(args)
- return Popen("%s %s" % (path, args), cwd=installdir, **kwargs)
-
-def isMoulRunning():
- """Test if MOUL or the launcher is running
- """
- for pid, name in getCurrentPidNames().items():
- if name.lower() in PROCESSES:
- return name.lower()
- return False
-
-# process info
-# based on http://gelb.bcom.at/trac/misc/browser/processinfo
-def getCurrentPids():
- """Returns current process ids
- """
- pids = []
- for fname in os.listdir("/proc"):
- if os.path.isdir(os.path.join("/proc", fname)):
- try:
- pids.append(int(fname))
- except ValueError:
- continue
- return pids
-
-def getCurrentPidDetails():
- """Returns mapping pid -> detailed informations
- """
- mapping = {}
- for pid in getCurrentPids():
- try:
- try:
- # read entiry file to avoid race condition bugs
- fd = open('/proc/%i/status' % pid, 'rb')
- status = fd.read().split('\n')
- finally:
- if fd:
- fd.close()
- except IoError:
- continue
- details = {}
- for line in status:
- try:
- key, value = line.split(':\t')
- except ValueError:
- continue
- details[key.lower()] = value.strip()
- mapping[pid] = details
-
- return mapping
-
-def getCurrentPidNames():
- """Returns mapping pid -> name
- """
- mapping = {}
- for pid, details in getCurrentPidDetails().items():
- mapping[pid] = details.get('name', None)
- return mapping
+# 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.osdependent.linux
+"""
+__author__ = "Christian Heimes"
+__version__ = "$Id$"
+__revision__ = "$Revision$"
+
+import os
+from subprocess import Popen
+from moul.log import getLogger
+
+LOG = getLogger('moul.linux')
+LOG.critical('Linux support is not tested')
+
+MOUL_DIR = "Uru Live"
+INI_FILE = ('pyMoul', 'pymoul.ini')
+EXEC_NAME = "UruLauncher"
+HOME = os.environ['HOME']
+PROCESSES = ('urulauncher', 'uruexplorer')
+
+def getMoulUserDataDir():
+ """Get path of MOUL data directory
+
+ The MOUL data directory contains log files, chatlogs, KI images and many
+ more things.
+ """
+ return os.path.join(HOME, MOUL_DIR)
+
+def getPyMoulDataDir():
+ """Get path to the pyMoul ini directory
+ """
+ inidir= os.path.join(HOME, '.pymoul')
+ return inidir
+
+def startMoul(installdir, *a...
[truncated message content] |
|
From: <ti...@us...> - 2007-01-28 15:23:45
|
Revision: 90
http://pymoul.svn.sourceforge.net/pymoul/?rev=90&view=rev
Author: tiran
Date: 2007-01-28 07:23:44 -0800 (Sun, 28 Jan 2007)
Log Message:
-----------
Changed import behavior and fixed smaller issues in singleapp
Modified Paths:
--------------
pymoul/trunk/INSTALL.txt
pymoul/trunk/setup_win32.py
pymoul/trunk/src/moul/osdependent/__init__.py
pymoul/trunk/src/moul/osdependent/linux/__init__.py
pymoul/trunk/src/moul/osdependent/singleapp.py
pymoul/trunk/src/moul/qt/__init__.py
pymoul/trunk/src/moul/qt/ui/mainwindow.py
Added Paths:
-----------
pymoul/trunk/src/moul/qt/i18n/
Property Changed:
----------------
pymoul/trunk/
Property changes on: pymoul/trunk
___________________________________________________________________
Name: svn:ignore
- build
dist
*.e4?
+ build
dist
*.e4?
Makefile
Modified: pymoul/trunk/INSTALL.txt
===================================================================
--- pymoul/trunk/INSTALL.txt 2007-01-27 22:29:40 UTC (rev 89)
+++ pymoul/trunk/INSTALL.txt 2007-01-28 15:23:44 UTC (rev 90)
@@ -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 pytz)
+ * PyTz (via $ easy_install-2.5 pytz)
* Qt4 GPL 4.2+ http://www.trolltech.com/developer/downloads/qt/
* PyQt4 4.1.1+ http://www.riverbankcomputing.co.uk/pyqt/
@@ -13,7 +13,7 @@
-------
* pywin32 http://sourceforge.net/projects/pywin32/
- * py2exe http://www.py2exe.org/
+ * py2exe http://www.py2exe.org/ (via $ easy_install-2.5 py2exe)
* MinGW32 compiler (bundled with Qt4)
Tools
@@ -21,6 +21,7 @@
* UPX http://upx.sourceforge.net/#download
* InnoSetup http://www.jrsoftware.org/
+ * epydoc 3.0+ (via $ easy_install-2.5 epydoc)
====================
Windows Installation
Modified: pymoul/trunk/setup_win32.py
===================================================================
--- pymoul/trunk/setup_win32.py 2007-01-27 22:29:40 UTC (rev 89)
+++ pymoul/trunk/setup_win32.py 2007-01-28 15:23:44 UTC (rev 90)
@@ -68,8 +68,7 @@
pexe = kw['options'].setdefault('py2exe', {})
pexe['compressed'] = 100 # compress zip file
pexe['optimize'] = 0 # 0,1,2
- pexe['includes'] = ['sip', 'PyQt4', 'encodings', 'encodings.*',
- 'moul.osdependent.win32', 'moul.osdependent.win32.*']
+ 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
Modified: pymoul/trunk/src/moul/osdependent/__init__.py
===================================================================
--- pymoul/trunk/src/moul/osdependent/__init__.py 2007-01-27 22:29:40 UTC (rev 89)
+++ pymoul/trunk/src/moul/osdependent/__init__.py 2007-01-28 15:23:44 UTC (rev 90)
@@ -35,6 +35,8 @@
import os
import sys
+from types import ModuleType
+
from moul.log import getLogger
from moul.osdependent.processinfo import getPids
from moul.osdependent.processinfo import getPidNames
@@ -65,7 +67,10 @@
def _importHelper(modname, names=None, target=None):
"""Import a list of variables from a module
-
+
+ >>> mod = _importHelper(sys)
+ >>> mod is sys or mod
+ True
>>> mod = _importHelper('moul.osdependent')
>>> mod == _thismodule or mod
True
@@ -88,7 +93,11 @@
>>> vars[0] is _marker
True
"""
- mod = __import__(modname, globals(), locals(), [''])
+ if not isinstance(modname, ModuleType):
+ mod = __import__(modname, globals(), locals(), [''])
+ else:
+ mod = modname
+
if names is None:
return mod
else:
@@ -107,11 +116,14 @@
# XXX: what about cygwin, bsd and others?
_thismodule = sys.modules[__name__]
if __WIN32__:
- _importHelper('moul.osdependent.win32', NAMES, target=_thismodule)
+ from moul.osdependent import win32 as osdep_win32
+ _importHelper(osdep_win32, NAMES, target=_thismodule)
elif __LINUX__:
- _importHelper('moul.osdependent.linux', NAMES, target=_thismodule)
+ from moul.osdependent import linux as osdep_linux
+ _importHelper(osdep_linux, NAMES, target=_thismodule)
elif __MACOSX__:
- _importHelper('moul.osdependent.darwin', NAMES, target=_thismodule)
+ from moul.osdependent import darwin as osdep_darwin
+ _importHelper(osdep_darwin, NAMES, target=_thismodule)
else:
raise RuntimeError('platform %s not supported' % sys.platform)
Modified: pymoul/trunk/src/moul/osdependent/linux/__init__.py
===================================================================
--- pymoul/trunk/src/moul/osdependent/linux/__init__.py 2007-01-27 22:29:40 UTC (rev 89)
+++ pymoul/trunk/src/moul/osdependent/linux/__init__.py 2007-01-28 15:23:44 UTC (rev 90)
@@ -28,7 +28,7 @@
LOG = getLogger('moul.linux')
LOG.critical('Linux support is not tested')
-MOUL_DIR = "Uru Live"
+MOUL_DIR = ".urulive"
INI_FILE = ('pyMoul', 'pymoul.ini')
EXEC_NAME = "UruLauncher"
HOME = os.environ['HOME']
Modified: pymoul/trunk/src/moul/osdependent/singleapp.py
===================================================================
--- pymoul/trunk/src/moul/osdependent/singleapp.py 2007-01-27 22:29:40 UTC (rev 89)
+++ pymoul/trunk/src/moul/osdependent/singleapp.py 2007-01-28 15:23:44 UTC (rev 90)
@@ -106,6 +106,7 @@
self.pid = pid
self.ext = ext
self._fd = None
+ self._locked = False
self.lckfile = self._genFilename()
# register atexit function
atexit.register(self.release)
@@ -123,10 +124,12 @@
if self._fd is not None:
self._fd.close()
self._fd = None
+ self._locked = False
raise SingleAppError("Another instance is already running")
else:
self._fd.write(str(self.pid))
self._fd.flush()
+ self._locked = True
LOG.info("Create lock file %s for PID %i" % (self.lckfile, self.pid))
return self.lckfile, self.pid
@@ -145,18 +148,18 @@
if os.path.isfile(self.lckfile):
LOG.info("Remove lock file %s" % self.lckfile)
os.unlink(self.lckfile)
-
+ self._locked = False
+
def checkLocked(self):
"""Check if another process has a lock
"""
+ if self._locked:
+ return True
try:
- fd = open(self.lckfile, 'a+')
- fd.close()
- except OSError:
+ lock(self._fd, LOCK)
+ except (IOError, OSError):
return True
else:
- if self._fd:
- return None
return False
def _genFilename(self):
Modified: pymoul/trunk/src/moul/qt/__init__.py
===================================================================
--- pymoul/trunk/src/moul/qt/__init__.py 2007-01-27 22:29:40 UTC (rev 89)
+++ pymoul/trunk/src/moul/qt/__init__.py 2007-01-28 15:23:44 UTC (rev 90)
@@ -15,8 +15,11 @@
# with this program; if not, write to the Free Software Foundation, Inc., 59
# Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
+
"""
+moul.qt package with Qt4 UI
"""
+
__author__ = "Christian Heimes"
__version__ = "$Id$"
__revision__ = "$Revision$"
Modified: pymoul/trunk/src/moul/qt/ui/mainwindow.py
===================================================================
--- pymoul/trunk/src/moul/qt/ui/mainwindow.py 2007-01-27 22:29:40 UTC (rev 89)
+++ pymoul/trunk/src/moul/qt/ui/mainwindow.py 2007-01-28 15:23:44 UTC (rev 90)
@@ -1,8 +1,8 @@
# -*- 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 Jan 26 19:48:46 2007
+# Created: Sun Jan 28 15:25:00 2007
# by: PyQt4 UI code generator 4.1.1
#
# WARNING! All changes made in this file will be lost!
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ti...@us...> - 2007-01-28 16:43:17
|
Revision: 92
http://pymoul.svn.sourceforge.net/pymoul/?rev=92&view=rev
Author: tiran
Date: 2007-01-28 08:43:16 -0800 (Sun, 28 Jan 2007)
Log Message:
-----------
Added translation files
Modified Paths:
--------------
pymoul/trunk/Makefile.in
pymoul/trunk/src/moul/osdependent/singleapp.py
pymoul/trunk/src/moul/qt/i18n/pymoul_de.ts
Added Paths:
-----------
pymoul/trunk/src/moul/qt/i18n/pymoul_de.qm
pymoul/trunk/src/moul/qt/i18n/pymoul_es.qm
pymoul/trunk/src/moul/qt/i18n/pymoul_es.ts
pymoul/trunk/src/moul/qt/i18n/pymoul_fr.qm
pymoul/trunk/src/moul/qt/i18n/pymoul_fr.ts
pymoul/trunk/src/moul/qt/i18n/pymoul_it.qm
pymoul/trunk/src/moul/qt/i18n/pymoul_it.ts
Property Changed:
----------------
pymoul/trunk/src/moul/qt/i18n/pymoul_de.ts
Modified: pymoul/trunk/Makefile.in
===================================================================
--- pymoul/trunk/Makefile.in 2007-01-28 15:49:22 UTC (rev 91)
+++ pymoul/trunk/Makefile.in 2007-01-28 16:43:16 UTC (rev 92)
@@ -1,5 +1,11 @@
PYTHON?=python
EPYDOC=$(PYTHON) -c "import epydoc.cli; epydoc.cli.cli()"
+NOTSVN=-a -not -wholename '*.svn*'
+FINDPYTXT=find src/moul \( -name '*.py' -o -name '*.txt' \) $(NOTSVN)
+FINDPY=find src/moul -name '*.py' $(NOTSVN)
+FINDQT=find src/moul/qt \( -name '*.py' -o -name '*.ui' \) $(NOTSVN)
+FINDTEXT=find src/moul \( -name '*.py' -o -name '*.txt' -o -name '*.qrc' -o -name '*.ui' -o -name '*.ts' \) $(NOTSVN)
+LANGS=de fr it es
TESTFLAGS=-v
TESTOPTS=
SETUPFLAGS=
@@ -60,8 +66,15 @@
$(PYTHON) setup.py clean -a
propset:
- find src/moul \( -name '*.py' -o -name '*.txt' \) -a -not -wholename '*.svn*' | xargs svn propset svn:keywords "Id Revision"
- find src/moul \( -name '*.py' -o -name '*.txt' -o -name '*.qrc' -o -name '*.ui' \) -a -not -wholename '*.svn*' | xargs svn propset svn:eol-style "native"
- find . -maxdepth 1 \( -name '*.py' -o -name '*.txt' \) | xargs svn propset svn:keywords "Id Revisioni"
- find . -maxdepth 1 \( -name '*.py' -o -name '*.txt' \) | xargs svn propset svn:eol-style "native"
+ $(FINDPYTXT) | xargs svn propset svn:keywords "Id Revision"
+ $(FINDTEXT) | xargs svn propset svn:eol-style "native"
+fixlineendings:
+ $(FINDPY) | xargs recode -f ibmpc..latin1
+
+updatelangs:
+ for L in $(LANGS); do \
+ pylupdate4 `$(FINDQT)` -ts src/moul/qt/i18n/pymoul_$${L}.ts;\
+ lrelease src/moul/qt/i18n/pymoul_$${L}.ts; \
+ done
+
Modified: pymoul/trunk/src/moul/osdependent/singleapp.py
===================================================================
--- pymoul/trunk/src/moul/osdependent/singleapp.py 2007-01-28 15:49:22 UTC (rev 91)
+++ pymoul/trunk/src/moul/osdependent/singleapp.py 2007-01-28 16:43:16 UTC (rev 92)
@@ -33,8 +33,8 @@
True
>>> os.path.isfile(lckfile)
True
->>> singleapp.checkLocked() is None
-True
+>>> singleapp.checkLocked()
+2
>>> singleapp.release()
>>> os.path.isfile(lckfile)
False
@@ -151,10 +151,10 @@
self._locked = False
def checkLocked(self):
- """Check if another process has a lock
+ """Check a process has a lock
"""
if self._locked:
- return True
+ return 2
try:
lock(self._fd, LOCK)
except (IOError, OSError):
Added: pymoul/trunk/src/moul/qt/i18n/pymoul_de.qm
===================================================================
(Binary files differ)
Property changes on: pymoul/trunk/src/moul/qt/i18n/pymoul_de.qm
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: pymoul/trunk/src/moul/qt/i18n/pymoul_de.ts
===================================================================
--- pymoul/trunk/src/moul/qt/i18n/pymoul_de.ts 2007-01-28 15:49:22 UTC (rev 91)
+++ pymoul/trunk/src/moul/qt/i18n/pymoul_de.ts 2007-01-28 16:43:16 UTC (rev 92)
@@ -2,34 +2,6 @@
<context>
<name>MainWindow</name>
<message>
- <source>MOUL is running</source>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <source>MOUL</source>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <source>MOUL is not running</source>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <source>Not Implemented</source>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <source>Sorry, this feature is not implemented yet!</source>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <source>Error opening graphics.ini</source>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <source>Error opening audio.ini</source>
- <translation type="unfinished"></translation>
- </message>
- <message>
<source>Tool for Myst Online</source>
<translation type="unfinished"></translation>
</message>
@@ -244,5 +216,33 @@
<source>About</source>
<translation type="unfinished"></translation>
</message>
+ <message>
+ <source>MOUL is running</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>MOUL</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>MOUL is not running</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Not Implemented</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Sorry, this feature is not implemented yet!</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Error opening graphics.ini</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Error opening audio.ini</source>
+ <translation type="unfinished"></translation>
+ </message>
</context>
</TS>
Property changes on: pymoul/trunk/src/moul/qt/i18n/pymoul_de.ts
___________________________________________________________________
Name: svn:eol-style
+ native
Added: pymoul/trunk/src/moul/qt/i18n/pymoul_es.qm
===================================================================
(Binary files differ)
Property changes on: pymoul/trunk/src/moul/qt/i18n/pymoul_es.qm
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: pymoul/trunk/src/moul/qt/i18n/pymoul_es.ts
===================================================================
--- pymoul/trunk/src/moul/qt/i18n/pymoul_es.ts (rev 0)
+++ pymoul/trunk/src/moul/qt/i18n/pymoul_es.ts 2007-01-28 16:43:16 UTC (rev 92)
@@ -0,0 +1,248 @@
+<!DOCTYPE TS><TS>
+<context>
+ <name>MainWindow</name>
+ <message>
+ <source>Tool for Myst Online</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Configure</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <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>
+ <message>
+ <source>Screen Resolution</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>800x600 (4:3)</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Quality</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Texture Quality</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Low</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>High</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Anti-Aliasing</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Graphics Quality</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Med.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Ultra</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Shadow Quality</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Anisotropic-Filtering</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Graphics</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Level</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>NPC Voices</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Sound FX</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Ambience Sound</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Music</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Mute all</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Hardware</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Sound Priority</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Audio Modes</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Generic Software</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Enable EAX</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Voice chat</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Microphon Level</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Enable Voice Chat</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Audio</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Time zones</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Cavern time:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Cyan time:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>UTC -0</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>(Mountain Standard Time)</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>(Pacific Standard Time)</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>D'ni time</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Time</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Ping servers</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Ping</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>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Servers</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Browse in game documents</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Age</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Element</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Language</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Set</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Documents</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>pyMoul tools</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>About</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>MOUL is running</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>MOUL</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>MOUL is not running</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Not Implemented</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Sorry, this feature is not implemented yet!</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Error opening graphics.ini</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Error opening audio.ini</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+</TS>
Property changes on: pymoul/trunk/src/moul/qt/i18n/pymoul_es.ts
___________________________________________________________________
Name: svn:eol-style
+ native
Added: pymoul/trunk/src/moul/qt/i18n/pymoul_fr.qm
===================================================================
(Binary files differ)
Property changes on: pymoul/trunk/src/moul/qt/i18n/pymoul_fr.qm
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: pymoul/trunk/src/moul/qt/i18n/pymoul_fr.ts
===================================================================
--- pymoul/trunk/src/moul/qt/i18n/pymoul_fr.ts (rev 0)
+++ pymoul/trunk/src/moul/qt/i18n/pymoul_fr.ts 2007-01-28 16:43:16 UTC (rev 92)
@@ -0,0 +1,248 @@
+<!DOCTYPE TS><TS>
+<context>
+ <name>MainWindow</name>
+ <message>
+ <source>Tool for Myst Online</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Configure</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <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>
+ <message>
+ <source>Screen Resolution</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>800x600 (4:3)</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Quality</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Texture Quality</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Low</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>High</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Anti-Aliasing</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Graphics Quality</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Med.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Ultra</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Shadow Quality</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Anisotropic-Filtering</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Graphics</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Level</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>NPC Voices</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Sound FX</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Ambience Sound</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Music</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Mute all</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Hardware</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Sound Priority</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Audio Modes</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Generic Software</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Enable EAX</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Voice chat</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Microphon Level</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Enable Voice Chat</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Audio</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Time zones</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Cavern time:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Cyan time:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>UTC -0</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>(Mountain Standard Time)</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>(Pacific Standard Time)</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>D'ni time</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Time</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Ping servers</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Ping</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>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Servers</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Browse in game documents</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Age</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Element</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Language</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Set</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Documents</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>pyMoul tools</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>About</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>MOUL is running</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>MOUL</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>MOUL is not running</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Not Implemented</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Sorry, this feature is not implemented yet!</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Error opening graphics.ini</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Error opening audio.ini</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+</TS>
Property changes on: pymoul/trunk/src/moul/qt/i18n/pymoul_fr.ts
___________________________________________________________________
Name: svn:eol-style
+ native
Added: pymoul/trunk/src/moul/qt/i18n/pymoul_it.qm
===================================================================
(Binary files differ)
Property changes on: pymoul/trunk/src/moul/qt/i18n/pymoul_it.qm
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: pymoul/trunk/src/moul/qt/i18n/pymoul_it.ts
===================================================================
--- pymoul/trunk/src/moul/qt/i18n/pymoul_it.ts (rev 0)
+++ pymoul/trunk/src/moul/qt/i18n/pymoul_it.ts 2007-01-28 16:43:16 UTC (rev 92)
@@ -0,0 +1,248 @@
+<!DOCTYPE TS><TS>
+<context>
+ <name>MainWindow</name>
+ <message>
+ <source>Tool for Myst Online</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Configure</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <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>
+ <message>
+ <source>Screen Resolution</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>800x600 (4:3)</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Quality</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Texture Quality</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Low</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>High</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Anti-Aliasing</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Graphics Quality</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Med.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Ultra</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Shadow Quality</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Anisotropic-Filtering</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Graphics</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Level</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>NPC Voices</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Sound FX</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Ambience Sound</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Music</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Mute all</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Hardware</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Sound Priority</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Audio Modes</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Generic Software</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Enable EAX</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Voice chat</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Microphon Level</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Enable Voice Chat</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Audio</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Time zones</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Cavern time:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Cyan time:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>UTC -0</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>(Mountain Standard Time)</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>(Pacific Standard Time)</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>D'ni time</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Time</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Ping servers</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Ping</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...
[truncated message content] |
|
From: <ti...@us...> - 2007-01-28 21:14:22
|
Revision: 94
http://pymoul.svn.sourceforge.net/pymoul/?rev=94&view=rev
Author: tiran
Date: 2007-01-28 13:14:23 -0800 (Sun, 28 Jan 2007)
Log Message:
-----------
include more files in dist
Added hash stuff
Modified Paths:
--------------
pymoul/trunk/Makefile.in
pymoul/trunk/compileui.py
pymoul/trunk/setup.py
Modified: pymoul/trunk/Makefile.in
===================================================================
--- pymoul/trunk/Makefile.in 2007-01-28 17:15:47 UTC (rev 93)
+++ pymoul/trunk/Makefile.in 2007-01-28 21:14:23 UTC (rev 94)
@@ -4,7 +4,8 @@
FINDPYTXT=find src/moul \( -name '*.py' -o -name '*.txt' \) $(NOTSVN)
FINDPY=find src/moul -name '*.py' $(NOTSVN)
FINDQT=find src/moul/qt \( -name '*.py' -o -name '*.ui' \) $(NOTSVN)
-FINDTEXT=find src/moul \( -name '*.py' -o -name '*.txt' -o -name '*.qrc' -o -name '*.ui' -o -name '*.ts' \) $(NOTSVN)
+FINDTEXT=find src/moul \( -name '*.py' -o -name '*.txt' -o -name '*.qrc' -o -name '*.ui' -o -name '*.ts' \) $(NOTSVN)
+FINDHASH= find . -not \( -name '*.txt' -o -name '*.asc' \) -a -not -type d
LANGS=de fr it es
TESTFLAGS=-v
TESTOPTS=
@@ -78,3 +79,9 @@
lrelease src/moul/qt/i18n/pymoul_$${L}.ts; \
done
+hash:
+ 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/compileui.py
===================================================================
--- pymoul/trunk/compileui.py 2007-01-28 17:15:47 UTC (rev 93)
+++ pymoul/trunk/compileui.py 2007-01-28 21:14:23 UTC (rev 94)
@@ -11,7 +11,7 @@
from PyQt4 import uic
-RE_RC_TEXT = "^import\ (?P<module>[a-zA-Z]\w*_rc)\s$"
+RE_RC_TEXT = "^import[ \.\\/]*(?P<module>[a-zA-Z]\w*_rc)\s$"
RE_RC = re.compile(RE_RC_TEXT)
UI_EXT = '.ui'
@@ -19,7 +19,7 @@
QRC_EXT = '.qrc'
PY_QRC_EXT = '_rc.py'
QRC_COMPILER = "pyrcc4 -o %(py)s %(qrc)s"
-UI_MODULE = "moul.qt.ui"
+QRC_PACKAGE = "moul.qt.ui"
def _newer(orig, py):
try:
@@ -81,7 +81,7 @@
# faster than re
match = RE_RC.match(line)
if match:
- line = match.expand("from %s import \g<module>" % UI_MODULE)
+ line = match.expand("from %s import \g<module>" % QRC_PACKAGE)
lines.append(line)
fin.close()
fout = open(fname, 'w')
Modified: pymoul/trunk/setup.py
===================================================================
--- pymoul/trunk/setup.py 2007-01-28 17:15:47 UTC (rev 93)
+++ pymoul/trunk/setup.py 2007-01-28 21:14:23 UTC (rev 94)
@@ -58,7 +58,10 @@
setup_options = dict(
setup_requires = ["setuptools>="+SETUPTOOLS_VERSION,],
install_requires = [],
- data_files = list(glob('*.txt')),
+ data_files = [
+ ('docs', list(glob('*.txt'))),
+ ('i18', list(glob('src/moul/qt/i18n/pymoul_*.*'))),
+ ],
package_dir = {'' : 'src'},
packages = find_packages('src', exclude="moul.qt"),
include_package_data = True,
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ti...@us...> - 2007-01-28 23:51:55
|
Revision: 95
http://pymoul.svn.sourceforge.net/pymoul/?rev=95&view=rev
Author: tiran
Date: 2007-01-28 15:51:53 -0800 (Sun, 28 Jan 2007)
Log Message:
-----------
Enhanced supported for IS script
Modified Paths:
--------------
pymoul/trunk/Makefile.in
pymoul/trunk/distutils_upx.py
Added Paths:
-----------
pymoul/trunk/src/moul/qt/i18n/pymoul_nl.qm
pymoul/trunk/src/moul/qt/i18n/pymoul_nl.ts
Modified: pymoul/trunk/Makefile.in
===================================================================
--- pymoul/trunk/Makefile.in 2007-01-28 21:14:23 UTC (rev 94)
+++ pymoul/trunk/Makefile.in 2007-01-28 23:51:53 UTC (rev 95)
@@ -6,7 +6,7 @@
FINDQT=find src/moul/qt \( -name '*.py' -o -name '*.ui' \) $(NOTSVN)
FINDTEXT=find src/moul \( -name '*.py' -o -name '*.txt' -o -name '*.qrc' -o -name '*.ui' -o -name '*.ts' \) $(NOTSVN)
FINDHASH= find . -not \( -name '*.txt' -o -name '*.asc' \) -a -not -type d
-LANGS=de fr it es
+LANGS=de es fr it nl
TESTFLAGS=-v
TESTOPTS=
SETUPFLAGS=
Modified: pymoul/trunk/distutils_upx.py
===================================================================
--- pymoul/trunk/distutils_upx.py 2007-01-28 21:14:23 UTC (rev 94)
+++ pymoul/trunk/distutils_upx.py 2007-01-28 23:51:53 UTC (rev 95)
@@ -12,6 +12,7 @@
from distutils import log
from stat import ST_SIZE
from fnmatch import fnmatch
+from ConfigParser import RawConfigParser
class UpxCommand:
"""Upx packer mixin class for distutils
@@ -184,38 +185,59 @@
self.dist_dir = dist_dir
# TODO: better name mangling
self.pathname = os.path.join(dist_dir, name.replace(' ', '_')+'.iss')
+ self.cfg = ISSConfigParser()
if not self.dist_dir[-1] in "\\/":
self.dist_dir += "\\"
self.name = name
self.version = version
self.windows_exe_files = [self.chop(p) for p in windows_exe_files]
self.lib_files = [self.chop(p) for p in lib_files]
+ self.setup_kwargs = {
+ }
+ self.languages = ["dutch", "french", "german", "italian", "spanish"]
def chop(self, pathname):
assert pathname.startswith(self.dist_dir)
return pathname[len(self.dist_dir):]
def create(self):
- ofi = self.file = open(self.pathname, "w")
- print >> ofi, "; WARNING: This script has been created by py2exe. Changes to this script"
- print >> ofi, "; will be overwritten the next time py2exe is run!"
- print >> ofi, r"[Setup]"
- print >> ofi, r"AppName=%s" % self.name
- print >> ofi, r"AppVerName=%s %s" % (self.name, self.version)
- print >> ofi, r"DefaultDirName={pf}\%s" % self.name
- print >> ofi, r"DefaultGroupName=%s" % self.name
- print >> ofi
-
- print >> ofi, r"[Files]"
+ fd = self.file = open(self.pathname, "w")
+ 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_section('Setup')
+ cfg.add_section('Files')
+ cfg.add_section('Icons')
+ cfg.add_section('Languages')
+ cfg.add_section('Tasks')
+ cfg.add_section('Run')
+
+ # Setup
+ cfg.set("Setup", "AppName", self.name)
+ cfg.set("Setup", "AppVerName", "%s %s" % (self.name, self.version))
+ cfg.set("Setup", "DefaultDirName", "{pf}\%s" % self.name)
+ cfg.set("Setup", "DefaultGroupName", self.name)
+ for key, value in self.setup_kwargs.items():
+ cfg.set("Setup", key, value)
+ # Languages
+ cfg.set_raw('Languages',
+ 'Name: "english"; MessagesFile: "compiler:Default.isl"')
+ for lang in self.languages:
+ cfg.set_raw("Languages",
+ 'Name: "%s"; MessagesFile: "compiler:Languages/%s.isl"'
+ % (lang, lang.capitalize()))
+
for path in self.windows_exe_files + self.lib_files:
- print >> ofi, r'Source: "%s"; DestDir: "{app}\%s"; Flags: ignoreversion' % (path, os.path.dirname(path))
- print >> ofi
-
- print >> ofi, r"[Icons]"
+ cfg.set_raw("Files",
+ r'Source: "%s"; DestDir: "{app}\%s"; Flags: ignoreversion'
+ % (path, os.path.dirname(path))
+ )
for path in self.windows_exe_files:
- print >> ofi, r'Name: "{group}\%s"; Filename: "{app}\%s"' % \
- (self.name, path)
- print >> ofi, 'Name: "{group}\Uninstall %s"; Filename: "{uninstallexe}"' % self.name
+ cfg.set_raw("Icons",
+ 'Name: "{group}\%s"; Filename: "{app}\%s"' %
+ (self.name, path)
+ )
+ cfg.set_raw("Icons", 'Name: "{group}\Uninstall %s"; Filename: "{uninstallexe}"' % self.name)
def compile(self):
try:
@@ -243,7 +265,68 @@
if res < 32:
raise RuntimeError("ShellExecute failed, error %d" % res)
+class ISSConfigParser(RawConfigParser):
+ """Config parser for InnoSetupScripts
+ Supports *only* writing and no parsing!
+ """
+ def __init__(self, defaults=None):
+ RawConfigParser__init__(self, defaults)
+ self._raw = {}
+ self._header = []
+
+ 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.
+ """
+ RawConfigParser.add_section(self, section)
+ self._raw[section]= []
+
+ def set_raw(self, section, raw):
+ """Add a raw string to a section
+
+ TODO: use NoSectionError
+ """
+ self._raw[section] = raw
+
+ def _read(self, fp, fpname):
+ """Read and parse a filename or a list of filenames.
+ """
+ raise NotImplementedError
+
+ def optionxform(self, optionstr):
+ return optionstr
+
+ def write(self, fp):
+ """Write an .ini-format representation of the configuration state."""
+ for header in self._headers:
+ 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._sections:
+ fp.write("[%s]\n" % section)
+ for (key, value) in self._sections[section].items():
+ if key != "__name__":
+ fp.write("%s = %s\n" %
+ (key, str(value).replace('\n', '\n\t')))
+ for raw in self._raw['section']:
+ fp.write(str(raw).replace('\n', '\n\t') +'\n')
+ 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
+
try:
from py2exe.build_exe import py2exe
except ImportError:
Added: pymoul/trunk/src/moul/qt/i18n/pymoul_nl.qm
===================================================================
(Binary files differ)
Property changes on: pymoul/trunk/src/moul/qt/i18n/pymoul_nl.qm
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: pymoul/trunk/src/moul/qt/i18n/pymoul_nl.ts
===================================================================
--- pymoul/trunk/src/moul/qt/i18n/pymoul_nl.ts (rev 0)
+++ pymoul/trunk/src/moul/qt/i18n/pymoul_nl.ts 2007-01-28 23:51:53 UTC (rev 95)
@@ -0,0 +1,248 @@
+<!DOCTYPE TS><TS>
+<context>
+ <name>MainWindow</name>
+ <message>
+ <source>Tool for Myst Online</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Configure</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <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>
+ <message>
+ <source>Screen Resolution</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>800x600 (4:3)</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Quality</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Texture Quality</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Low</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>High</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Anti-Aliasing</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Graphics Quality</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Med.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Ultra</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Shadow Quality</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Anisotropic-Filtering</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Graphics</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Level</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>NPC Voices</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Sound FX</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Ambience Sound</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Music</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Mute all</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Hardware</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Sound Priority</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Audio Modes</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Generic Software</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Enable EAX</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Voice chat</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Microphon Level</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Enable Voice Chat</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Audio</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Time zones</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Cavern time:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Cyan time:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>UTC -0</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>(Mountain Standard Time)</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>(Pacific Standard Time)</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>D'ni time</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Time</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Ping servers</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Ping</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>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Servers</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Browse in game documents</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Age</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Element</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Language</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Set</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Documents</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>pyMoul tools</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>About</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>MOUL is running</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>MOUL</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>MOUL is not running</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Not Implemented</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Sorry, this feature is not implemented yet!</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Error opening graphics.ini</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Error opening audio.ini</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+</TS>
Property changes on: pymoul/trunk/src/moul/qt/i18n/pymoul_nl.ts
___________________________________________________________________
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-29 12:59:57
|
Revision: 96
http://pymoul.svn.sourceforge.net/pymoul/?rev=96&view=rev
Author: tiran
Date: 2007-01-29 04:59:51 -0800 (Mon, 29 Jan 2007)
Log Message:
-----------
Better InnoScript integration
Modified Paths:
--------------
pymoul/trunk/distutils_upx.py
Added Paths:
-----------
pymoul/trunk/distutils_iss.py
Copied: pymoul/trunk/distutils_iss.py (from rev 95, pymoul/trunk/distutils_upx.py)
===================================================================
--- pymoul/trunk/distutils_iss.py (rev 0)
+++ pymoul/trunk/distutils_iss.py 2007-01-29 12:59:51 UTC (rev 96)
@@ -0,0 +1,510 @@
+"""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
+
+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
+ isscript=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
+ 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.isscript,
+ 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")
Modified: pymoul/trunk/distutils_upx.py
===================================================================
--- pymoul/trunk/distutils_upx.py 2007-01-28 23:51:53 UTC (rev 95)
+++ pymoul/trunk/distutils_upx.py 2007-01-29 12:59:51 UTC (rev 96)
@@ -12,9 +12,9 @@
from distutils import log
from stat import ST_SIZE
from fnmatch import fnmatch
-from ConfigParser import RawConfigParser
+from distutils_iss import InnoSetupCommandMixin
-class UpxCommand:
+class UpxCommand(InnoSetupCommandMixin):
"""Upx packer mixin class for distutils
Usage:
@@ -36,6 +36,7 @@
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'
@@ -45,10 +46,6 @@
'dylib', # Mac OS X
]
self.upx_ignore = []
-
- self.app_name = ''
- self.innosetup = False
-
return result
def finalize_options(self):
@@ -65,7 +62,7 @@
def run(self, *args, **kwargs):
result = self._otherclass().run(self, *args, **kwargs)
self._upxPack()
- self._createInnoSetup()
+ InnoSetupCommandMixin.run(self)
return result
def _upxPack(self):
@@ -94,13 +91,13 @@
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)
@@ -147,186 +144,10 @@
Find next class in MRO that is not based on UpxCommand class
"""
for c in getmro(cls):
- if not issubclass(c, UpxCommand):
+ if not issubclass(c, (UpxCommand, InnoSetupCommandMixin)):
return c
raise ValueError(cls)
- def _createInnoSetup(self):
- if not self.innosetup:
- return
-
- script = InnoScript(self.app_name,
- self.lib_dir,
- self.dist_dir,
- self.windows_exe_files,
- self.lib_files)
- print "*** creating the inno setup script***"
- script.create()
- print "*** compiling the inno setup script***"
- try:
- script.compile()
- except RuntimeError, msg:
- print "Failed to create installer:\n%s" % msg
- # Note: By default the final setup.exe will be in an Output subdirectory.
-
-class InnoScript:
- """Based on py2exe/samples/extending/setup.py
-
- Requires http://www.jrsoftware.org
- """
- def __init__(self,
- name,
- lib_dir,
- dist_dir,
- windows_exe_files = [],
- lib_files = [],
- version = "1.0"):
- self.lib_dir = lib_dir
- self.dist_dir = dist_dir
- # TODO: better name mangling
- self.pathname = os.path.join(dist_dir, name.replace(' ', '_')+'.iss')
- self.cfg = ISSConfigParser()
- if not self.dist_dir[-1] in "\\/":
- self.dist_dir += "\\"
- self.name = name
- self.version = version
- self.windows_exe_files = [self.chop(p) for p in windows_exe_files]
- self.lib_files = [self.chop(p) for p in lib_files]
- self.setup_kwargs = {
- }
- self.languages = ["dutch", "french", "german", "italian", "spanish"]
-
- def chop(self, pathname):
- assert pathname.startswith(self.dist_dir)
- return pathname[len(self.dist_dir):]
-
- def create(self):
- fd = self.file = open(self.pathname, "w")
- 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_section('Setup')
- cfg.add_section('Files')
- cfg.add_section('Icons')
- cfg.add_section('Languages')
- cfg.add_section('Tasks')
- cfg.add_section('Run')
-
- # Setup
- cfg.set("Setup", "AppName", self.name)
- cfg.set("Setup", "AppVerName", "%s %s" % (self.name, self.version))
- cfg.set("Setup", "DefaultDirName", "{pf}\%s" % self.name)
- cfg.set("Setup", "DefaultGroupName", self.name)
- for key, value in self.setup_kwargs.items():
- cfg.set("Setup", key, value)
- # Languages
- cfg.set_raw('Languages',
- 'Name: "english"; MessagesFile: "compiler:Default.isl"')
- for lang in self.languages:
- cfg.set_raw("Languages",
- 'Name: "%s"; MessagesFile: "compiler:Languages/%s.isl"'
- % (lang, lang.capitalize()))
-
- for path in self.windows_exe_files + self.lib_files:
- cfg.set_raw("Files",
- r'Source: "%s"; DestDir: "{app}\%s"; Flags: ignoreversion'
- % (path, os.path.dirname(path))
- )
- for path in self.windows_exe_files:
- cfg.set_raw("Icons",
- 'Name: "{group}\%s"; Filename: "{app}\%s"' %
- (self.name, path)
- )
- cfg.set_raw("Icons", 'Name: "{group}\Uninstall %s"; Filename: "{uninstallexe}"' % self.name)
-
- def compile(self):
- try:
- import ctypes
- except ImportError:
- try:
- import win32api
- except ImportError:
- import os
- os.startfile(self.pathname)
- else:
- #print "Ok, using win32api."
- win32api.ShellExecute(0, "compile",
- self.pathname,
- None,
- None,
- 0)
- else:
- #print "Cool, you have ctypes installed."
- res = ctypes.windll.shell32.ShellExecuteA(0, "compile",
- self.pathname,
- None,
- None,
- 0)
- if res < 32:
- raise RuntimeError("ShellExecute failed, error %d" % res)
-
-class ISSConfigParser(RawConfigParser):
- """Config parser for InnoSetupScripts
-
- Supports *only* writing and no parsing!
- """
- def __init__(self, defaults=None):
- RawConfigParser__init__(self, defaults)
- self._raw = {}
- self._header = []
-
- 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.
- """
- RawConfigParser.add_section(self, section)
- self._raw[section]= []
-
- def set_raw(self, section, raw):
- """Add a raw string to a section
-
- TODO: use NoSectionError
- """
- self._raw[section] = raw
-
- def _read(self, fp, fpname):
- """Read and parse a filename or a list of filenames.
- """
- raise NotImplementedError
-
- def optionxform(self, optionstr):
- return optionstr
-
- def write(self, fp):
- """Write an .ini-format representation of the configuration state."""
- for header in self._headers:
- 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._sections:
- fp.write("[%s]\n" % section)
- for (key, value) in self._sections[section].items():
- if key != "__name__":
- fp.write("%s = %s\n" %
- (key, str(value).replace('\n', '\n\t')))
- for raw in self._raw['section']:
- fp.write(str(raw).replace('\n', '\n\t') +'\n')
- 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
-
try:
from py2exe.build_exe import py2exe
except ImportError:
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ti...@us...> - 2007-01-29 13:16:05
|
Revision: 97
http://pymoul.svn.sourceforge.net/pymoul/?rev=97&view=rev
Author: tiran
Date: 2007-01-29 05:15:59 -0800 (Mon, 29 Jan 2007)
Log Message:
-----------
Added iss template
Modified Paths:
--------------
pymoul/trunk/distutils_iss.py
Added Paths:
-----------
pymoul/trunk/template.iss
Modified: pymoul/trunk/distutils_iss.py
===================================================================
--- pymoul/trunk/distutils_iss.py 2007-01-29 12:59:51 UTC (rev 96)
+++ pymoul/trunk/distutils_iss.py 2007-01-29 13:15:59 UTC (rev 97)
@@ -13,6 +13,7 @@
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
@@ -389,6 +390,9 @@
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)
@@ -425,7 +429,7 @@
self._writeLanguagesSect()
self._writeWindowsExeFiles()
self._writeLibFiles()
- self._writeIcons()
+ #self._writeIcons()
self._writeSections()
def _writeLanguagesSect(self):
Added: pymoul/trunk/template.iss
===================================================================
--- pymoul/trunk/template.iss (rev 0)
+++ pymoul/trunk/template.iss 2007-01-29 13:15:59 UTC (rev 97)
@@ -0,0 +1,40 @@
+; Script generated by the Inno Setup Script Wizard.
+; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
+
+[Setup]
+AppName=%(appname)s
+AppVerName=%(appname)s %(version)s
+AppPublisher=Christian Heimes
+AppPublisherURL=http://www.cheimes.de/
+AppSupportURL=http://pymoul.sourceforge.net/
+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\
+OutputBaseFilename=setup_%(appnamestripped)s_%(version)s
+Compression=lzma
+SolidCompression=yes
+
+[Languages]
+Name: "english"; MessagesFile: "compiler:Default.isl"
+Name: "dutch"; MessagesFile: "compiler:Languages\Dutch.isl"
+Name: "french"; MessagesFile: "compiler:Languages\French.isl"
+Name: "german"; MessagesFile: "compiler:Languages\German.isl"
+Name: "italian"; MessagesFile: "compiler:Languages\Italian.isl"
+Name: "spanish"; MessagesFile: "compiler:Languages\Spanish.isl"
+
+[Tasks]
+Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
+Name: "quicklaunchicon"; Description: "{cm:CreateQuickLaunchIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
+
+[Icons]
+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
+
+[Run]
+Filename: "{app}%(appexe)s"; Description: "{cm:LaunchProgram,My Program}"; Flags: nowait postinstall skipifsilent
Property changes on: pymoul/trunk/template.iss
___________________________________________________________________
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-29 18:46:36
|
Revision: 98
http://pymoul.svn.sourceforge.net/pymoul/?rev=98&view=rev
Author: tiran
Date: 2007-01-29 10:46:30 -0800 (Mon, 29 Jan 2007)
Log Message:
-----------
Some work on chatlogs and plasma logs
Modified Paths:
--------------
pymoul/trunk/setup_win32.py
pymoul/trunk/src/moul/file/chatlog.py
pymoul/trunk/src/moul/file/plasmalog.py
Modified: pymoul/trunk/setup_win32.py
===================================================================
--- pymoul/trunk/setup_win32.py 2007-01-29 13:15:59 UTC (rev 97)
+++ pymoul/trunk/setup_win32.py 2007-01-29 18:46:30 UTC (rev 98)
@@ -78,8 +78,8 @@
pexe['upx_args'] = '--mono --best'
# InnoSetup
pexe['innosetup'] = os.environ.get('INNOSETUP') # TODO:
+ pexe['inno_templates'] = "template.iss"
pexe['app_name'] = 'pyMoul'
- # not required at the moment
pexe['includes'].extend(findPyTz())
kw['zipfile'] = 'library.zip'
Modified: pymoul/trunk/src/moul/file/chatlog.py
===================================================================
--- pymoul/trunk/src/moul/file/chatlog.py 2007-01-29 13:15:59 UTC (rev 97)
+++ pymoul/trunk/src/moul/file/chatlog.py 2007-01-29 18:46:30 UTC (rev 98)
@@ -16,6 +16,17 @@
# Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
"""Chat log parser
+
+Chatlog format
+==============
+
+(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) Error: ERRORMSG
+(MM/DD hh:mm:ss) USER: TEXT (note the two spaces!)
+(MM/DD hh:mm:ss) To USER: TEXT
+(MM/DD hh:mm:ss) USER action
"""
__author__ = "Christian Heimes"
__version__ = "$Id$"
@@ -23,22 +34,127 @@
import os
import re
-from glob import glob
+from fnmatch import fnmatch
+from stat import ST_MTIME
+from shutil import move
+from time import localtime
-CHAT_RE_TXT = r"^\((?P<M>\d{1,2})/(?P<D>\d{1,2})\ " \
- r"(?P<h>\d{1,2}):(?P<m>\d\d{1,2}):(?P<s>\d{1,2})\)" \
- r"(?P<space>\ {1,2})(?P<text>.*)$"
-CHAT_RE = re.compile(CHAT_RE_TXT)
+from moul.log import getLogger
+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
+CHAT_STARTED = "Chat.log started..."
+CHAT_STOPPED = "...Chat.log stopped."
+TEXT_MSGFROM = re.compile(
+ r"From (?P<user>.*) in (?P<location>.*): (?P<msg>.*)"
+ # From USER in LOCATION: msg
+ )
+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
+ )
+
+
+LOG = getLogger('moul.chat')
+
+def modtime(pathname):
+ """Modification time
+ """
+ return os.stat(pathname)[ST_MTIME]
+
class ChatlogMover(object):
"""
"""
+ _pat = "chat*.log"
+ _filename = "chatlog_%(sY)i%(sM)i%(sD)i_%(ch)i%(cm)i_%(sh)i%(sm)i.txt"
- def __init__(self, path, dest):
- self._path = path
- self._dest = dest
+ def __init__(self, srcdir, destdir):
+ self._path = srcdir
+ self._dest = destdir
self._logs = []
+ if not os.path.isdir(srcdir):
+ LOG.critical("%s is not a directory" % srcdir)
+ if not os.path.isdir(destdir):
+ LOG.info("Creating chatlog directory %s" % destdir)
+ os.mkdir(dest)
def findLogs(self):
- self._logs.append(os.path.join(self._path, 'chat*.log'))
+ """Find log files in self._path
+ Also calls and stores _findCreated(), modtime() and _makeFile()
+ for the file.
+ """
+ for file in os.listdir(self._path):
+ if not fnmatch(file, self._pat):
+ continue
+
+ fpath = os.path.join(self._path, file)
+ if not os.path.isfile(fpath):
+ continue
+ LOG.debug("Found chatlog %s" % fpath)
+ fd = open(fpath, 'r')
+ created = self._findCreated(fd)
+ if not created:
+ LOG.warning("Failed to parse chatlog %s" % fpath)
+ modtime = localtime(modtime(fpath))
+ newname = self._makeFilename(created, modtime)
+
+ details = {
+ 'fpath' : fpath,
+ 'filename' : file,
+ 'modtime' : localtime(modtime(fpath)),
+ 'created' : created,
+ 'newname' : newname,
+ 'newpath' : os.path.join(self._dest, newname),
+ }
+
+ self._logs.append(details)
+
+ def _findCreated(self, fd):
+ """Parse chatlog to find "started" date
+ """
+ created = None
+ while True:
+ line = fd.readline()
+ if not line:
+ break
+ mo = CHAT_RE.match(line)
+ if mo:
+ data = mo.groupdict()
+ if data['msg'].startswith(CHATLOG_STARTED):
+ created = (None, mo['M'], mo['D'], mo['h'], mo['m'],
+ mo['s'], None, None, None)
+ return created
+
+ def _makeFilename(self, created, stopped):
+ """Build a filename from created and stopped information
+ """
+ c, s = created, stopped
+ mapping = {
+ 'sY' : s['Y'], 'sM' : s['YM'], 'sD' : s['D'],
+ 'sh' : s['h'], 'sm' : s['m'], 'ss' : s['s'],
+ 'cM' : c['YM'], 'cD' : c['D'],
+ 'ch' : c['h'], 'cm' : c['m'], 'cs' : c['s'],
+ }
+ return self._filename % mapping
+
+ def moveChatlogs(self):
+ """Move chatlogs from old to new location and name
+ """
+ for details in self._logs:
+ old = details['fpath']
+ new = details['newpath']
+ if os.path.isfile(new):
+ LOG.warning("%s exists - overwriting" % new)
+ LOG.info("Move chatlog %s to %s" % (old, new))
+ move(old, new)
Modified: pymoul/trunk/src/moul/file/plasmalog.py
===================================================================
--- pymoul/trunk/src/moul/file/plasmalog.py 2007-01-29 13:15:59 UTC (rev 97)
+++ pymoul/trunk/src/moul/file/plasmalog.py 2007-01-29 18:46:30 UTC (rev 98)
@@ -25,76 +25,82 @@
from stat import ST_MTIME
import time
import zipfile
-import re
+from fnmatch import fnmatch
from moul.crypt.elf import decryptElf
PLASMA_LOG = "plasmalog.txt"
_marker = object()
-RE_SAFEEXT_TEXT = "\.(elf|txt|log|zip|jpg|jpeg)$"
-RE_SAFEXT = re.compile(RE_SAFEEXT_TEXT, re.IGNORECASE)
-def getTimeStamp(path):
- """Get time stamp yyyymmdd_hhmm based in the modification time
+class PlasmalogZipper(object):
+ """Zip plasma logs
"""
- sec = os.stat(path)[ST_MTIME]
- return time.strftime("%Y%m%d_%H%M", time.gmtime(sec))
+ _save_patterns = ['*.elf', '*.txt', '*.log', '*.zip', '*.jpg']
+
+ def __init__(self, srcdir, destdir):
+ self._srcdir = srcdir
+ self._destdir = destdir
-def isLogDir(path):
- """Check if a path is a valid plasma log directory
-
- Just checks for the plasmalog.txt file
-
- Returns either False or a time stamp
- """
- pl = os.path.join(path, PLASMA_LOG)
- if not os.path.isfile(pl):
- return False
- return getTimeStamp(pl)
-
-def zipLogDir(logdir, destdir, remove):
- """Zip all log files
-
- This function also zips subdirectories.
- """
- stored_dirs = []
-
- for root, dirs, files in os.walk(logdir):
- stamp = isLogDir(root)
- if not stamp:
- continue
- name = os.path.basename(root)
- zipname = "%s_%s.zip" % (name, stamp)
- zipfd = zipfile.ZipFile(os.path.join(destdir, zipname),
- 'w', zipfile.ZIP_DEFLATED)
- for file in files:
- if file.lower().startswith('chat.'):
- # omit chatlogs from the logs
+ def getTimeStamp(self, path):
+ """Get time stamp yyyymmdd_hhmm based in the modification time
+ """
+ sec = os.stat(path)[ST_MTIME]
+ return time.strftime("%Y%m%d_%H%M", time.localtime(sec))
+
+ def isLogDir(self, path):
+ """Check if a path is a valid plasma log directory
+
+ Just checks for the plasmalog.txt file
+
+ Returns either False or a time stamp
+ """
+ pl = os.path.join(path, PLASMA_LOG)
+ if not os.path.isfile(pl):
+ return False
+ return getTimeStamp(pl)
+
+ def zipLogDir(self):
+ """Zip all log files
+
+ This function also zips subdirectories.
+ """
+ stored_dirs = []
+
+ for root, dirs, files in os.walk(self._srcdir):
+ stamp = isLogDir(root)
+ if not stamp:
continue
- fname = os.path.join(root, file)
- arcname = os.path.join(name, file)
- zipfd.write(fname, arcname)
- #zipfd.printdir()
- zipfd.close()
- stored_dirs.append((root, zipname))
+ name = os.path.basename(root)
+ zipname = "%s_%s.zip" % (name, stamp)
+ zipfd = zipfile.ZipFile(os.path.join(self._destdir, zipname),
+ 'w', zipfile.ZIP_DEFLATED)
+ for file in files:
+ if file.lower().startswith('chat.'):
+ # omit chatlogs from the logs
+ continue
+ fname = os.path.join(root, file)
+ arcname = os.path.join(name, file)
+ zipfd.write(fname, arcname)
+ #zipfd.printdir()
+ zipfd.close()
+ stored_dirs.append((root, zipname))
- if remove:
- removeLogs(logdir)
+ return stored_dirs
- return stored_dirs
+ def removeLogs(self, logdir):
+ """Removes log directories
+
+ The removeLogs function removes only files considered as safe
+ """
+ for root, dirs, files in os.walk(logdir, topdown=False):
+ for name in files:
+ matches = [pat for pat in self._save_patterns
+ if fnmatch(basename, pat)]
+ if match:
+ os.remove(os.path.join(root, name))
+ else:
+ LOG.warning("Won't remove %s from %s" % (name, root))
+ for name in dirs:
+ os.rmdir(os.path.join(root, name))
-def removeLogs(logdir):
- """Removes log directories
-
- The removeLogs function removes only files considered as safe
- """
- for root, dirs, files in os.walk(logdir, topdown=False):
- for name in files:
- if RE_SAFEXT.search(name):
- os.remove(os.path.join(root, name))
- else:
- print name # XXX
- for name in dirs:
- os.rmdir(os.path.join(root, name))
-
- os.rmdir(logdir)
+ os.rmdir(logdir)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ti...@us...> - 2007-01-29 22:07:45
|
Revision: 99
http://pymoul.svn.sourceforge.net/pymoul/?rev=99&view=rev
Author: tiran
Date: 2007-01-29 14:07:42 -0800 (Mon, 29 Jan 2007)
Log Message:
-----------
First working implementation of log zipper and chatlog mover with unit tests
Modified Paths:
--------------
pymoul/trunk/Makefile.in
pymoul/trunk/src/moul/file/chatlog.py
pymoul/trunk/src/moul/file/plasmalog.py
pymoul/trunk/src/moul/file/tests/test_plasmalog.py
Modified: pymoul/trunk/Makefile.in
===================================================================
--- pymoul/trunk/Makefile.in 2007-01-29 18:46:30 UTC (rev 98)
+++ pymoul/trunk/Makefile.in 2007-01-29 22:07:42 UTC (rev 99)
@@ -59,11 +59,12 @@
doc: doc_html
clean:
- find . \( -name '*.o' -o -name '*.c' -o -name '*.so' -o -name '*.py[cod]' -o -name '*.dll' \) -exec rm -f {} \;
+ find . \( -name '*.o' -o -name '*~' -o -name '*.so' -o -name '*.py[cod]' -o -name '*.dll' \) -exec rm -f {} \;
rm -rf build
realclean: clean
rm -f TAGS
+ rm -rf dist
$(PYTHON) setup.py clean -a
propset:
Modified: pymoul/trunk/src/moul/file/chatlog.py
===================================================================
--- pymoul/trunk/src/moul/file/chatlog.py 2007-01-29 18:46:30 UTC (rev 98)
+++ pymoul/trunk/src/moul/file/chatlog.py 2007-01-29 22:07:42 UTC (rev 99)
@@ -45,8 +45,8 @@
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
-CHAT_STARTED = "Chat.log started..."
-CHAT_STOPPED = "...Chat.log stopped."
+CHATLOG_STARTED = "Chat.log started..."
+CHATLOG_STOPPED = "...Chat.log stopped."
TEXT_MSGFROM = re.compile(
r"From (?P<user>.*) in (?P<location>.*): (?P<msg>.*)"
# From USER in LOCATION: msg
@@ -76,17 +76,17 @@
"""
"""
_pat = "chat*.log"
- _filename = "chatlog_%(sY)i%(sM)i%(sD)i_%(ch)i%(cm)i_%(sh)i%(sm)i.txt"
+ _filename = "chatlog_%(sY)02i%(sM)02i%(sD)02i_%(ch)02i%(cm)02i_%(sh)02i%(sm)02i.txt"
def __init__(self, srcdir, destdir):
- self._path = srcdir
- self._dest = destdir
- self._logs = []
- if not os.path.isdir(srcdir):
- LOG.critical("%s is not a directory" % srcdir)
- if not os.path.isdir(destdir):
- LOG.info("Creating chatlog directory %s" % destdir)
- os.mkdir(dest)
+ self._path = srcdir
+ self._dest = destdir
+ self._logs = []
+ if not os.path.isdir(srcdir):
+ LOG.critical("%s is not a directory" % srcdir)
+ if not os.path.isdir(destdir):
+ LOG.info("Creating chatlog directory %s" % destdir)
+ os.mkdir(destdir)
def findLogs(self):
"""Find log files in self._path
@@ -95,7 +95,7 @@
for the file.
"""
for file in os.listdir(self._path):
- if not fnmatch(file, self._pat):
+ if not fnmatch(file.lower(), self._pat):
continue
fpath = os.path.join(self._path, file)
@@ -106,13 +106,13 @@
created = self._findCreated(fd)
if not created:
LOG.warning("Failed to parse chatlog %s" % fpath)
- modtime = localtime(modtime(fpath))
- newname = self._makeFilename(created, modtime)
+ mtime = localtime(modtime(fpath))
+ newname = self._makeFilename(created, mtime)
details = {
'fpath' : fpath,
'filename' : file,
- 'modtime' : localtime(modtime(fpath)),
+ 'modtime' : mtime,
'created' : created,
'newname' : newname,
'newpath' : os.path.join(self._dest, newname),
@@ -132,8 +132,9 @@
if mo:
data = mo.groupdict()
if data['msg'].startswith(CHATLOG_STARTED):
- created = (None, mo['M'], mo['D'], mo['h'], mo['m'],
- mo['s'], None, None, None)
+ d = mo.groupdict()
+ created = (None, int(d['M']), int(d['D']), int(d['h']),
+ int(d['m']), int(d['s']), None, None, None)
return created
def _makeFilename(self, created, stopped):
@@ -141,10 +142,10 @@
"""
c, s = created, stopped
mapping = {
- 'sY' : s['Y'], 'sM' : s['YM'], 'sD' : s['D'],
- 'sh' : s['h'], 'sm' : s['m'], 'ss' : s['s'],
- 'cM' : c['YM'], 'cD' : c['D'],
- 'ch' : c['h'], 'cm' : c['m'], 'cs' : c['s'],
+ 'sY' : s[0], 'sM' : s[1], 'sD' : s[2],
+ 'sh' : s[3], 'sm' : s[4], 'ss' : s[5],
+ 'cM' : c[1], 'cD' : c[2],
+ 'ch' : c[3], 'cm' : c[4], 'cs' : c[5],
}
return self._filename % mapping
@@ -158,3 +159,7 @@
LOG.warning("%s exists - overwriting" % new)
LOG.info("Move chatlog %s to %s" % (old, new))
move(old, new)
+
+ def __call__(self):
+ self.findLogs()
+ self.moveChatlogs()
Modified: pymoul/trunk/src/moul/file/plasmalog.py
===================================================================
--- pymoul/trunk/src/moul/file/plasmalog.py 2007-01-29 18:46:30 UTC (rev 98)
+++ pymoul/trunk/src/moul/file/plasmalog.py 2007-01-29 22:07:42 UTC (rev 99)
@@ -28,8 +28,11 @@
from fnmatch import fnmatch
from moul.crypt.elf import decryptElf
+from moul.log import getLogger
PLASMA_LOG = "plasmalog.txt"
+
+LOG = getLogger('moul.plasma')
_marker = object()
class PlasmalogZipper(object):
@@ -40,38 +43,52 @@
def __init__(self, srcdir, destdir):
self._srcdir = srcdir
self._destdir = destdir
+ self._zipped_dirs = {} # dirname -> zipfile
+ self._not_removed = [] # files with full path
- def getTimeStamp(self, path):
+ if not os.path.isdir(srcdir):
+ LOG.critical("%s is not a directory" % srcdir)
+ if not self.isPlasmaLogDir():
+ self._ispldir = False
+ LOG.critical("%s is not a plasma log directory" % srcdir)
+ else:
+ self._ispldir = True
+ if not os.path.isdir(destdir):
+ LOG.info("Creating chatlog directory %s" % destdir)
+ os.mkdir(destdir)
+
+ @staticmethod
+ def getTimeStamp(path):
"""Get time stamp yyyymmdd_hhmm based in the modification time
"""
sec = os.stat(path)[ST_MTIME]
return time.strftime("%Y%m%d_%H%M", time.localtime(sec))
-
- def isLogDir(self, path):
+
+ def isPlasmaLogDir(self, path=None):
"""Check if a path is a valid plasma log directory
-
+
Just checks for the plasmalog.txt file
-
Returns either False or a time stamp
"""
+ if path is None:
+ path = self._srcdir
pl = os.path.join(path, PLASMA_LOG)
if not os.path.isfile(pl):
return False
- return getTimeStamp(pl)
+ return self.getTimeStamp(pl)
def zipLogDir(self):
"""Zip all log files
This function also zips subdirectories.
"""
- stored_dirs = []
-
for root, dirs, files in os.walk(self._srcdir):
- stamp = isLogDir(root)
+ stamp = self.isPlasmaLogDir(root)
if not stamp:
continue
name = os.path.basename(root)
zipname = "%s_%s.zip" % (name, stamp)
+ self._zipped_dirs[name] = zipname
zipfd = zipfile.ZipFile(os.path.join(self._destdir, zipname),
'w', zipfile.ZIP_DEFLATED)
for file in files:
@@ -83,24 +100,27 @@
zipfd.write(fname, arcname)
#zipfd.printdir()
zipfd.close()
- stored_dirs.append((root, zipname))
- return stored_dirs
+ def removeLogs(self):
+ """Removes log directories
- def removeLogs(self, logdir):
- """Removes log directories
-
The removeLogs function removes only files considered as safe
"""
- for root, dirs, files in os.walk(logdir, topdown=False):
+ 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(basename, pat)]
- if match:
- os.remove(os.path.join(root, name))
+ if fnmatch(name, pat)]
+ fpath = os.path.join(root, name)
+ if matches:
+ os.remove(fpath)
else:
+ self._not_removed.append(fpath)
LOG.warning("Won't remove %s from %s" % (name, root))
for name in dirs:
os.rmdir(os.path.join(root, name))
- os.rmdir(logdir)
+ os.rmdir(self._srcdir)
+
+ def __call__(self):
+ self.zipLogDir()
+ self.removeLogs()
Modified: pymoul/trunk/src/moul/file/tests/test_plasmalog.py
===================================================================
--- pymoul/trunk/src/moul/file/tests/test_plasmalog.py 2007-01-29 18:46:30 UTC (rev 98)
+++ pymoul/trunk/src/moul/file/tests/test_plasmalog.py 2007-01-29 22:07:42 UTC (rev 99)
@@ -24,10 +24,102 @@
import unittest
from doctest import DocTestSuite
-import moul.file.plasmalog
+import os
+import shutil
+from tempfile import mkdtemp
+from moul.file.plasmalog import PlasmalogZipper
+from moul.file.chatlog import ChatlogMover
+
+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 _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, '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._chatdest = os.path.join(self._tmpdir, 'Chatlogs')
+ self._logdest = os.path.join(self._tmpdir, 'ZippedLogs')
+ self._logdir = os.path.join(self._tmpdir, 'Logs')
+ _fakeUruLiveDir(self._tmpdir)
+ self._clm = ChatlogMover(self._logdir, self._chatdest)
+ self._plz = PlasmalogZipper(self._logdir, self._logdest)
+
+ def test_createDir(self):
+ 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)
+ content.sort()
+ self.failUnlessEqual(len(content), 2, content)
+ self.failUnless(content[0].startswith("Logs_"), content[0])
+ self.failUnless(content[1].startswith("faketest_"), content[1])
+
+ plz.removeLogs()
+ self.failIf(os.path.isdir(self._logdir))
+
+ def test_chatLogMover(self):
+ clm = self._clm
+ clm.findLogs()
+ clm.moveChatlogs()
+ content = os.listdir(self._chatdest)
+ self.failUnlessEqual(len(content), 1, content)
+ length = len("chatlog_20070129_0304_2302.txt")
+ c = content[0]
+ self.failUnless(c.startswith("chatlog_"))
+ self.failUnless(c.endswith(".txt"))
+ self.failUnlessEqual(len(c), length, c)
+
+ def tearDown(self):
+ shutil.rmtree(self._tmpdir)
+
def test_suite():
return unittest.TestSuite((
+ unittest.makeSuite(PlasmaChatTest),
DocTestSuite('moul.file.plasmalog')
))
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)
+
+ spacerI...
[truncated message content] |
|
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-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 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: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 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-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-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 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. ...
[truncated message content] |
|
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')
cl...
[truncated message content] |
|
From: <ti...@us...> - 2007-02-05 03:04:22
|
Revision: 135
http://pymoul.svn.sourceforge.net/pymoul/?rev=135&view=rev
Author: tiran
Date: 2007-02-04 19:04:23 -0800 (Sun, 04 Feb 2007)
Log Message:
-----------
UI reneval
updates languages
added not implemented infos
Modified Paths:
--------------
pymoul/trunk/doc/XXXreport.html
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
pymoul/trunk/src/moul/qt/localization.py
pymoul/trunk/src/moul/qt/mainwindow.py
pymoul/trunk/src/moul/qt/ui/mainwindow.py
pymoul/trunk/src/moul/qt/ui/mainwindow.ui
pymoul/trunk/src/moul/qt/utils.py
Modified: pymoul/trunk/doc/XXXreport.html
===================================================================
--- pymoul/trunk/doc/XXXreport.html 2007-02-05 00:33:55 UTC (rev 134)
+++ pymoul/trunk/doc/XXXreport.html 2007-02-05 03:04:23 UTC (rev 135)
@@ -3,19 +3,15 @@
<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>
+<p>Generated on Mon, 05 Feb 2007 03:58:55 CET, based on Zope 3's XXX report</p>
<hr>
<h3>Summary</h3>
<p>
- There are currently 100 XXX/TODO/FIXME comments.
+ There are currently 94 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
+<ol><li><b>File: utilities/../.svn/text-base/test.py.svn-base:548</b><br/><pre> # XXX bug: doctest may report several failures in one test, they are
base-549- # separated by a horizontal dash line. Only the first one of
base-550- # them is now colorized properly.
base-551- header = lines[0]
@@ -31,16 +27,8 @@
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/chatlog.py.svn-base:280</b><br/><pre> # TODO: add parser, currently simply iterates over the file
+base-281- 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
@@ -49,55 +37,59 @@
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
+</pre></li><li><b>File: utilities/../src/moul/file/.svn/text-base/kiimage.py.svn-base:267</b><br/><pre> # XXX: move checks to copy method!
+base-268- if os.path.isfile(fixed):
+base-269- if fixedNewer(ki, fixed):
+base-270- LOG.debug("File %s exists but was changed." % name)
+</pre></li><li><b>File: utilities/../src/moul/file/.svn/text-base/wdysini.py.svn-base:157</b><br/><pre> # TODO: write me
+base-158- pass
+base-159-
+base-160-class Constrain(object):
+</pre></li><li><b>File: utilities/../src/moul/file/.svn/text-base/wdysini.py.svn-base:541</b><br/><pre> 'Audio.SetDeviceName' : (QuotedString, Constrain()), # TODO: add check
+base-542- 'Audio.SetChannelVolume GUI' : (FloatString, MinMax(0.0, 1.0)), # 0-100%, no ui
+base-543- # microphon missing -> OS mixer
+base-544- }
+</pre></li><li><b>File: utilities/../src/moul/file/.svn/text-base/wdysini.py.svn-base:629</b><br/><pre> # TODO: microphon needs an extra handler. The mic slider changes the OS mixer.
+base-630-
+base-631-class GraphicsIni(ConfFile):
+base-632- _filename = 'graphics.ini'
+</pre></li><li><b>File: utilities/../src/moul/file/.svn/text-base/directory.py.svn-base:59</b><br/><pre> # TODO: fnmatch
+base-60- return len([name for name in os.listdir(path)
+base-61- if os.path.isfile(os.path.join(path, name))])
+base-62-
+</pre></li><li><b>File: utilities/../src/moul/file/tests/.svn/text-base/test_wdysini.py.svn-base:105</b><br/><pre> # TODO: more
+base-106-
+base-107- def test_publicapi_create(self):
+base-108- 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:116</b><br/><pre> # TODO: more
+base-117-
+base-118-class AudioIniTest(GenericIniTest):
+base-119- enc = aud_enc
+</pre></li><li><b>File: utilities/../src/moul/file/tests/.svn/text-base/test_wdysini.py.svn-base:154</b><br/><pre> #XXX self.failIf(p.isChanged())
+base-155-
+base-156- p.screenres = 0
+base-157- eq(p._get('Graphics.Width'), 800)
+</pre></li><li><b>File: utilities/../src/moul/file/tests/.svn/text-base/utils.py.svn-base:80</b><br/><pre> for fname in ('UruLauncher.exe', 'UruExplorer.exe'): # XXX: win32
+base-81- fd = open(os.path.join(path, fname), 'wb')
+base-82- fd.write('dummy')
+base-83- fd.close()
+</pre></li><li><b>File: utilities/../src/moul/file/tests/test_wdysini.py:105</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
+</pre></li><li><b>File: utilities/../src/moul/file/tests/test_wdysini.py:116</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())
+</pre></li><li><b>File: utilities/../src/moul/file/tests/test_wdysini.py:154</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
+</pre></li><li><b>File: utilities/../src/moul/file/tests/utils.py:80</b><br/><pre> for fname in ('UruLauncher.exe', 'UruExplorer.exe'): # XXX: win32
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
+</pre></li><li><b>File: utilities/../src/moul/file/chatlog.py:280</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:
@@ -107,15 +99,19 @@
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
+</pre></li><li><b>File: utilities/../src/moul/file/kiimage.py:267</b><br/><pre> # XXX: move checks to copy method!
+ if os.path.isfile(fixed):
+ if fixedNewer(ki, fixed):
+ LOG.debug("File %s exists but was changed." % name)
+</pre></li><li><b>File: utilities/../src/moul/file/wdysini.py:157</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
+</pre></li><li><b>File: utilities/../src/moul/file/wdysini.py:541</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.
+</pre></li><li><b>File: utilities/../src/moul/file/wdysini.py:629</b><br/><pre> # TODO: microphon needs an extra handler. The mic slider changes the OS mixer.
class GraphicsIni(ConfFile):
_filename = 'graphics.ini'
@@ -127,7 +123,11 @@
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
+</pre></li><li><b>File: utilities/../src/moul/file/kiimage.py~:267</b><br/><pre> # XXX: move checks to copy method!
+ if os.path.isfile(fixed):
+ if fixedNewer(ki, fixed):
+ LOG.debug("File %s exists but was changed." % name)
+</pre></li><li><b>File: utilities/../src/moul/file/chatlog.py~:280</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
@@ -141,189 +141,558 @@
class GraphicsIni(ConfFile):
_filename = 'graphics.ini'
-</pre></li><li><b>File: utilities/../src/moul/file/directory.py:58</b><br/><pre> # TODO: fnmatch
+</pre></li><li><b>File: utilities/../src/moul/file/directory.py:59</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
+</pre></li><li><b>File: utilities/../src/moul/file/directory.py~:59</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:77</b><br/><pre> # XXX: dos format
+base-78- return data.replace("\r\n", "\n")
+base-79-
+base-80-def encryptWDYS(instr, fout):
+</pre></li><li><b>File: utilities/../src/moul/crypt/.svn/text-base/whatdoyousee.py.svn-base:87</b><br/><pre> # XXX: dos format
+base-88- instr = instr.replace("\n", "\r\n")
+base-89- fout.seek(0)
+base-90- fout.write(HEADER)
+</pre></li><li><b>File: utilities/../src/moul/crypt/.svn/text-base/elf.py.svn-base:71</b><br/><pre> # XXX NotImplemented
+base-72- raise NotImplementedError
+base-73-
+base-74-def decipher(crypt, size, key):
+</pre></li><li><b>File: utilities/../src/moul/crypt/whatdoyousee.py:77</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
+</pre></li><li><b>File: utilities/../src/moul/crypt/whatdoyousee.py:87</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
+</pre></li><li><b>File: utilities/../src/moul/crypt/elf.py:71</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/mainwindow.py.svn-base:151</b><br/><pre> # FIXME: signal doesn't do anything
+base-152- self.emit(SIGNAL("close()"))
+base-153- event.accept()
+base-154- event.ignore()
+</pre></li><li><b>File: utilities/../src/moul/qt/.svn/text-base/mainwindow.py.svn-base:222</b><br/><pre> # TODO: msg
+base-223- return
+base-224-
+base-225- self.pb_kiimage_repair.setEnabled(False)
+</pre></li><li><b>File: utilities/../src/moul/qt/.svn/text-base/mainwindow.py.svn-base:248</b><br/><pre> del self._kiimage_threadlet# TODO: other message box
+base-249- del self._kiimage_progressbar
+base-250- self.pb_kiimage_repair.setEnabled(True)
+base:251: # TODO: msg
+base-252-
+base-253- # ************************************************************************
+base-254- # system tray
+</pre></li><li><b>File: utilities/../src/moul/qt/.svn/text-base/mainwindow.py.svn-base:281</b><br/><pre> # TODO: needs optimization? run only when timer tab is active
+base-282- self.connect(timer, SIGNAL('timeout()'), self.on_timezone_timer_timeout)
+base-283- timer.start()
+base-284-
+</pre></li><li><b>File: utilities/../src/moul/qt/.svn/text-base/mainwindow.py.svn-base:375</b><br/><pre> # TODO: thread safety!
+base-376- self.servers = servers
+base-377- if not self.isRunning():
+base-378- self.start()
+</pre></li><li><b>File: utilities/../src/moul/qt/.svn/text-base/mainwindow.py.svn-base:381</b><br/><pre> # TODO: thread safety!
+base-382- # emit a list of names first
+base-383- for server in self.servers:
+base-384- self.emit(SIGNAL("server(const QString&)"), server.name)
+</pre></li><li><b>File: utilities/../src/moul/qt/.svn/text-base/mainwindow.py.svn-base:417</b><br/><pre> # TODO check this
+base-418- self._running = False
+base-419- self.condition.wakeAll()
+base-420-
</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
+base-48- if not getattr(sys, 'frozen', False):
+base-49- return
+</pre></li><li><b>File: utilities/../src/moul/qt/.svn/text-base/wdysini.py.svn-base:67</b><br/><pre> self.context.emit(SIGNAL("audioini_load()")) # XXX: hard coded emit
+base:68: self.context.emit(SIGNAL("graphicsini_load()")) # XXX: hard coded emit
+base-69-
+base-70- @pyqtSignature("bool")
+base-71- def on_graphicsChanged(self, boolean):
+</pre></li><li><b>File: utilities/../src/moul/qt/mainwindow.py~:143</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
+</pre></li><li><b>File: utilities/../src/moul/qt/mainwindow.py~:214</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
+</pre></li><li><b>File: utilities/../src/moul/qt/mainwindow.py~:241</b><br/><pre> del self._kiimage_threadlet# TODO: other message box
+ del self._kiimage_progressbar
+ self.pb_kiimage_repair.setEnabled(True)
- @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
+ @pyqtSignature("")
+ def on_pb_log_archive_clicked(self):
+</pre></li><li><b>File: utilities/../src/moul/qt/mainwindow.py~:288</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!
+</pre></li><li><b>File: utilities/../src/moul/qt/mainwindow.py~:382</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!
+</pre></li><li><b>File: utilities/../src/moul/qt/mainwindow.py~:388</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
+</pre></li><li><b>File: utilities/../src/moul/qt/mainwindow.py~:424</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
+</pre></li><li><b>File: utilities/../src/moul/qt/mainwindow.py:143</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
+</pre></li><li><b>File: utilities/../src/moul/qt/mainwindow.py:214</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
+</pre></li><li><b>File: utilities/../src/moul/qt/mainwindow.py:241</b><br/><pre> del self._kiimage_threadlet# TODO: other message box
+ del self._kiimage_progressbar
+ self.pb_kiimage_repair.setEnabled(True)
- # ************************************************************************
- # 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
+ @pyqtSignature("")
+ def on_pb_log_archive_clicked(self):
+</pre></li><li><b>File: utilities/../src/moul/qt/mainwindow.py:288</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!
+</pre></li><li><b>File: utilities/../src/moul/qt/mainwindow.py:382</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!
+</pre></li><li><b>File: utilities/../src/moul/qt/mainwindow.py:388</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
+</pre></li><li><b>File: utilities/../src/moul/qt/mainwindow.py:424</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?
+ if not getattr(sys, 'frozen', False):
+ return
+</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))
+ if not getattr(sys, 'frozen', False):
+ return
+</pre></li><li><b>File: utilities/../src/moul/qt/wdysini.py~:68</b><br/><pre> self.context.emit(SIGNAL("audioini_load()")) # XXX: hard coded emit
+
+ @signalLogDecorator(LOG)
+ @pyqtSignature("bool")
+</pre></li><li><b>File: utilities/../src/moul/qt/wdysini.py:67</b><br/><pre> self.context.emit(SIGNAL("audioini_load()")) # XXX: hard coded emit
+
+ @pyqtSignature("bool")
+ def on_graphicsChanged(self, boolean):
+</pre></li><li><b>File: utilities/../src/moul/osdependent/__init__.py:117</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...
[truncated message content] |
|
From: <ti...@us...> - 2007-02-05 14:03:10
|
Revision: 139
http://pymoul.svn.sourceforge.net/pymoul/?rev=139&view=rev
Author: tiran
Date: 2007-02-05 06:03:09 -0800 (Mon, 05 Feb 2007)
Log Message:
-----------
Added make serverlist command
Updated serverlist: removed bogus tests
Modified Paths:
--------------
pymoul/trunk/Makefile.in
pymoul/trunk/src/moul/server/ping.py
pymoul/trunk/src/moul/server/serverlist.py
Modified: pymoul/trunk/Makefile.in
===================================================================
--- pymoul/trunk/Makefile.in 2007-02-05 04:14:41 UTC (rev 138)
+++ pymoul/trunk/Makefile.in 2007-02-05 14:03:09 UTC (rev 139)
@@ -97,3 +97,6 @@
importchecker:
$(PYTHON) utilities/importchecker.py ./src/moul/
+serverlist:
+ PYTHONPATH="src" $(PYTHON) src/moul/server/serverlist.py
+
Modified: pymoul/trunk/src/moul/server/ping.py
===================================================================
--- pymoul/trunk/src/moul/server/ping.py 2007-02-05 04:14:41 UTC (rev 138)
+++ pymoul/trunk/src/moul/server/ping.py 2007-02-05 14:03:09 UTC (rev 139)
@@ -32,7 +32,7 @@
"""A server object
"""
- def __init__(self, name, port, timeout=3.0):
+ def __init__(self, name, port=PORT, timeout=3.0):
self._name = name
self._port = int(port)
self._timeout = float(timeout)
Modified: pymoul/trunk/src/moul/server/serverlist.py
===================================================================
--- pymoul/trunk/src/moul/server/serverlist.py 2007-02-05 04:14:41 UTC (rev 138)
+++ pymoul/trunk/src/moul/server/serverlist.py 2007-02-05 14:03:09 UTC (rev 139)
@@ -43,8 +43,6 @@
'uruapp-cw15.ibs.aol.com',
'uruapp-cw16.ibs.aol.com',
'uruapp-cw17.ibs.aol.com',
- 'bogus.test.example', # no DNS
- 'www.urulive.com', # no PING
## The servers below are available via ICMP ping but have no running game
## server (2006-01-17)
#'uruapp-cw18.ibs.aol.com',
@@ -53,3 +51,24 @@
#'uruapp-cw21.ibs.aol.com',
#'uruapp-cw22.ibs.aol.com',
]
+
+def _ping():
+ """Search for new servers
+ """
+ from moul.server.ping import Server
+ new = []
+ for i in range(1, 25):
+ name = 'uruapp-cw%02i.ibs.aol.com' % i
+ srv = Server(name)
+ dns = srv.dns()
+ pp = srv.portping()
+ print name, dns, pp
+ if isinstance(dns, float) and isinstance(pp, float) and \
+ name not in SERVER_LIST:
+ new.append(name)
+ print "\nNew servers found:\n"
+ for name in new:
+ print " '%s'," % name
+
+if __name__ == '__main__':
+ _ping()
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ti...@us...> - 2007-02-06 03:51:22
|
Revision: 144
http://pymoul.svn.sourceforge.net/pymoul/?rev=144&view=rev
Author: tiran
Date: 2007-02-05 19:51:21 -0800 (Mon, 05 Feb 2007)
Log Message:
-----------
Added translation resource
added more messages to KI image and ini configurator
Modified Paths:
--------------
pymoul/trunk/Makefile.in
pymoul/trunk/src/moul/file/kiimage.py
pymoul/trunk/src/moul/file/wdysini.py
pymoul/trunk/src/moul/qt/i18n/pymoul_de.qm
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
pymoul/trunk/src/moul/qt/mainwindow.py
pymoul/trunk/src/moul/qt/moulqt.py
pymoul/trunk/src/moul/qt/ui/mainwindow.py
pymoul/trunk/src/moul/qt/ui/mainwindow.ui
pymoul/trunk/src/moul/qt/utils.py
pymoul/trunk/src/moul/qt/wdysini.py
Added Paths:
-----------
pymoul/trunk/src/moul/qt/i18n/__init__.py
pymoul/trunk/src/moul/qt/i18n/translations.qrc
pymoul/trunk/src/moul/qt/i18n/translations_rc.py
Modified: pymoul/trunk/Makefile.in
===================================================================
--- pymoul/trunk/Makefile.in 2007-02-05 16:48:00 UTC (rev 143)
+++ pymoul/trunk/Makefile.in 2007-02-06 03:51:21 UTC (rev 144)
@@ -84,7 +84,11 @@
for L in $(LANGS); do \
pylupdate4 `$(FINDQT)` -ts src/moul/qt/i18n/pymoul_$${L}.ts;\
lrelease src/moul/qt/i18n/pymoul_$${L}.ts; \
- done
+ done
+ rm src/moul/qt/i18n/translations_rc.py
+ # do not compress qm files so the translator can load it
+ pyrcc4 -no-compress -o ./src/moul/qt/i18n/translations_rc.py \
+ ./src/moul/qt/i18n/translations.qrc
hash:
cd dist && $(FINDHASH) | xargs md5sum >md5.txt
Modified: pymoul/trunk/src/moul/file/kiimage.py
===================================================================
--- pymoul/trunk/src/moul/file/kiimage.py 2007-02-05 16:48:00 UTC (rev 143)
+++ pymoul/trunk/src/moul/file/kiimage.py 2007-02-06 03:51:21 UTC (rev 144)
@@ -265,14 +265,17 @@
fixed = self.mkFixedName(root, name, self._destdir)
self._found.append(ki)
# XXX: move checks to copy method!
- if os.path.isfile(fixed):
+ if not os.path.isfile(fixed):
+ self._tocheck.append((ki, fixed))
+ continue
+ else:
if fixedNewer(ki, fixed):
LOG.debug("File %s exists but was changed." % name)
self._tocheck.append((ki, fixed))
+ continue
else:
LOG.debug("File %s exists and is fixed." % name)
- else:
- self._tocheck.append((ki, fixed))
+ continue
return self._tocheck
def checkAndCopyFile(self, kiname, fixedname):
Modified: pymoul/trunk/src/moul/file/wdysini.py
===================================================================
--- pymoul/trunk/src/moul/file/wdysini.py 2007-02-05 16:48:00 UTC (rev 143)
+++ pymoul/trunk/src/moul/file/wdysini.py 2007-02-06 03:51:21 UTC (rev 144)
@@ -370,15 +370,25 @@
dirname = os.path.dirname(self._fpath)
if not os.path.isdir(dirname):
LOG.info("Creating directory %s" % dirname)
- os.mkdir(dirname)
+ os.makedirs(dirname)
# Create a dummy file
fd = open(self._fpath, 'w')
fd.write("Created by pyMoul")
fd.close()
self._opened = True
+ self.clear()
for key, value in self._defaults.items():
+ self._order.append(key)
self._filedata[key] = value
- self.reset()
+ self._newdata[key] = value
+ self.write()
+ self.close()
+
+ def close(self):
+ """Close file and clear data
+ """
+ self._opened = False
+ self.clear()
def write(self):
"""Write data to file
@@ -453,8 +463,11 @@
self._filedata[newkey] = value
break
if not found:
- raise ValueError(line)
+ raise ValueError("Unknown line %s" % line)
+ for key in self._options:
+ if key not in self._filedata:
+ raise ValueError("Key is missing in file %s" % key)
self.reset()
self._parserDoneHook()
@@ -531,7 +544,7 @@
_options = {
'Audio.Initialize' : (BoolString, Constrain()), # true/false, no ui
'Audio.UseEAX' : (BoolString, Constrain()), # true/false
- 'Audio.SetPriorityCutoff' : (int, Constrain()), # ???
+ 'Audio.SetPriorityCutoff' : (int, MinMax(0, 100)), # ???
'Audio.MuteAll' : (int, MinMax(0, 1)), # 0, 1
'Audio.SetChannelVolume SoundFX' : (FloatString, MinMax(0.0, 1.0)), # 0-100%
'Audio.SetChannelVolume BgndMusic' : (FloatString, MinMax(0.0, 1.0)), # 0-100%
@@ -545,7 +558,7 @@
_defaults = {
'Audio.Initialize' : BoolString(True),
'Audio.UseEAX' : BoolString(False),
- 'Audio.SetPriorityCutoff' : 6,
+ 'Audio.SetPriorityCutoff' : 80,
'Audio.MuteAll' : 0, # 0, 1
'Audio.SetChannelVolume SoundFX' : FloatString(1.0),
'Audio.SetChannelVolume BgndMusic' : FloatString(1.0),
Added: pymoul/trunk/src/moul/qt/i18n/__init__.py
===================================================================
--- pymoul/trunk/src/moul/qt/i18n/__init__.py (rev 0)
+++ pymoul/trunk/src/moul/qt/i18n/__init__.py 2007-02-06 03:51:21 UTC (rev 144)
@@ -0,0 +1,25 @@
+# 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.i18n
+"""
+__author__ = "Christian Heimes"
+__version__ = "$Id: __init__.py 108 2007-01-31 14:46:54Z tiran $"
+__revision__ = "$Revision: 108 $"
+
Modified: pymoul/trunk/src/moul/qt/i18n/pymoul_de.qm
===================================================================
(Binary files differ)
Modified: pymoul/trunk/src/moul/qt/i18n/pymoul_de.ts
===================================================================
--- pymoul/trunk/src/moul/qt/i18n/pymoul_de.ts 2007-02-05 16:48:00 UTC (rev 143)
+++ pymoul/trunk/src/moul/qt/i18n/pymoul_de.ts 2007-02-06 03:51:21 UTC (rev 144)
@@ -37,15 +37,15 @@
<name>MainWindow</name>
<message>
<source>Windowed</source>
- <translation type="unfinished">Im Fenster</translation>
+ <translation>Im Fenster</translation>
</message>
<message>
<source>Display Shadows</source>
- <translation type="unfinished">Zeige Schatten</translation>
+ <translation>Zeige Schatten</translation>
</message>
<message>
<source>Screen Resolution</source>
- <translation type="unfinished">Auflösung</translation>
+ <translation>Auflösung</translation>
</message>
<message>
<source>800x600 (4:3)</source>
@@ -53,107 +53,107 @@
</message>
<message>
<source>Quality</source>
- <translation type="unfinished">Qualität</translation>
+ <translation>Qualität</translation>
</message>
<message>
<source>Texture Quality</source>
- <translation type="unfinished">Texturequalität</translation>
+ <translation>Texturequalität</translation>
</message>
<message>
<source>Low</source>
- <translation type="unfinished">Niedrig</translation>
+ <translation>Niedrig</translation>
</message>
<message>
<source>High</source>
- <translation type="unfinished">Hoch</translation>
+ <translation>Hoch</translation>
</message>
<message>
<source>Anti-Aliasing</source>
- <translation type="unfinished">Anti Alias</translation>
+ <translation>Anti Alias</translation>
</message>
<message>
<source>Graphics Quality</source>
- <translation type="unfinished">Grafikqualität</translation>
+ <translation>Grafikqualität</translation>
</message>
<message>
<source>Med.</source>
- <translation type="unfinished">Med.</translation>
+ <translation>Med.</translation>
</message>
<message>
<source>Ultra</source>
- <translation type="unfinished">Ultra</translation>
+ <translation>Ultra</translation>
</message>
<message>
<source>Shadow Quality</source>
- <translation type="unfinished">Schattenqualität</translation>
+ <translation>Schattenqualität</translation>
</message>
<message>
<source>Anisotropic-Filtering</source>
- <translation type="unfinished">Anisotropischer Filter</translation>
+ <translation>Anisotropischer Filter</translation>
</message>
<message>
<source>Graphics</source>
- <translation type="unfinished">Grafik</translation>
+ <translation>Grafik</translation>
</message>
<message>
<source>Level</source>
- <translation type="unfinished">Level</translation>
+ <translation>Level</translation>
</message>
<message>
<source>NPC Voices</source>
- <translation type="unfinished">NSC Stimmen</translation>
+ <translation>NSC Stimmen</translation>
</message>
<message>
<source>Sound FX</source>
- <translation type="unfinished"></translation>
+ <translation></translation>
</message>
<message>
<source>Ambience Sound</source>
- <translation type="unfinished">Hintergrundgeräusche</translation>
+ <translation>Hintergrundgeräusche</translation>
</message>
<message>
<source>Music</source>
- <translation type="unfinished">Musik</translation>
+ <translation>Musik</translation>
</message>
<message>
<source>Mute all</source>
- <translation type="unfinished">Alles stumm</translation>
+ <translation>Alles stumm</translation>
</message>
<message>
<source>Hardware</source>
- <translation type="unfinished">Hardware</translation>
+ <translation>Hardware</translation>
</message>
<message>
<source>Generic Software</source>
- <translation type="unfinished"></translation>
+ <translation></translation>
</message>
<message>
<source>Enable EAX</source>
- <translation type="unfinished">Aktivier EAX</translation>
+ <translation>Aktivier EAX</translation>
</message>
<message>
<source>Voice chat</source>
- <translation type="unfinished">Voice Chat</translation>
+ <translation>Voice Chat</translation>
</message>
<message>
<source>Enable Voice Chat</source>
- <translation type="unfinished">Aktiviere Voice Chat</translation>
+ <translation>Aktiviere Voice Chat</translation>
</message>
<message>
<source>Audio</source>
- <translation type="unfinished">Audio</translation>
+ <translation>Audio</translation>
</message>
<message>
<source>Time zones</source>
- <translation type="unfinished">Zeitzonen</translation>
+ <translation>Zeitzonen</translation>
</message>
<message>
<source>Cavern time:</source>
- <translation type="unfinished">Höhlenzeit</translation>
+ <translation>Höhlenzeit:</translation>
</message>
<message>
<source>Cyan time:</source>
- <translation type="unfinished">Cyan Zeit</translation>
+ <translation>Cyan Zeit:</translation>
</message>
<message>
<source>UTC -0</source>
@@ -161,166 +161,151 @@
</message>
<message>
<source>Ping servers</source>
- <translation type="unfinished">Server anpingen</translation>
+ <translation>Server anpingen</translation>
</message>
<message>
<source>Ping</source>
- <translation type="unfinished">Ping</translation>
+ <translation>Ping</translation>
</message>
<message>
<source>Servers</source>
- <translation type="unfinished">Server</translation>
+ <translation>Server</translation>
</message>
<message>
<source>Age</source>
- <translation type="unfinished">Zeitalter</translation>
+ <translation>Zeitalter</translation>
</message>
<message>
<source>Element</source>
- <translation type="unfinished">Element</translation>
+ <translation>Element</translation>
</message>
<message>
<source>Language</source>
- <translation type="unfinished">Sprache</translation>
+ <translation>Sprache</translation>
</message>
<message>
<source>Set</source>
- <translation type="unfinished">Set</translation>
+ <translation>Set</translation>
</message>
<message>
<source>About</source>
- <translation type="unfinished">Über</translation>
+ <translation>Über</translation>
</message>
<message>
<source>MOUL is running</source>
- <translation type="unfinished">MOUL läuft</translation>
+ <translation>MOUL läuft</translation>
</message>
<message>
<source>MOUL</source>
- <translation type="unfinished">MOUL</translation>
+ <translation>MOUL</translation>
</message>
<message>
<source>MOUL is not running</source>
- <translation type="unfinished">MOUL läuft nicht</translation>
+ <translation>MOUL läuft nicht</translation>
</message>
<message>
<source>Chat and debug logs</source>
- <translation type="unfinished">Chat- und Fehlerlogs</translation>
+ <translation>Chat- und Fehlerlogs</translation>
</message>
<message>
<source>Archive chatlogs and zip log files</source>
- <translation type="unfinished">Archiviere Chatlogs und packe Logdateien</translation>
+ <translation>Archiviere Chatlogs und packe Logdateien</translation>
</message>
<message>
<source>Remove zipped logs</source>
- <translation type="unfinished">Entferne gepackte Logs</translation>
+ <translation>Entferne gepackte Logs</translation>
</message>
<message>
<source>Remove</source>
- <translation type="unfinished">Entferne</translation>
+ <translation>Entferne</translation>
</message>
<message>
<source>Archive</source>
- <translation type="unfinished">Archiviere</translation>
+ <translation>Archiviere</translation>
</message>
<message>
<source>Zip debug logs</source>
- <translation type="unfinished">Packe Debuglogs</translation>
+ <translation>Packe Debuglogs</translation>
</message>
<message>
<source>Delete debug logs</source>
- <translation type="unfinished">Lösche Debuglogs</translation>
+ <translation>Lösche Debuglogs</translation>
</message>
<message>
<source>KI Image repair</source>
- <translation type="unfinished">Repariere KI Bilder</translation>
+ <translation>Repariere KI Bilder</translation>
</message>
<message>
<source>Repair</source>
- <translation type="unfinished">Repareiere</translation>
+ <translation>Repareiere</translation>
</message>
<message>
<source>Fix KI and avatar images</source>
- <translation type="unfinished">Repariert KI- und Avatarbilder</translation>
+ <translation>Repariert KI- und Avatarbilder</translation>
</message>
<message>
<source>Tasks</source>
- <translation type="unfinished">Aufgaben</translation>
+ <translation>Aufgaben</translation>
</message>
<message>
<source>Other</source>
- <translation type="unfinished">Anderes</translation>
+ <translation>Anderes</translation>
</message>
<message>
<source>VSync</source>
- <translation type="unfinished">VSync</translation>
+ <translation>VSync</translation>
</message>
<message>
<source>pyMoul</source>
- <translation type="unfinished">pyMoul</translation>
+ <translation>pyMoul</translation>
</message>
<message>
<source>Settings</source>
- <translation type="unfinished">Einstellungen</translation>
+ <translation>Einstellungen</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">Lese Chatlogs</translation>
+ <translation>Lese Chatlogs</translation>
</message>
<message>
<source>Chat logs</source>
- <translation type="unfinished">Chatlogs</translation>
+ <translation>Chatlogs</translation>
</message>
<message>
<source>Browse journals and notes</source>
- <translation type="unfinished">Lese Journale und Nachrichten</translation>
+ <translation>Lese Journale und Nachrichten</translation>
</message>
<message>
<source>Journals</source>
- <translation type="unfinished">Journale</translation>
+ <translation>Journale</translation>
</message>
<message>
<source>Browse</source>
- <translation type="unfinished">Lese</translation>
+ <translation>Lese</translation>
</message>
<message>
<source>About pyMoul</source>
- <translation type="unfinished">Über pyMoul</translation>
+ <translation>Über pyMoul</translation>
</message>
<message>
<source>License</source>
- <translation type="unfinished">Lizenz</translation>
+ <translation>Lizenz</translation>
</message>
<message>
<source>Load journals</source>
- <translation type="unfinished">Lade Journale</translation>
+ <translation>Lade Journale</translation>
</message>
<message>
<source>TextLabel</source>
<translation type="unfinished"></translation>
</message>
<message>
- <source>Tool for Myst Online : Uru Live
-
-(c) 2007 by Christian Heimes
-
-http://pymoul.sourceforge.net/</source>
- <translation type="unfinished"></translation>
- </message>
- <message>
<source>Repairing KI images</source>
- <translation type="unfinished">Repariere KI Bilder</translation>
+ <translation>Repariere KI Bilder</translation>
</message>
<message>
<source>Sound priority</source>
- <translation type="unfinished">Tonpriorität</translation>
+ <translation>Tonpriorität</translation>
</message>
<message>
<source><html><head><meta name="qrichtext" content="1" /><style type="text/css">
@@ -331,16 +316,40 @@
</message>
<message>
<source>Not implemented</source>
- <translation type="unfinished">Nicht implementiert</translation>
+ <translation>Nicht implementiert</translation>
</message>
<message>
<source>Unsaved changes!</source>
- <translation type="unfinished">Ungespeicherte Änderungen</translation>
+ <translation>Ungespeicherte Änderungen!</translation>
</message>
<message>
<source>Do you want to save your changes?</source>
- <translation type="unfinished">Wollen sie die Änderungen speichern?</translation>
+ <translation>Wollen sie die Änderungen speichern?</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;"></p></body></html></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>
+<center>
+<h3>Tool for Myst Online : Uru Live</h3>
+
+<p>(c) 2007 Christian Heimes</p>
+
+<p><a href="http://pymoul.sourceforge.net">http://pymoul.sourceforge.net</a></p>
+</center>
+
+<p align="justify">If you like the tool please consider to <a href="%1">donate</a> some money to sponsor my work. The tool is created in my free time as an open source project. You can sent money to my <a href="%2">PayPal account</a> using your PayPal account, credit card or bank account. You can also use the SourceForget.net <a href="%3">donate page</a>. Your money will be used to found my MOUL account and new hardware for my 4 years old computer.</p>
+
+<p>sincerely yours<br>
+Tiran [KI: #00025784]</p>
+ </source>
+ <translation type="unfinished"></translation>
+ </message>
</context>
<context>
<name>SimpleProgressbar</name>
Modified: pymoul/trunk/src/moul/qt/i18n/pymoul_es.ts
===================================================================
--- pymoul/trunk/src/moul/qt/i18n/pymoul_es.ts 2007-02-05 16:48:00 UTC (rev 143)
+++ pymoul/trunk/src/moul/qt/i18n/pymoul_es.ts 2007-02-06 03:51:21 UTC (rev 144)
@@ -264,13 +264,6 @@
<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>
@@ -307,14 +300,6 @@
<translation type="unfinished"></translation>
</message>
<message>
- <source>Tool for Myst Online : Uru Live
-
-(c) 2007 by Christian Heimes
-
-http://pymoul.sourceforge.net/</source>
- <translation type="unfinished"></translation>
- </message>
- <message>
<source>Repairing KI images</source>
<translation type="unfinished"></translation>
</message>
@@ -341,6 +326,30 @@
<source>Do you want to save your changes?</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;"></p></body></html></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>
+<center>
+<h3>Tool for Myst Online : Uru Live</h3>
+
+<p>(c) 2007 Christian Heimes</p>
+
+<p><a href="http://pymoul.sourceforge.net">http://pymoul.sourceforge.net</a></p>
+</center>
+
+<p align="justify">If you like the tool please consider to <a href="%1">donate</a> some money to sponsor my work. The tool is created in my free time as an open source project. You can sent money to my <a href="%2">PayPal account</a> using your PayPal account, credit card or bank account. You can also use the SourceForget.net <a href="%3">donate page</a>. Your money will be used to found my MOUL account and new hardware for my 4 years old computer.</p>
+
+<p>sincerely yours<br>
+Tiran [KI: #00025784]</p>
+ </source>
+ <translation type="unfinished"></translation>
+ </message>
</context>
<context>
<name>SimpleProgressbar</name>
Modified: pymoul/trunk/src/moul/qt/i18n/pymoul_fr.ts
===================================================================
--- pymoul/trunk/src/moul/qt/i18n/pymoul_fr.ts 2007-02-05 16:48:00 UTC (rev 143)
+++ pymoul/trunk/src/moul/qt/i18n/pymoul_fr.ts 2007-02-06 03:51:21 UTC (rev 144)
@@ -264,13 +264,6 @@
<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>
@@ -307,14 +300,6 @@
<translation type="unfinished"></translation>
</message>
<message>
- <source>Tool for Myst Online : Uru Live
-
-(c) 2007 by Christian Heimes
-
-http://pymoul.sourceforge.net/</source>
- <translation type="unfinished"></translation>
- </message>
- <message>
<source>Repairing KI images</source>
<translation type="unfinished"></translation>
</message>
@@ -341,6 +326,30 @@
<source>Do you want to save your changes?</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;"></p></body></html></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>
+<center>
+<h3>Tool for Myst Online : Uru Live</h3>
+
+<p>(c) 2007 Christian Heimes</p>
+
+<p><a href="http://pymoul.sourceforge.net">http://pymoul.sourceforge.net</a></p>
+</center>
+
+<p align="justify">If you like the tool please consider to <a href="%1">donate</a> some money to sponsor my work. The tool is created in my free time as an open source project. You can sent money to my <a href="%2">PayPal account</a> using your PayPal account, credit card or bank account. You can also use the SourceForget.net <a href="%3">donate page</a>. Your money will be used to found my MOUL account and new hardware for my 4 years old computer.</p>
+
+<p>sincerely yours<br>
+Tiran [KI: #00025784]</p>
+ </source>
+ <translation type="unfinished"></translation>
+ </message>
</context>
<context>
<name>SimpleProgressbar</name>
Modified: pymoul/trunk/src/moul/qt/i18n/pymoul_it.ts
===================================================================
--- pymoul/trunk/src/moul/qt/i18n/pymoul_it.ts 2007-02-05 16:48:00 UTC (rev 143)
+++ pymoul/trunk/src/moul/qt/i18n/pymoul_it.ts 2007-02-06 03:51:21 UTC (rev 144)
@@ -264,13 +264,6 @@
<translation type="unfinished"></translation>
</message>
<message>
- <source><html><head><meta name="qrichtext" content="1"...
[truncated message content] |
|
From: <ti...@us...> - 2007-02-06 15:15:33
|
Revision: 145
http://pymoul.svn.sourceforge.net/pymoul/?rev=145&view=rev
Author: tiran
Date: 2007-02-06 07:15:30 -0800 (Tue, 06 Feb 2007)
Log Message:
-----------
Use pkg_resources for qm files
py2exe support for name space packages
some vars renamed to keep naming consistent
Modified Paths:
--------------
pymoul/trunk/Makefile.in
pymoul/trunk/src/moul/__init__.py
pymoul/trunk/src/moul/file/chatlog.py
pymoul/trunk/src/moul/file/directory.py
pymoul/trunk/src/moul/file/plasmalog.py
pymoul/trunk/src/moul/qt/i18n/__init__.py
pymoul/trunk/src/moul/qt/mainwindow.py
pymoul/trunk/src/moul/qt/moulqt.py
pymoul/trunk/src/moul/qt/utils.py
Removed Paths:
-------------
pymoul/trunk/src/moul/qt/i18n/translations.qrc
pymoul/trunk/src/moul/qt/i18n/translations_rc.py
Modified: pymoul/trunk/Makefile.in
===================================================================
--- pymoul/trunk/Makefile.in 2007-02-06 03:51:21 UTC (rev 144)
+++ pymoul/trunk/Makefile.in 2007-02-06 15:15:30 UTC (rev 145)
@@ -85,10 +85,6 @@
pylupdate4 `$(FINDQT)` -ts src/moul/qt/i18n/pymoul_$${L}.ts;\
lrelease src/moul/qt/i18n/pymoul_$${L}.ts; \
done
- rm src/moul/qt/i18n/translations_rc.py
- # do not compress qm files so the translator can load it
- pyrcc4 -no-compress -o ./src/moul/qt/i18n/translations_rc.py \
- ./src/moul/qt/i18n/translations.qrc
hash:
cd dist && $(FINDHASH) | xargs md5sum >md5.txt
Modified: pymoul/trunk/src/moul/__init__.py
===================================================================
--- pymoul/trunk/src/moul/__init__.py 2007-02-06 03:51:21 UTC (rev 144)
+++ pymoul/trunk/src/moul/__init__.py 2007-02-06 15:15:30 UTC (rev 145)
@@ -6,3 +6,9 @@
from pkgutil import extend_path
__path__ = extend_path(__path__, __name__)
+# py2exe support for namespace packages
+try:
+ import modulefinder
+except ImportError:
+ for p in __path__:
+ modulefinder.AddPackagePath(__name__, p)
Modified: pymoul/trunk/src/moul/file/chatlog.py
===================================================================
--- pymoul/trunk/src/moul/file/chatlog.py 2007-02-06 03:51:21 UTC (rev 144)
+++ pymoul/trunk/src/moul/file/chatlog.py 2007-02-06 15:15:30 UTC (rev 145)
@@ -87,27 +87,33 @@
_filename = "chatlog_%(sY)02i%(sM)02i%(sD)02i_%(ch)02i%(cm)02i_%(sh)02i%(sm)02i.txt"
def __init__(self, srcdir, destdir):
- self._path = srcdir
- self._dest = destdir
+ self._srcdir = srcdir
+ self._destdir = destdir
+ LOG.debug("ChatlogMover: %s -> %s" % (srcdir, destdir))
+ self.clear()
+
+ def clear(self):
+ """
+ """
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):
- LOG.info("Creating chatlog directory %s" % destdir)
+ if not os.path.isdir(self._srcdir):
+ LOG.warning("%s is not a directory" % self._srcdir)
+ if not os.path.isdir(self._destdir):
+ LOG.info("Creating chatlog directory %s" % self._destdir)
os.mkdir(destdir)
def findLogs(self):
- """Find log files in self._path
+ """Find log files in self._srcdir
Also calls and stores _findCreated(), modtime() and _makeFile()
for the file.
"""
- for file in os.listdir(self._path):
+ self.clear()
+ for file in os.listdir(self._srcdir):
if not fnmatch(file.lower(), self._pat):
continue
- fpath = os.path.join(self._path, file)
+ fpath = os.path.join(self._srcdir, file)
if not os.path.isfile(fpath):
continue
LOG.debug("Found chatlog %s" % fpath)
@@ -121,10 +127,11 @@
'modtime' : mtime,
'created' : created,
'newname' : newname,
- 'newpath' : os.path.join(self._dest, newname),
+ 'newpath' : os.path.join(self._destdirt, newname),
}
self._logs.append(details)
+ return self._logs
def _findCreated(self, fpath):
"""Parse chatlog to find "started" date
@@ -170,8 +177,8 @@
def moveChatlogs(self):
"""Move all chatlogs
"""
- for details in self._logs:
- self.moveChatlog(details)
+ for name in iter(self):
+ pass
def __len__(self):
"""len() suppor
Modified: pymoul/trunk/src/moul/file/directory.py
===================================================================
--- pymoul/trunk/src/moul/file/directory.py 2007-02-06 03:51:21 UTC (rev 144)
+++ pymoul/trunk/src/moul/file/directory.py 2007-02-06 15:15:30 UTC (rev 145)
@@ -168,13 +168,13 @@
}
_factories = {
- 'logchat' : (ChatlogMover, ('logs', 'chatlogs')),
- 'logzip' : (PlasmalogZipper, ('logs', 'zipped')),
+ 'logzipper' : (PlasmalogZipper, ('logs', 'zipped')),
'kiimages' : (KIImageFixer, ('kiimages', 'fixed')),
'avatars' : (KIImageFixer, ('avatars', 'fixed')),
'graphicsini' : (GraphicsIni, ('ini',)),
'audioini' : (AudioIni, ('ini',)),
- 'chatlogs' : (ChatlogDirectoryView, ('chatlogs',)),
+ 'chatmover' : (ChatlogMover, ('logs', 'chatlogs')),
+ 'chatview' : (ChatlogDirectoryView, ('chatlogs',)),
'zipped' : (DirectoryCount, ('zipped',)),
'fixed' : (DirectoryCount, ('fixed',)),
}
Modified: pymoul/trunk/src/moul/file/plasmalog.py
===================================================================
--- pymoul/trunk/src/moul/file/plasmalog.py 2007-02-06 03:51:21 UTC (rev 144)
+++ pymoul/trunk/src/moul/file/plasmalog.py 2007-02-06 15:15:30 UTC (rev 145)
@@ -47,19 +47,22 @@
self._destdir = destdir
self._doremove = True
self._dozip = True
+ LOG.debug("PlasmalogZipper: %s -> %s" % (srcdir, destdir))
- LOG.debug("PlasmalogZipper: %s -> %s" % (srcdir, destdir))
+ def clear(self):
+ """Clear state
+ """
self._zipped_dirs = {} # dirname -> zipfile
self._not_removed = [] # files with full path
- if not os.path.isdir(srcdir):
+ if not os.path.isdir(self._srcdir):
LOG.warning("%s is not a directory" % srcdir)
if not self.isPlasmaLogDir():
self._ispldir = False
LOG.warning("%s is not a plasma log directory" % srcdir)
else:
self._ispldir = True
- if not os.path.isdir(destdir):
+ if not os.path.isdir(self._destdir):
LOG.info("Creating chatlog directory %s" % destdir)
os.mkdir(destdir)
@@ -91,6 +94,7 @@
This function also zips subdirectories.
"""
+ self.clear()
for root, dirs, files in os.walk(self._srcdir):
stamp = self.isPlasmaLogDir(root)
if not stamp:
Modified: pymoul/trunk/src/moul/qt/i18n/__init__.py
===================================================================
--- pymoul/trunk/src/moul/qt/i18n/__init__.py 2007-02-06 03:51:21 UTC (rev 144)
+++ pymoul/trunk/src/moul/qt/i18n/__init__.py 2007-02-06 15:15:30 UTC (rev 145)
@@ -23,3 +23,49 @@
__version__ = "$Id: __init__.py 108 2007-01-31 14:46:54Z tiran $"
__revision__ = "$Revision: 108 $"
+import pkg_resources
+from PyQt4 import QtCore
+
+from moul.osdependent import __FROZEN__
+from moul.log import getLogger
+
+
+LOG = getLogger('moul.qt.i18n')
+LANGS = ('de', 'es', 'fr', 'it', 'nl')
+TRANSLATIONS = {}
+
+# cannot use os.listdir here!
+
+for lang in LANGS:
+ name = "pymoul_%s" % lang
+ qm = pkg_resources.resource_string(__name__, "%s.qm" % name)
+ TRANSLATIONS[name] = qm
+
+def installTranslator(app, prefix="pymoul"):
+ """
+ Installs a translator for the ap
+ """
+ translator = QtCore.QTranslator(app)
+ locale = str(QtCore.QLocale.system().name())
+ LOG.info("QTranslation using locale %s" % locale)
+ try:
+ lang, country = locale.split('_')
+ except:
+ lang, country = locale, ''
+
+ longname = "%s_%s" % (prefix, locale)
+ shortname = "%s_%s" % (prefix, lang)
+ qm = None
+ if longname in TRANSLATIONS:
+ LOG.info("Loading translation %s" % longname)
+ qm = TRANSLATIONS[longname]
+ elif shortname in TRANSLATIONS:
+ LOG.info("Loading translation %s" % shortname)
+ qm = TRANSLATIONS[shortname]
+
+ if qm is not None:
+ translator.load(qm, len(qm))
+ app.installTranslator(translator)
+ else:
+ if shortname != 'en':
+ LOG.warning("No translation found!")
Deleted: pymoul/trunk/src/moul/qt/i18n/translations.qrc
===================================================================
--- pymoul/trunk/src/moul/qt/i18n/translations.qrc 2007-02-06 03:51:21 UTC (rev 144)
+++ pymoul/trunk/src/moul/qt/i18n/translations.qrc 2007-02-06 15:15:30 UTC (rev 145)
@@ -1,10 +0,0 @@
-<RCC>
- <qresource prefix="/translations" >
- <file>pymoul_de.qm</file>
- <file>pymoul_es.qm</file>
- <file>pymoul_fr.qm</file>
- <file>pymoul_it.qm</file>
- <file>pymoul_nl.qm</file>
- </qresource>
-</RCC>
-
Deleted: pymoul/trunk/src/moul/qt/i18n/translations_rc.py
===================================================================
--- pymoul/trunk/src/moul/qt/i18n/translations_rc.py 2007-02-06 03:51:21 UTC (rev 144)
+++ pymoul/trunk/src/moul/qt/i18n/translations_rc.py 2007-02-06 15:15:30 UTC (rev 145)
@@ -1,414 +0,0 @@
-# -*- coding: utf-8 -*-
-
-# Resource object code
-#
-# Created: Mo Feb 5 21:44:11 2007
-# by: The Resource Compiler for PyQt (Qt v4.2.0)
-#
-# WARNING! All changes made in this file will be lost!
-
-from PyQt4 import QtCore
-
-qt_resource_data = "\
-\x00\x00\x01\x51\
-\x3c\
-\xb8\x64\x18\xca\xef\x9c\x95\xcd\x21\x1c\xbf\x60\xa1\xbd\xdd\x42\
-\x00\x00\x00\x00\x69\x00\x00\x00\x00\x2f\x00\x00\x01\x32\x00\x97\
-\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
-\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
-\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
-\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
-\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
-\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
-\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
-\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
-\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
-\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
-\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
-\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
-\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
-\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
-\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
-\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
-\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
-\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
-\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
-\
-\x00\x00\x01\x51\
-\x3c\
-\xb8\x64\x18\xca\xef\x9c\x95\xcd\x21\x1c\xbf\x60\xa1\xbd\xdd\x42\
-\x00\x00\x00\x00\x69\x00\x00\x00\x00\x2f\x00\x00\x01\x32\x00\x97\
-\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
-\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
-\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
-\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
-\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
-\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
-\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
-\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
-\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
-\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
-\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
-\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
-\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
-\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
-\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
-\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
-\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
-\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
-\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
-\
-\x00\x00\x01\x51\
-\x3c\
-\xb8\x64\x18\xca\xef\x9c\x95\xcd\x21\x1c\xbf\x60\xa1\xbd\xdd\x42\
-\x00\x00\x00\x00\x69\x00\x00\x00\x00\x2f\x00\x00\x01\x32\x00\x97\
-\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
-\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
-\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
-\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
-\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
-\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
-\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
-\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
-\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
-\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
-\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
-\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
-\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
-\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
-\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
-\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
-\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
-\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
-\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
-\
-\x00\x00\x01\x51\
-\x3c\
-\xb8\x64\x18\xca\xef\x9c\x95\xcd\x21\x1c\xbf\x60\xa1\xbd\xdd\x42\
-\x00\x00\x00\x00\x69\x00\x00\x00\x00\x2f\x00\x00\x01\x32\x00\x97\
-\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
-\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
-\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
-\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
-\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
-\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
-\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
-\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
-\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
-\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
-\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
-\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
-\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
-\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
-\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
-\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
-\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
-\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
-\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
-\
-\x00\x00\x10\x19\
-\x3c\
-\xb8\x64\x18\xca\xef\x9c\x95\xcd\x21\x1c\xbf\x60\xa1\xbd\xdd\x42\
-\x00\x00\x02\x70\x00\x00\x47\xd5\x00\x00\x00\x00\x00\x00\x53\x67\
-\x00\x00\x00\x1d\x00\x00\x59\xc4\x00\x00\x00\x36\x00\x04\xef\xd8\
-\x00\x00\x00\x47\x00\x05\x24\x9c\x00\x00\x00\x5a\x00\x05\x3b\x6e\
-\x00\x00\x00\x6d\x00\x05\x70\x47\x00\x00\x00\x80\x00\x47\x96\xc4\
-\x00\x00\x00\x93\x00\x48\xba\xff\x00\x00\x00\xa6\x00\x4b\x68\x54\
-\x00\x00\x00\xbb\x00\x52\xcc\xbc\x00\x00\x00\xda\x00\x54\xc9\xf3\
-\x00\x00\x00\xef\x00\x56\xae\xc2\x00\x00\x01\x04\x00\x5a\x8a\x23\
-\x00\x00\x01\x1d\x00\x5b\x0b\x25\x00\x00\x01\x38\x00\x5b\xb0\x43\
-\x00\x00\x01\x4d\x00\x5c\x3b\x81\x00\x00\x01\x62\x00\x64\x19\x77\
-\x00\x00\x01\x77\x00\x7e\x6c\x0a\x00\x00\x01\x96\x01\x93\x37\x13\
-\x00\x00\x01\xb5\x01\xab\x5c\xb3\x00\x00\x01\xfc\x02\x8f\x56\xc2\
-\x00\x00\x02\x27\x02\xe9\x8e\x3e\x00\x00\x02\x58\x02\xf9\xc5\xc5\
-\x00\x00\x02\x91\x03\x05\x6a\xdc\x00\x00\x02\xa8\x03\x92\xfa\x97\
-\x00\x00\x02\xc9\x03\x95\x76\xb3\x00\x00\x02\xfe\x04\x99\x6e\x95\
-\x00\x00\x03\x25\x04\xd7\xac\x54\x00\x00\x03\x38\x04\xe2\x4f\x1a\
-\x00\x00\x03\x6b\x05\x8c\x46\xc5\x00\x00\x03\x8c\x05\x8c\x68\x02\
-\x00\x00\x03\xa7\x05\xa0\x21\x53\x00\x00\x03\xc6\x05\xd0\xcd\x93\
-\x00\x00\x03\xeb\x05\xf8\x63\x97\x00\x00\x04\x0c\x06\x19\xf8\x33\
-\x00\x00\x04\x43\x06\x3e\x53\x23\x00\x00\x04\x76\x06\x80\x0f\x99\
-\x00\x00\x04\x9b\x06\x93\xd5\xd9\x00\x00\x04\xec\x06\xc9\x43\x23\
-\x00\x00\x05\x37\x06\xca\x7f\x51\x00\x00\x05\x52\x06\xcd\x5c\x79\
-\x00\x00\x05\x91\x07\x0d\x0d\x29\x00\x00\x05\xbc\x07\x7e\x46\xbc\
-\x00\x00\x05\xe5\x07\x86\xf4\xf3\x00\x00\x05\xfc\x07\xe0\x1a\x4f\
-\x00\x00\x06\x19\x08\x4e\xb2\xf5\x00\x00\x06\x6c\x08\x62\xc8\x91\
-\x00\x00\x06\x85\x08\x67\x7c\x03\x00\x00\x06\xec\x08\x6c\x74\x43\
-\x00\x00\x07\x07\x08\x86\xeb\x43\x00\x00\x07\x3e\x08\x89\xf0\x85\
-\x00\x00\x07\x55\x08\x8b\xdc\x65\x00\x00\x07\x74\x08\xb8\x30\xe9\
-\x00\x00\x07\x8f\x09\x23\x8d\x18\x00\x00\x07\xaa\x09\x73\x4b\x74\
-\x00\x00\x07\xcd\x09\xc9\xcc\xc3\x00\x00\x07\xec\x0a\x60\x8c\x6e\
-\x00\x00\x08\x03\x0a\xa2\x5f\x07\x00\x00\x08\x20\x0b\x4d\x0c\xe4\
-\x00\x00\x08\x3f\x0b\x5d\x62\x2e\x00\x00\x08\x72\x0b\xb1\x98\x63\
-\x00\x00\x08\xbb\x0c\x14\x88\xde\x00\x00\x08\xe4\x0c\x2c\x3c\x14\
-\x00\x00\x09\x11\x0c\x8b\x22\x33\x00\x00\x09\x2a\x0c\xa7\x63\x6c\
-\x00\x00\x09\x85\x0c\xb9\x85\xe3\x00\x00\x09\xa6\x0c\xbb\x01\x73\
-\x00\x00\x09\xcf\x0c\xd3\x7d\x01\x00\x00\x09\xf4\x0d\xca\xe4\xb3\
-\x00\x00\x0a\x51\x0e\x42\xf2\x69\x00\x00\x0a\x76\x0e\x4c\x4e\xf4\
-\x00\x00\x0a\x99\x0e\x5d\x7d\x69\x00\x00\x0a\xca\x0e\x6c\x4e\xf4\
-\x00\x00\x0a\xf1\x0e\x8c\xb2\xa3\x00\x00\x0b\x22\x0e\x9b\xcf\x67\
-\x00\x00\x0b\x53\x0f\x02\x2c\x83\x00\x00\x0b\x7e\x0f\x33\xb6\x5e\
-\x00\x00\x0b\xc3\x69\x00\x00\x0b\xfe\x03\x00\x00\x00\x12\x00\x5a\
-\x00\x65\x00\x69\x00\x74\x00\x61\x00\x6c\x00\x74\x00\x65\x00\x72\
-\x05\x00\x00\x47\xd5\x01\x03\x00\x00\x00\x0e\x00\x4e\x00\x69\x00\
-\x65\x00\x64\x00\x72\x00\x69\x00\x67\x05\x00\x00\x53\x67\x01\x03\
-\x00\x00\x00\x06\x00\x53\x00\x65\x00\x74\x05\x00\x00\x59\xc4\x01\
-\x03\x00\x00\x00\x08\x00\x48\x00\x6f\x00\x63\x00\x68\x05\x00\x04\
-\xef\xd8\x01\x03\x00\x00\x00\x08\x00\x4d\x00\x4f\x00\x55\x00\x4c\
-\x05\x00\x05\x24\x9c\x01\x03\x00\x00\x00\x08\x00\x4d\x00\x65\x00\
-\x64\x00\x2e\x05\x00\x05\x3b\x6e\x01\x03\x00\x00\x00\x08\x00\x50\
-\x00\x69\x00\x6e\x00\x67\x05\x00\x05\x70\x47\x01\x03\x00\x00\x00\
-\x08\x00\xdc\x00\x62\x00\x65\x00\x72\x05\x00\x47\x96\xc4\x01\x03\
-\x00\x00\x00\x0a\x00\x41\x00\x75\x00\x64\x00\x69\x00\x6f\x05\x00\
-\x48\xba\xff\x01\x03\x00\x00\x00\x14\x00\x49\x00\x6d\x00\x20\x00\
-\x46\x00\x65\x00\x6e\x00\x73\x00\x74\x00\x65\x00\x72\x05\x00\x4b\
-\x68\x54\x01\x03\x00\x00\x00\x0a\x00\x4c\x00\x65\x00\x76\x00\x65\
-\x00\x6c\x05\x00\x52\xcc\xbc\x01\x03\x00\x00\x00\x0a\x00\x4d\x00\
-\x75\x00\x73\x00\x69\x00\x6b\x05\x00\x54\xc9\xf3\x01\x03\x00\x00\
-\x00\x0e\x00\x41\x00\x6e\x00\x64\x00\x65\x00\x72\x00\x65\x00\x73\
-\x05\x00\x56\xae\xc2\x01\x03\x00\x00\x00\x10\x00\x41\x00\x75\x00\
-\x66\x00\x67\x00\x61\x00\x62\x00\x65\x00\x6e\x05\x00\x5a\x8a\x23\
-\x01\x03\x00\x00\x00\x0a\x00\x54\x00\x69\x00\x74\x00\x65\x00\x6c\
-\x05\x00\x5b\x0b\x25\x01\x03\x00\x00\x00\x0a\x00\x56\x00\x53\x00\
-\x79\x00\x6e\x00\x63\x05\x00\x5b\xb0\x43\x01\x03\x00\x00\x00\x0a\
-\x00\x55\x00\x6c\x00\x74\x00\x72\x00\x61\x05\x00\x5c\x3b\x81\x01\
-\x03\x00\x00\x00\x14\x00\x4d\x00\x4f\x00\x55\x00\x4c\x00\x20\x00\
-\x6c\x00\xe4\x00\x75\x00\x66\x00\x74\x05\x00\x64\x19\x77\x01\x03\
-\x00\x00\x00\x14\x00\x43\x00\x79\x00\x61\x00\x6e\x00\x20\x00\x5a\
-\x00\x65\x00\x69\x00\x74\x00\x3a\x05\x00\x7e\x6c\x0a\x01\x03\x00\
-\x00\x00\x3c\x00\x52\x00\x65\x00\x70\x00\x61\x00\x72\x00\x69\x00\
-\x65\x00\x72\x00\x74\x00\x20\x00\x4b\x00\x49\x00\x2d\x00\x20\x00\
-\x75\x00\x6e\x00\x64\x00\x20\x00\x41\x00\x76\x00\x61\x00\x74\x00\
-\x61\x00\x72\x00\x62\x00\x69\x00\x6c\x00\x64\x00\x65\x00\x72\x05\
-\x01\x93\x37\x13\x01\x03\x00\x00\x00\x20\x00\x4c\x00\xf6\x00\x73\
-\x00\x63\x00\x68\x00\x65\x00\x20\x00\x44\x00\x65\x00\x62\x00\x75\
-\x00\x67\x00\x6c\x00\x6f\x00\x67\x00\x73\x05\x01\xab\x5c\xb3\x01\
-\x03\x00\x00\x00\x26\x00\x52\x00\x65\x00\x70\x00\x61\x00\x72\x00\
-\x69\x00\x65\x00\x72\x00\x65\x00\x20\x00\x4b\x00\x49\x00\x20\x00\
-\x42\x00\x69\x00\x6c\x00\x64\x00\x65\x00\x72\x05\x02\x8f\x56\xc2\
-\x01\x03\x00\x00\x00\x2e\x00\x4a\x00\x6f\x00\x75\x00\x72\x00\x6e\
-\x00\x61\x00\x6c\x00\x65\x00\x20\x00\x6e\x00\x69\x00\x63\x00\x68\
-\x00\x74\x00\x20\x00\x67\x00\x65\x00\x6c\x00\x61\x00\x64\x00\x65\
-\x00\x6e\x00\x2e\x05\x02\xe9\x8e\x3e\x01\x03\x00\x00\x00\x0c\x00\
-\x4c\x00\x69\x00\x7a\x00\x65\x00\x6e\x00\x7a\x05\x02\xf9\xc5\xc5\
-\x01\x03\x00\x00\x00\x16\x00\xdc\x00\x62\x00\x65\x00\x72\x00\x20\
-\x00\x70\x00\x79\x00\x4d\x00\x6f\x00\x75\x00\x6c\x05\x03\x05\x6a\
-\xdc\x01\x03\x00\x00\x00\x2a\x00\x70\x00\x79\x00\x4d\x00\x6f\x00\
-\x75\x00\x6c\x00\x20\x00\x51\x00\x54\x00\x20\x00\x6c\x00\xe4\x00\
-\x75\x00\x66\x00\x74\x00\x20\x00\x73\x00\x63\x00\x68\x00\x6f\x00\
-\x6e\x05\x03\x92\xfa\x97\x01\x03\x00\x00\x00\x1c\x00\x5a\x00\x65\
-\x00\x69\x00\x67\x00\x65\x00\x20\x00\x53\x00\x63\x00\x68\x00\x61\
-\x00\x74\x00\x74\x00\x65\x00\x6e\x05\x03\x95\x76\xb3\x01\x03\x00\
-\x00\x00\x08\x00\x4c\x00\x65\x00\x73\x00\x65\x05\x04\x99\x6e\x95\
-\x01\x03\x00\x00\x00\x28\x00\x48\x00\x69\x00\x6e\x00\x74\x00\x65\
-\x00\x72\x00\x67\x00\x72\x00\x75\x00\x6e\x00\x64\x00\x67\x00\x65\
-\x00\x72\x00\xe4\x00\x75\x00\x73\x00\x63\x00\x68\x00\x65\x05\x04\
-\xd7\xac\x54\x01\x03\x00\x00\x00\x16\x00\x48\x00\xf6\x00\x68\x00\
-\x6c\x00\x65\x00\x6e\x00\x7a\x00\x65\x00\x69\x00\x74\x00\x3a\x05\
-\x04\xe2\x4f\x1a\x01\x03\x00\x00\x00\x10\x00\x45\x00\x6e\x00\x74\
-\x00\x66\x00\x65\x00\x72\x00\x6e\x00\x65\x05\x05\x8c\x46\xc5\x01\
-\x03\x00\x00\x00\x14\x00\x52\x00\x65\x00\x70\x00\x61\x00\x72\x00\
-\x65\x00\x69\x00\x65\x00\x72\x00\x65\x05\x05\x8c\x68\x02\x01\x03\
-\x00\x00\x00\x1a\x00\x4c\x00\x61\x00\x64\x00\x65\x00\x20\x00\x4a\
-\x00\x6f\x00\x75\x00\x72\x00\x6e\x00\x61\x00\x6c\x00\x65\x05\x05\
-\xa0\x21\x53\x01\x03\x00\x00\x00\x16\x00\x4e\x00\x53\x00\x43\x00\
-\x20\x00\x53\x00\x74\x00\x69\x00\x6d\x00\x6d\x00\x65\x00\x6e\x05\
-\x05\xd0\xcd\x93\x01\x03\x00\x00\x00\x2c\x00\x41\x00\x6e\x00\x69\
-\x00\x73\x00\x6f\x00\x74\x00\x72\x00\x6f\x00\x70\x00\x69\x00\x73\
-\x00\x63\x00\x68\x00\x65\x00\x72\x00\x20\x00\x46\x00\x69\x00\x6c\
-\x00\x74\x00\x65\x00\x72\x05\x05\xf8\x63\x97\x01\x03\x00\x00\x00\
-\x28\x00\x43\x00\x68\x00\x61\x00\x74\x00\x2d\x00\x20\x00\x75\x00\
-\x6e\x00\x64\x00\x20\x00\x46\x00\x65\x00\x68\x00\x6c\x00\x65\x00\
-\x72\x00\x6c\x00\x6f\x00\x67\x00\x73\x05\x06\x19\xf8\x33\x01\x03\
-\x00\x00\x00\x1a\x00\x4c\x00\x65\x00\x73\x00\x65\x00\x20\x00\x43\
-\x00\x68\x00\x61\x00\x74\x00\x6c\x00\x6f\x00\x67\x00\x73\x05\x06\
-\x3e\x53\x23\x01\x03\x00\x00\x00\x46\x00\x46\x00\x65\x00\x68\x00\
-\x6c\x00\x65\x00\x72\x00\x20\x00\x62\x00\x65\x00\x69\x00\x6d\x00\
-\x20\x00\xd6\x00\x66\x00\x66\x00\x6e\x00\x65\x00\x6e\x00\x20\x00\
-\x76\x00\x6f\x00\x6e\x00\x20\x00\x67\x00\x72\x00\x61\x00\x70\x00\
-\x68\x00\x69\x00\x63\x00\x73\x00\x2e\x00\x69\x00\x6e\x00\x69\x05\
-\x06\x80\x0f\x99\x01\x03\x00\x00\x00\x40\x00\x46\x00\x65\x00\x68\
-\x00\x6c\x00\x65\x00\x72\x00\x20\x00\x62\x00\x65\x00\x69\x00\x6d\
-\x00\x20\x00\xd6\x00\x66\x00\x66\x00\x6e\x00\x65\x00\x6e\x00\x20\
-\x00\x76\x00\x6f\x00\x6e\x00\x20\x00\x61\x00\x75\x00\x64\x00\x69\
-\x00\x6f\x00\x2e\x00\x69\x00\x6e\x00\x69\x05\x06\x93\xd5\xd9\x01\
-\x03\x00\x00\x00\x10\x00\x4a\x00\x6f\x00\x75\x00\x72\x00\x6e\x00\
-\x61\x00\x6c\x00\x65\x05\x06\xc9\x43\x23\x01\x03\x00\x00\x00\x34\
-\x00\x55\x00\x6e\x00\x67\x00\x65\x00\x73\x00\x70\x00\x65\x00\x69\
-\x00\x63\x00\x68\x00\x65\x00\x72\x00\x74\x00\x65\x00\x20\x00\xc4\
-\x00\x6e\x00\x64\x00\x65\x00\x72\x00\x75\x00\x6e\x00\x67\x00\x65\
-\x00\x6e\x00\x21\x05\x06\xca\x7f\x51\x01\x03\x00\x00\x00\x20\x00\
-\x53\x00\x63\x00\x68\x00\x61\x00\x74\x00\x74\x00\x65\x00\x6e\x00\
-\x71\x00\x75\x00\x61\x00\x6c\x00\x69\x00\x74\x00\xe4\x00\x74\x05\
-\x06\xcd\x5c\x79\x01\x03\x00\x00\x00\x1e\x00\x54\x00\x65\x00\x78\
-\x00\x74\x00\x75\x00\x72\x00\x65\x00\x71\x00\x75\x00\x61\x00\x6c\
-\x00\x69\x00\x74\x00\xe4\x00\x74\x05\x07\x0d\x0d\x29\x01\x03\x00\
-\x00\x00\x0c\x00\x70\x00\x79\x00\x4d\x00\x6f\x00\x75\x00\x6c\x05\
-\x07\x7e\x46\xbc\x01\x03\x00\x00\x00\x12\x00\x5a\x00\x65\x00\x69\
-\x00\x74\x00\x7a\x00\x6f\x00\x6e\x00\x65\x00\x6e\x05\x07\x86\xf4\
-\xf3\x01\x03\x00\x00\x00\x48\x00\x57\x00\x6f\x00\x6c\x00\x6c\x00\
-\x65\x00\x6e\x00\x20\x00\x73\x00\x69\x00\x65\x00\x20\x00\x64\x00\
-\x69\x00\x65\x00\x20\x00\xc4\x00\x6e\x00\x64\x00\x65\x00\x72\x00\
-\x75\x00\x6e\x00\x67\x00\x65\x00\x6e\x00\x20\x00\x73\x00\x70\x00\
-\x65\x00\x69\x00\x63\x00\x68\x00\x65\x00\x72\x00\x6e\x00\x3f\x05\
-\x07\xe0\x1a\x4f\x01\x03\x00\x00\x00\x0e\x00\x53\x00\x70\x00\x72\
-\x00\x61\x00\x63\x00\x68\x00\x65\x05\x08\x4e\xb2\xf5\x01\x03\x00\
-\x00\x00\x5c\x00\x44\x00\x69\x00\x65\x00\x73\x00\x65\x00\x73\x00\
-\x20\x00\x46\x00\x65\x00\x61\x00\x74\x00\x75\x00\x72\x00\x65\x00\
-\x20\x00\x77\x00\x75\x00\x72\x00\x64\x00\x65\x00\x20\x00\x6e\x00\
-\x6f\x00\x63\x00\x68\x00\x20\x00\x6e\x00\x69\x00\x63\x00\x68\x00\
-\x74\x00\x20\x00\x69\x00\x6d\x00\x70\x00\x6c\x00\x65\x00\x6d\x00\
-\x65\x00\x6e\x00\x74\x00\x69\x00\x65\x00\x72\x00\x74\x00\x21\x05\
-\x08\x62\xc8\x91\x01\x03\x00\x00\x00\x10\x00\x43\x00\x68\x00\x61\
-\x00\x74\x00\x6c\x00\x6f\x00\x67\x00\x73\x05\x08\x67\x7c\x03\x01\
-\x03\x00\x00\x00\x2c\x00\x45\x00\x6e\x00\x74\x00\x66\x00\x65\x00\
-\x72\x00\x6e\x00\x65\x00\x20\x00\x67\x00\x65\x00\x70\x00\x61\x00\
-\x63\x00\x6b\x00\x74\x00\x65\x00\x20\x00\x4c\x00\x6f\x00\x67\x00\
-\x73\x05\x08\x6c\x74\x43\x01\x03\x00\x00\x00\x0c\x00\x47\x00\x72\
-\x00\x61\x00\x66\x00\x69\x00\x6b\x05\x08\x86\xeb\x43\x01\x03\x00\
-\x00\x00\x14\x00\x41\x00\x72\x00\x63\x00\x68\x00\x69\x00\x76\x00\
-\x69\x00\x65\x00\x72\x00\x65\x05\x08\x89\xf0\x85\x01\x03\x00\x00\
-\x00\x10\x00\x48\x00\x61\x00\x72\x00\x64\x00\x77\x00\x61\x00\x72\
-\x00\x65\x05\x08\x8b\xdc\x65\x01\x03\x00\x00\x00\x10\x00\x51\x00\
-\x75\x00\x61\x00\x6c\x00\x69\x00\x74\x00\xe4\x00\x74\x05\x08\xb8\
-\x30\xe9\x01\x03\x00\x00\x00\x18\x00\x41\x00\x6b\x00\x74\x00\x69\
-\x00\x76\x00\x69\x00\x65\x00\x72\x00\x20\x00\x45\x00\x41\x00\x58\
-\x05\x09\x23\x8d\x18\x01\x03\x00\x00\x00\x14\x00\x56\x00\x6f\x00\
-\x69\x00\x63\x00\x65\x00\x20\x00\x43\x00\x68\x00\x61\x00\x74\x05\
-\x09\x73\x4b\x74\x01\x03\x00\x00\x00\x0c\x00\x53\x00\x65\x00\x72\
-\x00\x76\x00\x65\x00\x72\x05\x09\xc9\xcc\xc3\x01\x03\x00\x00\x00\
-\x12\x00\x41\x00\x75\x00\x66\x00\x6c\x00\xf6\x00\x73\x00\x75\x00\
-\x6e\x00\x67\x05\x0a\x60\x8c\x6e\x01\x03\x00\x00\x00\x14\x00\x41\
-\x00\x6e\x00\x74\x00\x69\x00\x20\x00\x41\x00\x6c\x00\x69\x00\x61\
-\x00\x73\x05\x0a\xa2\x5f\x07\x01\x03\x00\x00\x00\x28\x00\x41\x00\
-\x6b\x00\x74\x00\x69\x00\x76\x00\x69\x00\x65\x00\x72\x00\x65\x00\
-\x20\x00\x56\x00\x6f\x00\x69\x00\x63\x00\x65\x00\x20\x00\x43\x00\
-\x68\x00\x61\x00\x74\x05\x0b\x4d\x0c\xe4\x01\x03\x00\x00\x00\x3e\
-\x00\x46\x00\x65\x00\x68\x00\x6c\x00\x65\x00\x72\x00\x20\x00\x62\
-\x00\x65\x00\x69\x00\x6d\x00\x20\x00\x4c\x00\x61\x00\x64\x00\x65\
-\x00\x6e\x00\x20\x00\x64\x00\x65\x00\x72\x00\x20\x00\x4a\x00\x6f\
-\x00\x75\x00\x72\x00\x6e\x00\x61\x00\x6c\x00\x65\x00\x2e\x05\x0b\
-\x5d\x62\x2e\x01\x03\x00\x00\x00\x1e\x00\x50\x00\x61\x00\x63\x00\
-\x6b\x00\x65\x00\x20\x00\x44\x00\x65\x00\x62\x00\x75\x00\x67\x00\
-\x6c\x00\x6f\x00\x67\x00\x73\x05\x0b\xb1\x98\x63\x01\x03\x00\x00\
-\x00\x22\x00\x4a\x00\x6f\x00\x75\x00\x72\x00\x6e\x00\x61\x00\x6c\
-\x00\x65\x00\x20\x00\x67\x00\x65\x00\x6c\x00\x61\x00\x64\x00\x65\
-\x00\x6e\x00\x2e\x05\x0c\x14\x88\xde\x01\x03\x00\x00\x00\x0e\x00\
-\x45\x00\x6c\x00\x65\x00\x6d\x00\x65\x00\x6e\x00\x74\x05\x0c\x2c\
-\x3c\x14\x01\x03\x00\x00\x00\x50\x00\x41\x00\x72\x00\x63\x00\x68\
-\x00\x69\x00\x76\x00\x69\x00\x65\x00\x72\x00\x65\x00\x20\x00\x43\
-\x00\x68\x00\x61\x00\x74\x00\x6c\x00\x6f\x00\x67\x00\x73\x00\x20\
-\x00\x75\x00\x6e\x00\x64\x00\x20\x00\x70\x00\x61\x00\x63\x00\x6b\
-\x00\x65\x00\x20\x00\x4c\x00\x6f\x00\x67\x00\x64\x00\x61\x00\x74\
-\x00\x65\x00\x69\x00\x65\x00\x6e\x05\x0c\x8b\x22\x33\x01\x03\x00\
-\x00\x00\x16\x00\x41\x00\x6c\x00\x6c\x00\x65\x00\x73\x00\x20\x00\
-\x73\x00\x74\x00\x75\x00\x6d\x00\x6d\x05\x0c\xa7\x63\x6c\x01\x03\
-\x00\x00\x00\x1e\x00\x53\x00\x65\x00\x72\x00\x76\x00\x65\x00\x72\
-\x00\x20\x00\x61\x00\x6e\x00\x70\x00\x69\x00\x6e\x00\x67\x00\x65\
-\x00\x6e\x05\x0c\xb9\x85\xe3\x01\x03\x00\x00\x00\x1a\x00\x45\x00\
-\x69\x00\x6e\x00\x73\x00\x74\x00\x65\x00\x6c\x00\x6c\x00\x75\x00\
-\x6e\x00\x67\x00\x65\x00\x6e\x05\x0c\xbb\x01\x73\x01\x03\x00\x00\
-\x00\x52\x00\x45\x00\x69\x00\x6e\x00\x65\x00\x20\x00\x49\x00\x6e\
-\x00\x73\x00\x74\x00\x61\x00\x6e\x00\x7a\x00\x20\x00\x76\x00\x6f\
-\x00\x6e\x00\x20\x00\x70\x00\x79\x00\x4d\x00\x6f\x00\x75\x00\x6c\
-\x00\x20\x00\x51\x00\x54\x00\x20\x00\x6c\x00\xe4\x00\x75\x00\x66\
-\x00\x74\x00\x20\x00\x62\x00\x65\x00\x72\x00\x65\x00\x69\x00\x74\
-\x00\x73\x00\x21\x05\x0c\xd3\x7d\x01\x01\x03\x00\x00\x00\x1a\x00\
-\x4c\x00\x61\x00\x64\x00\x65\x00\x20\x00\x4a\x00\x6f\x00\x75\x00\
-\x72\x00\x6e\x00\x61\x00\x6c\x00\x65\x05\x0d\xca\xe4\xb3\x01\x03\
-\x00\x00\x00\x18\x00\x54\x00\x6f\x00\x6e\x00\x70\x00\x72\x00\x69\
-\x00\x6f\x00\x72\x00\x69\x00\x74\x00\xe4\x00\x74\x05\x0e\x42\xf2\
-\x69\x01\x03\x00\x00\x00\x26\x00\x4e\x00\x69\x00\x63\x00\x68\x00\
-\x74\x00\x20\x00\x69\x00\x6d\x00\x70\x00\x6c\x00\x65\x00\x6d\x00\
-\x65\x00\x6e\x00\x74\x00\x69\x00\x65\x00\x72\x00\x74\x05\x0e\x4c\
-\x4e\xf4\x01\x03\x00\x00\x00\x1c\x00\x47\x00\x72\x00\x61\x00\x66\
-\x00\x69\x00\x6b\x00\x71\x00\x75\x00\x61\x00\x6c\x00\x69\x00\x74\
-\x00\xe4\x00\x74\x05\x0e\x5d\x7d\x69\x01\x03\x00\x00\x00\x26\x00\
-\x4e\x00\x69\x00\x63\x00\x68\x00\x74\x00\x20\x00\x69\x00\x6d\x00\
-\x70\x00\x6c\x00\x65\x00\x6d\x00\x65\x00\x6e\x00\x74\x00\x69\x00\
-\x65\x00\x72\x00\x74\x05\x0e\x6c\x4e\xf4\x01\x03\x00\x00\x00\x26\
-\x00\x52...
[truncated message content] |
|
From: <ti...@us...> - 2007-02-06 16:53:38
|
Revision: 148
http://pymoul.svn.sourceforge.net/pymoul/?rev=148&view=rev
Author: tiran
Date: 2007-02-06 08:53:36 -0800 (Tue, 06 Feb 2007)
Log Message:
-----------
Do not remove build dir
Fixed some typos in i18n code
Modified Paths:
--------------
pymoul/trunk/build.bat
pymoul/trunk/installer.bat
pymoul/trunk/setup.py
pymoul/trunk/src/moul/qt/i18n/__init__.py
Modified: pymoul/trunk/build.bat
===================================================================
--- pymoul/trunk/build.bat 2007-02-06 16:48:27 UTC (rev 147)
+++ pymoul/trunk/build.bat 2007-02-06 16:53:36 UTC (rev 148)
@@ -1,5 +1,4 @@
@echo off
-rd /S /Q build
cls
set PYTHONPATH=src
python setup.py py2exe
Modified: pymoul/trunk/installer.bat
===================================================================
--- pymoul/trunk/installer.bat 2007-02-06 16:48:27 UTC (rev 147)
+++ pymoul/trunk/installer.bat 2007-02-06 16:53:36 UTC (rev 148)
@@ -1,5 +1,4 @@
@echo off
-rd /S /Q build
cls
set PYTHONPATH=src
set INNOSETUP=yes
Modified: pymoul/trunk/setup.py
===================================================================
--- pymoul/trunk/setup.py 2007-02-06 16:48:27 UTC (rev 147)
+++ pymoul/trunk/setup.py 2007-02-06 16:53:36 UTC (rev 148)
@@ -60,7 +60,7 @@
install_requires = ["pytz>=2006p",],
data_files = [
('docs', list(glob('*.txt'))),
- ('i18', list(glob('src/moul/qt/i18n/pymoul_*.*'))),
+ ('i18n', list(glob('src/moul/qt/i18n/pymoul_*.qm'))),
],
package_dir = {'' : 'src'},
packages = find_packages('src', exclude="moul.qt"),
Modified: pymoul/trunk/src/moul/qt/i18n/__init__.py
===================================================================
--- pymoul/trunk/src/moul/qt/i18n/__init__.py 2007-02-06 16:48:27 UTC (rev 147)
+++ pymoul/trunk/src/moul/qt/i18n/__init__.py 2007-02-06 16:53:36 UTC (rev 148)
@@ -56,12 +56,11 @@
@rtype: str or None
"""
if __FROZEN__:
- basedir = os.path.dirname(sys.prefix)
- qm = os.path.join(basedir, 'i18n', '%s.qm')
+ qm = os.path.join(sys.prefix, 'i18n', '%s.qm' % name)
if os.path.isfile(qm):
return open(qm, 'rb').read()
else:
- return None
+ LOG.debug("QM file not found: %s" % qm)
else:
return TRANSLATIONS.get(name, None)
@@ -92,5 +91,6 @@
LOG.info("Loading translation %s" % longname)
if qm is not None:
+ #LOG.debug("len(qm) %i" % len(qm))
translator.load(qm, len(qm))
app.installTranslator(translator)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|