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


Python Activity.EndTime方法代码示例

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


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

示例1: create_blank_activity

# 需要导入模块: from tapiriik.services.interchange import Activity [as 别名]
# 或者: from tapiriik.services.interchange.Activity import EndTime [as 别名]
 def create_blank_activity(svc=None, actType=ActivityType.Other, record=None):
     act = Activity()
     act.Type = actType
     if svc:
         act.UploadedTo = [TestTools.create_mock_upload_record(svc, record)]
     act.StartTime = datetime.now()
     act.EndTime = act.StartTime + timedelta(seconds=42)
     act.CalculateUID()
     return act
开发者ID:euphoria,项目名称:tapiriik,代码行数:11,代码来源:testtools.py

示例2: create_blank_activity

# 需要导入模块: from tapiriik.services.interchange import Activity [as 别名]
# 或者: from tapiriik.services.interchange.Activity import EndTime [as 别名]
 def create_blank_activity(svc=None, actType=ActivityType.Other, record=None):
     act = Activity()
     act.Type = actType
     if svc:
         record = record if record else TestTools.create_mock_svc_record(svc)
         act.ServiceDataCollection = TestTools.create_mock_servicedatacollection(svc, record=record)
     act.StartTime = datetime.now()
     act.EndTime = act.StartTime + timedelta(seconds=42)
     act.CalculateUID()
     return act
开发者ID:7e7,项目名称:tapiriik,代码行数:12,代码来源:testtools.py

示例3: test_activity_deduplicate_normaltz

# 需要导入模块: from tapiriik.services.interchange import Activity [as 别名]
# 或者: from tapiriik.services.interchange.Activity import EndTime [as 别名]
    def test_activity_deduplicate_normaltz(self):
        ''' ensure that we can't deduplicate activities with non-pytz timezones '''
        svcA, svcB = TestTools.create_mock_services()
        actA = TestTools.create_random_activity(svcA, tz=UTC())

        actB = Activity()
        actB.StartTime = actA.StartTime.replace(tzinfo=None) + timedelta(seconds=10)
        actB.EndTime = actA.EndTime.replace(tzinfo=None)
        actB.UploadedTo = [TestTools.create_mock_upload_record(svcB)]
        actA.Name = "Not this"
        actB.Name = "Heya"
        actB.Type = ActivityType.Walking
        actA.CalculateUID()
        actB.CalculateUID()

        activities = []
        Sync._accumulateActivities(Service.FromID("mockB"), [copy.deepcopy(actB)], activities)
        self.assertRaises(ValueError, Sync._accumulateActivities, Service.FromID("mockA"), [copy.deepcopy(actA)], activities)
开发者ID:euphoria,项目名称:tapiriik,代码行数:20,代码来源:sync.py

示例4: test_activity_deduplicate_normaltz

# 需要导入模块: from tapiriik.services.interchange import Activity [as 别名]
# 或者: from tapiriik.services.interchange.Activity import EndTime [as 别名]
    def test_activity_deduplicate_normaltz(self):
        ''' ensure that we can't deduplicate activities with non-pytz timezones '''
        svcA, svcB = TestTools.create_mock_services()
        recA = TestTools.create_mock_svc_record(svcA)
        recB = TestTools.create_mock_svc_record(svcB)
        actA = TestTools.create_random_activity(svcA, tz=UTC())

        actB = Activity()
        actB.StartTime = actA.StartTime.replace(tzinfo=None) + timedelta(seconds=10)
        actB.EndTime = actA.EndTime.replace(tzinfo=None)
        actB.ServiceDataCollection = TestTools.create_mock_servicedatacollection(svcB, record=recB)
        actA.Name = "Not this"
        actB.Name = "Heya"
        actB.Type = ActivityType.Walking
        actA.CalculateUID()
        actB.CalculateUID()

        s = SynchronizationTask(None)
        s._activities = []
        s._accumulateActivities(recB, [copy.deepcopy(actB)])
        self.assertRaises(ValueError, s._accumulateActivities, recA, [copy.deepcopy(actA)])
开发者ID:OkanEsen,项目名称:tapiriik,代码行数:23,代码来源:sync.py


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