[Pymoul-svn] SF.net SVN: pymoul: [90] pymoul/trunk
Status: Alpha
Brought to you by:
tiran
|
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.
|