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


Python reflect.prefixedMethods函数代码示例

本文整理汇总了Python中twisted.python.reflect.prefixedMethods函数的典型用法代码示例。如果您正苦于以下问题:Python prefixedMethods函数的具体用法?Python prefixedMethods怎么用?Python prefixedMethods使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: getPersonCommands

    def getPersonCommands(self):
        """finds person commands

        these commands are methods on me that start with imperson_; they are
        called with no arguments
        """
        return prefixedMethods(self, "imperson_")
开发者ID:0004c,项目名称:VTK,代码行数:7,代码来源:basesupport.py

示例2: getGroupCommands

    def getGroupCommands(self):
        """finds group commands

        these commands are methods on me that start with imgroup_; they are
        called with no arguments
        """
        return prefixedMethods(self, "imgroup_")
开发者ID:0004c,项目名称:VTK,代码行数:7,代码来源:basesupport.py

示例3: test_prefix

 def test_prefix(self):
     """
     If a prefix is given, L{prefixedMethods} returns only methods named
     with that prefix.
     """
     x = Separate()
     output = prefixedMethods(x, 'good_')
     self.assertEqual([x.good_method], output)
开发者ID:JohnDoes95,项目名称:project_parser,代码行数:8,代码来源:test_reflect.py

示例4: test_onlyObject

 def test_onlyObject(self):
     """
     L{prefixedMethods} returns a list of the methods discovered on an
     object.
     """
     x = Base()
     output = prefixedMethods(x)
     self.assertEqual([x.method], output)
开发者ID:JohnDoes95,项目名称:project_parser,代码行数:8,代码来源:test_reflect.py

示例5: getTargetCommands

    def getTargetCommands(self, target):
        """finds group commands

        these commands are methods on me that start with imgroup_; they are
        called with a user present within this room as an argument

        you may want to override this in your group in order to filter for
        appropriate commands on the given user
        """
        return prefixedMethods(self, "imtarget_")
开发者ID:0004c,项目名称:VTK,代码行数:10,代码来源:basesupport.py

示例6: test_failUnlessMatchesAssert

 def test_failUnlessMatchesAssert(self):
     """
     The C{failUnless*} test methods are a subset of the C{assert*} test
     methods.  This is intended to ensure that methods using the
     I{failUnless} naming scheme are not added without corresponding methods
     using the I{assert} naming scheme.  The I{assert} naming scheme is
     preferred, and new I{assert}-prefixed methods may be added without
     corresponding I{failUnless}-prefixed methods.
     """
     asserts = set(self._getAsserts())
     failUnlesses = set(prefixedMethods(self, "failUnless"))
     self.assertEqual(failUnlesses, asserts.intersection(failUnlesses))
开发者ID:alfonsjose,项目名称:international-orders-app,代码行数:12,代码来源:test_assertions.py

示例7: getTasks

    def getTasks(self):
        """
        Get all tasks of this L{Service} object.

        Intended to be used like::

            globals().update(Service('name').getTasks())

        at the module level of a fabfile.

        @returns: L{dict} of L{fabric.tasks.Task}
        """
        tasks = [(t, _stripPrefix(t))
                 for t in prefixedMethods(self, TASK_PREFIX)]
        return {name: task(name=name)(t) for t, name in tasks}
开发者ID:tomprince,项目名称:braid,代码行数:15,代码来源:tasks.py

示例8: __init__

 def __init__(self, o=None):
     self.xml = x = gtk.glade.XML(sibpath(__file__, "inspectro.glade"))
     self.tree_view = x.get_widget("treeview")
     colnames = ["Name", "Value"]
     for i in range(len(colnames)):
         self.tree_view.append_column(gtk.TreeViewColumn(colnames[i], gtk.CellRendererText(), text=i))
     d = {}
     for m in reflect.prefixedMethods(self, "on_"):
         d[m.im_func.__name__] = m
     self.xml.signal_autoconnect(d)
     if o is not None:
         self.inspect(o)
     self.ns = {"inspect": self.inspect}
     iwidget = x.get_widget("input")
     self.input = ConsoleInput(iwidget)
     self.input.toplevel = self
     iwidget.connect("key_press_event", self.input._on_key_press_event)
     self.output = ConsoleOutput(x.get_widget("output"))
