當前位置: 首頁>>代碼示例>>Python>>正文


Python ObjectType.processEvent方法代碼示例

本文整理匯總了Python中sample.ObjectType.processEvent方法的典型用法代碼示例。如果您正苦於以下問題:Python ObjectType.processEvent方法的具體用法?Python ObjectType.processEvent怎麽用?Python ObjectType.processEvent使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在sample.ObjectType的用法示例。


在下文中一共展示了ObjectType.processEvent方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: testCpp

# 需要導入模塊: from sample import ObjectType [as 別名]
# 或者: from sample.ObjectType import processEvent [as 別名]
    def testCpp(self):
        '''C++ calling C++ virtual method in multiple inheritance scenario'''
        obj = ImplementsNone()
        self.assert_(ObjectType.processEvent([obj], Event(Event.BASIC_EVENT)))
        self.assertRaises(AttributeError, getattr, obj, 'event_processed')

        self.assertEqual(obj.callSum0(1, 2, 3), 6)
開發者ID:Hasimir,項目名稱:Shiboken,代碼行數:9,代碼來源:mi_virtual_methods_test.py

示例2: testEvent

# 需要導入模塊: from sample import ObjectType [as 別名]
# 或者: from sample.ObjectType import processEvent [as 別名]
    def testEvent(self):
        '''C++ calling Python reimplementation of virtual in multiple inheritance'''
        obj = ImplementsBoth()
        self.assert_(ObjectType.processEvent([obj], Event(Event.BASIC_EVENT)))
        self.assert_(obj.event_processed)

        self.assertEqual(obj.callSum1(1, 2, 3), 12)
開發者ID:Hasimir,項目名稱:Shiboken,代碼行數:9,代碼來源:mi_virtual_methods_test.py

示例3: testEventLoop

# 需要導入模塊: from sample import ObjectType [as 別名]
# 或者: from sample.ObjectType import processEvent [as 別名]
    def testEventLoop(self):
        '''Calling virtuals in a event loop'''
        objs = [ObjectType(), NoOverride(), Override()]

        evaluated = ObjectType.processEvent(objs,
                                        Event(Event.BASIC_EVENT))

        self.assertEqual(evaluated, 3)
        self.assert_(objs[2].called)
開發者ID:BadSingleton,項目名稱:shiboken2,代碼行數:11,代碼來源:event_loop_call_virtual_test.py

示例4: testBasic

# 需要導入模塊: from sample import ObjectType [as 別名]
# 或者: from sample.ObjectType import processEvent [as 別名]
    def testBasic(self):
        '''Allowing threads and calling virtuals from C++'''
        number = 10
        objs = [Producer() for x in range(number)]
        thread = Collector(objs)

        thread.start()

        evaluated = ObjectType.processEvent(objs,
                                        Event(Event.BASIC_EVENT))

        thread.join()

        producer_data = [x.data for x in objs]
        self.assertEqual(evaluated, number)
        self.assertEqual(producer_data, thread.data)
開發者ID:BadSingleton,項目名稱:shiboken2,代碼行數:18,代碼來源:event_loop_thread_test.py


注:本文中的sample.ObjectType.processEvent方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。