home *** CD-ROM | disk | FTP | other *** search
- # Source Generated with Decompyle++
- # File: in.pyc (Python 2.6)
-
- __version__ = '0.70a1'
- __all__ = [
- 'Process',
- 'current_process',
- 'active_children',
- 'freeze_support',
- 'Manager',
- 'Pipe',
- 'cpu_count',
- 'log_to_stderr',
- 'get_logger',
- 'allow_connection_pickling',
- 'BufferTooShort',
- 'TimeoutError',
- 'Lock',
- 'RLock',
- 'Semaphore',
- 'BoundedSemaphore',
- 'Condition',
- 'Event',
- 'Queue',
- 'JoinableQueue',
- 'Pool',
- 'Value',
- 'Array',
- 'RawValue',
- 'RawArray',
- 'SUBDEBUG',
- 'SUBWARNING']
- __author__ = 'R. Oudkerk (r.m.oudkerk@gmail.com)'
- import os
- import sys
- from multiprocessing.process import Process, current_process, active_children
- from multiprocessing.util import SUBDEBUG, SUBWARNING
-
- class ProcessError(Exception):
- pass
-
-
- class BufferTooShort(ProcessError):
- pass
-
-
- class TimeoutError(ProcessError):
- pass
-
-
- class AuthenticationError(ProcessError):
- pass
-
- import _multiprocessing
-
- def Manager():
- SyncManager = SyncManager
- import multiprocessing.managers
- m = SyncManager()
- m.start()
- return m
-
-
- def Pipe(duplex = True):
- Pipe = Pipe
- import multiprocessing.connection
- return Pipe(duplex)
-
-
- def cpu_count():
- if sys.platform == 'win32':
-
- try:
- num = int(os.environ['NUMBER_OF_PROCESSORS'])
- except (ValueError, KeyError):
- num = 0
- except:
- None<EXCEPTION MATCH>(ValueError, KeyError)
-
-
- None<EXCEPTION MATCH>(ValueError, KeyError)
- if 'bsd' in sys.platform or sys.platform == 'darwin':
-
- try:
- num = int(os.popen('sysctl -n hw.ncpu').read())
- except ValueError:
- num = 0
- except:
- None<EXCEPTION MATCH>ValueError
-
-
- None<EXCEPTION MATCH>ValueError
-
- try:
- num = os.sysconf('SC_NPROCESSORS_ONLN')
- except (ValueError, OSError, AttributeError):
- num = 0
-
- if num >= 1:
- return num
- raise NotImplementedError('cannot determine number of cpus')
-
-
- def freeze_support():
- if sys.platform == 'win32' and getattr(sys, 'frozen', False):
- freeze_support = freeze_support
- import multiprocessing.forking
- freeze_support()
-
-
-
- def get_logger():
- get_logger = get_logger
- import multiprocessing.util
- return get_logger()
-
-
- def log_to_stderr(level = None):
- log_to_stderr = log_to_stderr
- import multiprocessing.util
- return log_to_stderr(level)
-
-
- def allow_connection_pickling():
- reduction = reduction
- import multiprocessing
-
-
- def Lock():
- Lock = Lock
- import multiprocessing.synchronize
- return Lock()
-
-
- def RLock():
- RLock = RLock
- import multiprocessing.synchronize
- return RLock()
-
-
- def Condition(lock = None):
- Condition = Condition
- import multiprocessing.synchronize
- return Condition(lock)
-
-
- def Semaphore(value = 1):
- Semaphore = Semaphore
- import multiprocessing.synchronize
- return Semaphore(value)
-
-
- def BoundedSemaphore(value = 1):
- BoundedSemaphore = BoundedSemaphore
- import multiprocessing.synchronize
- return BoundedSemaphore(value)
-
-
- def Event():
- Event = Event
- import multiprocessing.synchronize
- return Event()
-
-
- def Queue(maxsize = 0):
- Queue = Queue
- import multiprocessing.queues
- return Queue(maxsize)
-
-
- def JoinableQueue(maxsize = 0):
- JoinableQueue = JoinableQueue
- import multiprocessing.queues
- return JoinableQueue(maxsize)
-
-
- def Pool(processes = None, initializer = None, initargs = ()):
- Pool = Pool
- import multiprocessing.pool
- return Pool(processes, initializer, initargs)
-
-
- def RawValue(typecode_or_type, *args):
- RawValue = RawValue
- import multiprocessing.sharedctypes
- return RawValue(typecode_or_type, *args)
-
-
- def RawArray(typecode_or_type, size_or_initializer):
- RawArray = RawArray
- import multiprocessing.sharedctypes
- return RawArray(typecode_or_type, size_or_initializer)
-
-
- def Value(typecode_or_type, *args, **kwds):
- Value = Value
- import multiprocessing.sharedctypes
- return Value(typecode_or_type, *args, **kwds)
-
-
- def Array(typecode_or_type, size_or_initializer, **kwds):
- Array = Array
- import multiprocessing.sharedctypes
- return Array(typecode_or_type, size_or_initializer, **kwds)
-
- if sys.platform == 'win32':
-
- def set_executable(executable):
- set_executable = set_executable
- import multiprocessing.forking
- set_executable(executable)
-
- __all__ += [
- 'set_executable']
-
-