コード例 #1
0
ファイル: test_util_config.py プロジェクト: dimlev/papy
 def test_get_defaults(self):
     defs = get_defaults()
     assert 'TCP_SNDBUF' in defs
     assert 'PIPE_BUF' in defs
     assert isinstance(defs['TCP_RCVBUF'], int)
コード例 #2
0
ファイル: func.py プロジェクト: tigeraniya/papy
      stream in the form of a generator of input items.

  - item functions load, save, process or display data items. These are 
    ``Worker`` functions and should be used within ``Pipers``. 

No method of interprocess communication, besides the default inefficient is 
supported on all platforms. Even among UNIX implementation details forking 
and can differ.

"""
# all top-level imports in this module have to be injected to remote RPyC
# connections if the defined functions should be callable remotely. 
from numap import imports # provided by IMap
from papy.util.config import get_defaults # provided by worker._inject
from papy.util.runtime import get_runtime # provided by worker._inject
PAPY_DEFAULTS = get_defaults() # init by worker._inject
PAPY_RUNTIME = get_runtime()   # init by worker._inject
# worker function imports
import cPickle, json, gc, time, tempfile, errno, os, socket, urllib, stat, \
       signal, mmap, warnings, threading

def plugger(inbox):
    """
    Returns nothing.
    
    """
    return None

def ipasser(inbox, i=0):
    """
    Passes the "i"-th input from inbox. By default passes the first input.
コード例 #3
0
 def test_get_defaults(self):
     defs = get_defaults()
     assert 'TCP_SNDBUF' in defs
     assert 'PIPE_BUF' in defs
     assert isinstance(defs['TCP_RCVBUF'], int)