开发者ID:RockySteveJobs,项目名称:python-for-android,代码行数:18,代码来源:_inspectro.py

示例9: getTasks

    def getTasks(self, role=None):
        """
        Get all tasks of this L{Service} object.

        Intended to be used like::

            globals().update(Service('name').getTasks())

        at the module level of a fabfile.

        @returns: L{dict} of L{fabric.tasks.Task}
        """
        tasks = prefixedMethods(self, TASK_PREFIX)
        tasks = ((_stripPrefix(t), t) for t in tasks)
        tasks = ((name, task(name=name)(t)) for name, t in tasks)

        if role:
            tasks = ((name, roles(role)(t)) for name, t in tasks)

        return dict(tasks)
开发者ID:OpenSorceress,项目名称:braid,代码行数:20,代码来源:tasks.py

示例10: test_failIf_matches_assertNot

 def test_failIf_matches_assertNot(self):
     asserts = prefixedMethods(unittest.SynchronousTestCase, 'assertNot')
     failIfs = prefixedMethods(unittest.SynchronousTestCase, 'failIf')
     self.assertEqual(sorted(asserts, key=self._name),
                          sorted(failIfs, key=self._name))
开发者ID:12019,项目名称:OpenWrt_Luci_Lua,代码行数:5,代码来源:test_assertions.py

示例11: check

 def check(self, dom, filename):
     self.hadErrors = 0
     for method in reflect.prefixedMethods(self, 'check_'):
         method(dom, filename)
     if self.hadErrors:
         raise process.ProcessingFailure("invalid format")
开发者ID:AnthonyNystrom,项目名称:YoGoMee,代码行数:6,代码来源:lint.py

示例12: test_failIf_matches_assertNot

 def test_failIf_matches_assertNot(self):
     asserts = reflect.prefixedMethods(unittest.TestCase, "assertNot")
     failIfs = reflect.prefixedMethods(unittest.TestCase, "failIf")
     self.assertEqual(sorted(asserts, key=self._name), sorted(failIfs, key=self._name))
开发者ID:wangdayoux,项目名称:OpenSignals,代码行数:4,代码来源:test_assertions.py

示例13: test_failIf_matches_assertNot

 def test_failIf_matches_assertNot(self):
     asserts = reflect.prefixedMethods(unittest.TestCase, 'assertNot')
     failIfs = reflect.prefixedMethods(unittest.TestCase, 'failIf')
     self.failUnlessEqual(dsu(asserts, self._name),
                          dsu(failIfs, self._name))
开发者ID:radical-software,项目名称:radicalspam,代码行数:5,代码来源:test_assertions.py

示例14: test_failUnless_matches_assert

 def test_failUnless_matches_assert(self):
     asserts = self._getAsserts()
     failUnlesses = reflect.prefixedMethods(self, 'failUnless')
     self.failUnlessEqual(dsu(asserts, self._name),
                          dsu(failUnlesses, self._name))
开发者ID:radical-software,项目名称:radicalspam,代码行数:5,代码来源:test_assertions.py

示例15: test_51_h263_sharedvideosink

        recv.videocodec = 'h264'
        send.videocodec = recv.videocodec
        self.run(recv, send)

    def test_51_h263_sharedvideosink(self):
        """ Test with sharedvideosink """
        recv, send = self.argfactory('video')

        recv.videosink = 'sharedvideosink'
        recv.videocodec = 'h263'
        send.videocodec = recv.videocodec
        self.run(recv, send)

    def test_52_theora_deinterlace_sharedvideosink(self):
        """ Test with sharedvideosink """
        recv, send = self.argfactory('video')
        recv.videosink = 'sharedvideosink'
        recv.videocodec = 'theora'
        send.videocodec = recv.videocodec
        recv.deinterlace = True
        self.run(recv, send)

if __name__ == '__main__':
    # here we run all the tests thanks to the wonders of reflective programming
    TESTS = prefixedMethods(MilhouseTests(), 'test_01')

    for test in TESTS:
        print 'TEST: '  + test.__doc__
        test()

开发者ID:alg-a,项目名称:scenic,代码行数:29,代码来源:thrillhouse.py


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