当前位置: 首页>>代码示例>>Python>>正文


Python CallFile.spool方法代码示例

本文整理汇总了Python中pycall.CallFile.spool方法的典型用法代码示例。如果您正苦于以下问题:Python CallFile.spool方法的具体用法?Python CallFile.spool怎么用?Python CallFile.spool使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在pycall.CallFile的用法示例。


在下文中一共展示了CallFile.spool方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_spool_no_time_no_user_error

# 需要导入模块: from pycall import CallFile [as 别名]
# 或者: from pycall.CallFile import spool [as 别名]
 def test_spool_no_time_no_user_error(self):
     """Ensure that `spool` raises `NoUserError` if the user attribute is
     not a real system user.
     """
     c = CallFile(self.call, self.action, spool_dir=self.spool_dir,
             user='asjdfgkhkgaskqtjwhkjwetghqekjtbkwthbjkltwhwklt')
     c.spool()
开发者ID:Scinawa,项目名称:pycall,代码行数:9,代码来源:test_callfile.py

示例2: test_spool_no_time_no_user_permission_error

# 需要导入模块: from pycall import CallFile [as 别名]
# 或者: from pycall.CallFile import spool [as 别名]
 def test_spool_no_time_no_user_permission_error(self):
     """Ensure that `spool` raises `NoUserPermissionError` if the user
     specified does not have permissions to write to the Asterisk spooling
     directory.
     """
     c = CallFile(self.call, self.action, spool_dir='/', user='root')
     c.spool()
开发者ID:Scinawa,项目名称:pycall,代码行数:9,代码来源:test_callfile.py

示例3: test_spool_no_time_no_user

# 需要导入模块: from pycall import CallFile [as 别名]
# 或者: from pycall.CallFile import spool [as 别名]
 def test_spool_no_time_no_user(self):
     """Ensure `spool` works when no `time` attribute is supplied, and no
     `user` attribute exists.
     """
     c = CallFile(self.call, self.action, spool_dir=self.spool_dir)
     c.spool()
     ok_((path(c.spool_dir) / path(c.filename)).abspath().exists())
开发者ID:Scinawa,项目名称:pycall,代码行数:9,代码来源:test_callfile.py

示例4: test_spool_no_time_user

# 需要导入模块: from pycall import CallFile [as 别名]
# 或者: from pycall.CallFile import spool [as 别名]
 def test_spool_no_time_user(self):
     """Ensure that `spool` works when no `time` attribute is specified, and
     a valid `user` attribute exists.
     """
     c = CallFile(self.call, self.action, spool_dir=self.spool_dir,
             user=getuser())
     c.spool()
开发者ID:Scinawa,项目名称:pycall,代码行数:9,代码来源:test_callfile.py

示例5: test_spool_no_time_no_spool_permission_error

# 需要导入模块: from pycall import CallFile [as 别名]
# 或者: from pycall.CallFile import spool [as 别名]
    def test_spool_no_time_no_spool_permission_error(self):
        """Ensure that `spool` raises `NoSpoolPermissionError` if the user
        doesn't have permissions to write to `spool_dir`.

        NOTE: This test WILL fail if the user account you run this test under
        has write access to the / directory on your local filesystem.
        """
        c = CallFile(self.call, self.action, spool_dir='/')
        c.spool()
开发者ID:Scinawa,项目名称:pycall,代码行数:11,代码来源:test_callfile.py

示例6: dialout

# 需要导入模块: from pycall import CallFile [as 别名]
# 或者: from pycall.CallFile import spool [as 别名]
def dialout():
    call_from = request.args.get('from', '')
    call_to = request.args.get('to', '')
    cfrom = 'SIP/{}@hotvoip'.format(call_from)
    cto = 'SIP/{}@hotvoip'.format(call_to)
    c = Call(cfrom)
    a = Application('Dial', cto)
    cf = CallFile(c, a)
    cf.spool()
    return 'dialed'
开发者ID:boyombo,项目名称:asterisk-pycall-flask,代码行数:12,代码来源:app.py

示例7: localcall

# 需要导入模块: from pycall import CallFile [as 别名]
# 或者: from pycall.CallFile import spool [as 别名]
def localcall():
    call_from = request.args.get('from', '')
    call_to = request.args.get('to', '')
    if call_from and call_to:
        cfrom = 'SIP/{}'.format(call_from)
        logging.debug(cfrom)
        cto = 'SIP/{}'.format(call_to)
        logging.debug(cto)
        c = Call(cfrom)
        a = Application('Dial', cto)
        cf = CallFile(c, a)
        cf.spool()
    else:
        return "no call made"
    return "call made"
开发者ID:boyombo,项目名称:asterisk-pycall-flask,代码行数:17,代码来源:app.py

示例8: test_spool_time_no_user

# 需要导入模块: from pycall import CallFile [as 别名]
# 或者: from pycall.CallFile import spool [as 别名]
 def test_spool_time_no_user(self):
     """Ensure that `spool` works when given a valid `time` parameter."""
     c = CallFile(self.call, self.action, spool_dir=self.spool_dir)
     d = datetime.now()
     c.spool(d)
     eq_((path(c.tempdir) / path(c.filename)).abspath().atime, mktime(d.timetuple()))
开发者ID:Scinawa,项目名称:pycall,代码行数:8,代码来源:test_callfile.py

示例9: Call

# 需要导入模块: from pycall import CallFile [as 别名]
# 或者: from pycall.CallFile import spool [as 别名]
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Author: Joshua
# @E-Mail: [email protected]
# @Date:   2015-04-29 17:52:36
# @About test.py

from pycall import CallFile, Call, Application
call = Call('SIP/flowroute/13694182569')
action = Application('Playback', 'hello-world')
c = CallFile(call, action)
c.spool()
开发者ID:fooyou,项目名称:Exercise,代码行数:14,代码来源:test.py


注:本文中的pycall.CallFile.spool方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。