示例#1
0
文件: core.py 项目: nhtdata/pystrix
 def __init__(self, seconds=None, escape_digits='', format=None, timezone=None):
     if seconds is None:
         seconds = int(time.time())
     if not format:
         timezone = None
     _SayAction.__init__(self,
      'DATETIME', seconds, escape_digits,
      (format and quote(format) or None), (timezone and quote(timezone) or None)
     )
示例#2
0
文件: core.py 项目: ramzed/pystrix
 def __init__(self,
              seconds=None,
              escape_digits='',
              format=None,
              timezone=None):
     if seconds is None:
         seconds = int(time.time())
     if not format:
         timezone = None
     _SayAction.__init__(self, 'DATETIME', seconds, escape_digits,
                         (format and quote(format) or None),
                         (timezone and quote(timezone) or None))
示例#3
0
文件: core.py 项目: ramzed/pystrix
def _process_digit_list(digits):
    """
    Ensures that digit-lists are processed uniformly.
    """
    if type(digits) in (list, tuple, set, frozenset):
        digits = ''.join([str(d) for d in digits])
    return quote(digits)
示例#4
0
文件: core.py 项目: nhtdata/pystrix
def _process_digit_list(digits):
    """
    Ensures that digit-lists are processed uniformly.
    """
    if type(digits) in (list, tuple, set, frozenset):
        digits = ''.join([str(d) for d in digits])
    return quote(digits)
示例#5
0
文件: core.py 项目: nhtdata/pystrix
 def __init__(self, filename, format=FORMAT_WAV, escape_digits='', timeout=-1, sample_offset=0, beep=True, silence=None):
     escape_digits = _process_digit_list(escape_digits)
     _Action.__init__(self,
      'RECORD FILE', quote(filename), quote(format),
      quote(escape_digits), quote(timeout), quote(sample_offset),
      (beep and quote('beep') or None),
      (silence and quote('s=' + str(silence)) or None)
     )
示例#6
0
文件: core.py 项目: nhtdata/pystrix
 def __init__(self, number, name=None):
     if name: #Escape it
         name = '\\"%(name)s\\"' % {
          'name': name,
         }
     else: #Make sure it's the empty string
         name = ''
     number = "%(name)s<%(number)s>" % {
      'name': name,
      'number': number,
     }
     _Action.__init__(self, 'SET CALLERID', quote(number))
示例#7
0
文件: core.py 项目: ramzed/pystrix
 def __init__(self, number, name=None):
     if name:  #Escape it
         name = '\\"%(name)s\\"' % {
             'name': name,
         }
     else:  #Make sure it's the empty string
         name = ''
     number = "%(name)s<%(number)s>" % {
         'name': name,
         'number': number,
     }
     _Action.__init__(self, 'SET CALLERID', quote(number))
示例#8
0
文件: core.py 项目: ramzed/pystrix
 def __init__(self,
              filename,
              format=FORMAT_WAV,
              escape_digits='',
              timeout=-1,
              sample_offset=0,
              beep=True,
              silence=None):
     escape_digits = _process_digit_list(escape_digits)
     _Action.__init__(self, 'RECORD FILE', quote(filename), quote(format),
                      quote(escape_digits), quote(timeout),
                      quote(sample_offset),
                      (beep and quote('beep') or None),
                      (silence and quote('s=' + str(silence)) or None))
示例#9
0
文件: core.py 项目: ramzed/pystrix
 def __init__(self,
              filename,
              escape_digits='',
              sample_offset=0,
              forward='',
              rewind='',
              pause=''):
     escape_digits = _process_digit_list(escape_digits)
     _Action.__init__(self, 'CONTROL STREAM FILE', quote(filename),
                      quote(escape_digits), quote(sample_offset),
                      quote(forward), quote(rewind), quote(pause))
示例#10
0
文件: core.py 项目: ramzed/pystrix
 def __init__(self, family, keytree=None):
     _Action.__init__(self, 'DATABASE DELTREE', quote(family),
                      (keytree and quote(keytree) or None))
示例#11
0
文件: core.py 项目: nhtdata/pystrix
 def __init__(self, text):
     _Action.__init__(self, 'SEND TEXT', quote(text))
示例#12
0
文件: core.py 项目: nhtdata/pystrix
 def __init__(self, channel=None):
     _Action.__init__(self, 'HANGUP', (channel and quote(channel) or None))
示例#13
0
文件: core.py 项目: ramzed/pystrix
 def __init__(self, filename, escape_digits='', timeout=2000):
     escape_digits = _process_digit_list(escape_digits)
     _Action.__init__(self, 'GET OPTION', quote(filename),
                      quote(escape_digits), quote(timeout))
