Package moul :: Package osdependent
[hide private]
[frames] | no frames]

Package osdependent



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


Submodules [hide private]

Functions [hide private]
  _plat(S, prefix, start=..., end=...)
Return True if S starts with the specified prefix, False otherwise.
  _importHelper(modname, names=None, target=None)
Import a list of variables from a module
  getPyMoulDataDir(check=False)
Get pyMoul data directory

Variables [hide private]
  __author__ = 'Christian Heimes'
  __version__ = '$Id: __init__.py 125 2007-02-02 17:59:04Z tiran $'
  __revision__ = '$Revision: 125 $'
  LOG = <logging.Logger instance at 0x4030810c>
  __FROZEN__ = False
  __WIN32__ = False
  __CYGWIN__ = False
  __LINUX__ = True
  __MACOSX__ = False
  __BSD__ = False
  __POSIX__ = True
  __NT__ = False
  __INFO__ = (False, False, True, False, False, True, False)
  NAMES = ('getMoulUserDataDir', ('getPyMoulDataDir', '_getPyM...
  _marker = <object object at 0x4003d460>

Function Details [hide private]

_plat(S, prefix, start=..., end=...)

 
Return True if S starts with the specified prefix, False otherwise. With optional start, test S beginning at that position. With optional end, stop comparing S at that position. prefix can also be a tuple of strings to try.
Returns:
bool

_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
>>> 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

getPyMoulDataDir(check=False)

 

Get pyMoul data directory

The directory contains log files, ini files and other local stuff

Variables Details [hide private]

__author__

None
Value:
'Christian Heimes'                                                     
      

__version__

None
Value:
'$Id: __init__.py 125 2007-02-02 17:59:04Z tiran $'                    
      

__revision__

None
Value:
'$Revision: 125 $'                                                     
      

LOG

None
Value:
<logging.Logger instance at 0x4030810c>                                
      

__FROZEN__

None
Value:
False                                                                  
      

__WIN32__

None
Value:
False                                                                  
      

__CYGWIN__

None
Value:
False                                                                  
      

__LINUX__

None
Value:
True                                                                   
      

__MACOSX__

None
Value:
False                                                                  
      

__BSD__

None
Value:
False                                                                  
      

__POSIX__

None
Value:
True                                                                   
      

__NT__

None
Value:
False                                                                  
      

__INFO__

None
Value:
(False, False, True, False, False, True, False)                        
      

NAMES

None
Value:
('getMoulUserDataDir',
 ('getPyMoulDataDir', '_getPyMoulDataDir'),
 'startMoul',
 'isMoulRunning')                                                      
      

_marker

None
Value:
<object object at 0x4003d460>