示例#14
0
文件: core.py 项目: ramzed/pystrix
 def __init__(self, application, options=()):
     options = ','.join((str(o or '') for o in options))
     _Action.__init__(self, 'EXEC', application,
                      (options and quote(options)) or '')
示例#15
0
文件: core.py 项目: ramzed/pystrix
 def __init__(self, timeout=0):
     _Action.__init__(self, 'RECEIVE TEXT', quote(timeout))
示例#16
0
文件: core.py 项目: ramzed/pystrix
 def __init__(self, seconds=0):
     _Action.__init__(self, 'SET AUTOHANGUP', quote(seconds))
示例#17
0
文件: core.py 项目: nhtdata/pystrix
 def __init__(self, priority):
     _Action.__init__(self, 'SET PRIORITY', quote(priority))
示例#18
0
文件: core.py 项目: ramzed/pystrix
 def __init__(self, filename):
     _Action.__init__(self, 'SEND FILE', quote(filename))
示例#19
0
文件: core.py 项目: ramzed/pystrix
 def __init__(self, text):
     _Action.__init__(self, 'SEND TEXT', quote(text))
示例#20
0
文件: core.py 项目: ramzed/pystrix
 def __init__(self, family, key):
     _Action.__init__(self, 'DATABASE GET', quote(family), quote(key))
示例#21
0
文件: core.py 项目: ramzed/pystrix
 def __init__(self, say_type, argument, escape_digits, *args):
     escape_digits = _process_digit_list(escape_digits)
     _Action.__init__(self, 'SAY ' + say_type, quote(argument),
                      quote(escape_digits), *args)
示例#22
0
文件: core.py 项目: ramzed/pystrix
 def __init__(self, variable):
     _Action.__init__(self, 'GET VARIABLE', quote(variable))
示例#23
0
文件: core.py 项目: ramzed/pystrix
 def __init__(self, filename, timeout=2000, max_digits=255):
     _Action.__init__(self, 'GET DATA', quote(filename), quote(timeout),
                      quote(max_digits))
示例#24
0
文件: core.py 项目: nhtdata/pystrix
 def __init__(self, family, key):
     _Action.__init__(self, 'DATABASE GET', quote(family), quote(key))
示例#25
0
文件: core.py 项目: nhtdata/pystrix
 def __init__(self, extension):
     _Action.__init__(self, 'SET EXTENSION', quote(extension))
示例#26
0
文件: core.py 项目: nhtdata/pystrix
 def __init__(self, application, options=()):
     self._application = application
     options = ','.join((str(o or '') for o in options))
     _Action.__init__(self, 'EXEC', self._application, (options and quote(options)) or '')
示例#27
0
文件: core.py 项目: nhtdata/pystrix
 def __init__(self, filename, escape_digits='', sample_offset=0):
     escape_digits = _process_digit_list(escape_digits)
     _Action.__init__(self,
      'STREAM FILE', quote(filename),
      quote(escape_digits), quote(sample_offset)
     )
示例#28
0
文件: core.py 项目: nhtdata/pystrix
 def __init__(self, filename, escape_digits='', timeout=2000):
     escape_digits = _process_digit_list(escape_digits)
     _Action.__init__(self,
      'GET OPTION', quote(filename),
      quote(escape_digits), quote(timeout)
     )
示例#29
0
文件: core.py 项目: nhtdata/pystrix
 def __init__(self, family, keytree=None):
     _Action.__init__(self,
      'DATABASE DELTREE', quote(family), (keytree and quote(keytree) or None)
     )
示例#30
0
文件: core.py 项目: ramzed/pystrix
 def __init__(self, channel=None):
     _Action.__init__(self, 'HANGUP', (channel and quote(channel) or None))
示例#31
0
文件: core.py 项目: nhtdata/pystrix
 def __init__(self, family, key, value):
     _Action.__init__(self, 'DATABASE PUT', quote(family), quote(key), quote(value))
示例#32
0
文件: core.py 项目: ramzed/pystrix
 def __init__(self, context):
     _Action.__init__(self, 'SET CONTEXT', quote(context))
示例#33
0
文件: core.py 项目: nhtdata/pystrix
 def __init__(self, filename, timeout=2000, max_digits=255):
     _Action.__init__(self,
      'GET DATA', quote(filename), quote(timeout), quote(max_digits)
     )
示例#34
0
文件: core.py 项目: ramzed/pystrix
 def __init__(self, extension):
     _Action.__init__(self, 'SET EXTENSION', quote(extension))
示例#35
0
文件: core.py 项目: nhtdata/pystrix
 def __init__(self, variable):
     _Action.__init__(self, 'GET VARIABLE', quote(variable))
示例#36
0
文件: core.py 项目: ramzed/pystrix
 def __init__(self, on, moh_class=None):
     _Action.__init__(self, 'SET MUSIC', quote(on and 'on' or 'off'),
                      (moh_class and quote(moh_class) or None))
示例#37
0
文件: core.py 项目: nhtdata/pystrix
 def __init__(self, timeout=0):
     _Action.__init__(self, 'RECEIVE TEXT', quote(timeout))
示例#38
0
文件: core.py 项目: ramzed/pystrix
 def __init__(self, priority):
     _Action.__init__(self, 'SET PRIORITY', quote(priority))
示例#39
0
文件: core.py 项目: nhtdata/pystrix
 def __init__(self, say_type, argument, escape_digits, *args):
     escape_digits = _process_digit_list(escape_digits)
     _Action.__init__(self,
      'SAY ' + say_type, quote(argument), quote(escape_digits), *args
     )
示例#40
0
文件: core.py 项目: ramzed/pystrix
 def __init__(self, name, value):
     _Action.__init__(self, 'SET VARIABLE', quote(name), quote(value))
示例#41
0
文件: core.py 项目: nhtdata/pystrix
 def __init__(self, filename):
     _Action.__init__(self, 'SEND FILE', quote(filename))
示例#42
0
文件: core.py 项目: ramzed/pystrix
 def __init__(self, filename, escape_digits='', sample_offset=0):
     escape_digits = _process_digit_list(escape_digits)
     _Action.__init__(self, 'STREAM FILE', quote(filename),
                      quote(escape_digits), quote(sample_offset))
示例#43
0
文件: core.py 项目: nhtdata/pystrix
 def __init__(self, seconds=0):
     _Action.__init__(self, 'SET AUTOHANGUP', quote(seconds))
示例#44
0
文件: core.py 项目: ramzed/pystrix
 def __init__(self, message, level=LOG_INFO):
     _Action.__init__(self, 'VERBOSE', quote(message), quote(level))
示例#45
0
文件: core.py 项目: nhtdata/pystrix
 def __init__(self, context):
     _Action.__init__(self, 'SET CONTEXT', quote(context))
示例#46
0
文件: core.py 项目: ramzed/pystrix
 def __init__(self, timeout=-1):
     _Action.__init__(self, 'WAIT FOR DIGIT', quote(timeout))
示例#47
0
文件: core.py 项目: nhtdata/pystrix
 def __init__(self, on, moh_class=None):
     _Action.__init__(self,
      'SET MUSIC', quote(on and 'on' or 'off'),
      (moh_class and quote(moh_class) or None)
     )
示例#48
0
文件: core.py 项目: nhtdata/pystrix
 def __init__(self, timeout=-1):
     _Action.__init__(self, 'WAIT FOR DIGIT', quote(timeout))
示例#49
0
文件: core.py 项目: nhtdata/pystrix
 def __init__(self, name, value):
     _Action.__init__(self, 'SET VARIABLE', quote(name), quote(value))
示例#50
0
文件: core.py 项目: nhtdata/pystrix
 def __init__(self, filename, escape_digits='', sample_offset=0, forward='', rewind='', pause=''):
     escape_digits = _process_digit_list(escape_digits)
     _Action.__init__(self, 'CONTROL STREAM FILE', quote(filename),
      quote(escape_digits), quote(sample_offset),
      quote(forward), quote(rewind), quote(pause)
     )
示例#51
0
文件: core.py 项目: nhtdata/pystrix
 def __init__(self, message, level=LOG_INFO):
     _Action.__init__(self, 'VERBOSE', quote(message), quote(level))
示例#52
0
文件: core.py 项目: ramzed/pystrix
 def __init__(self, family, key, value):
     _Action.__init__(self, 'DATABASE PUT', quote(family), quote(key),
                      quote(value))
示例#53
0
文件: core.py 项目: nhtdata/pystrix
 def __init__(self, channel=None):
     _Action.__init__(self, 'CHANNEL STATUS', (channel and quote(channel)) or None)
示例#54
0
文件: core.py 项目: ramzed/pystrix
 def __init__(self, channel=None):
     _Action.__init__(self, 'CHANNEL STATUS', (channel and quote(channel))
                      or None)