8000 PR fixes · rsliang/botbuilder-python@c438cb0 · GitHub
[go: up one dir, main page]

Skip to content

Commit c438cb0

Browse files
committed
PR fixes
1 parent 0fba8fc commit c438cb0

File tree

16 files changed

+42
-31
lines changed

16 files changed

+42
-31
lines changed

libraries/botbuilder-core/botbuilder/core/bot_state.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,6 @@ async def save_changes(self, turn_context: TurnContext, force: bool = False) ->
100100
if force or (cached_state != None and cached_state.is_changed == True):
101101
storage_key = self.get_storage_key(turn_context)
102102
changes : Dict[str, object] = { storage_key: cached_state.state }
103-
print(changes)
104103
await self._storage.write(changes)
105104
cached_state.hash = cached_state.compute_hash(cached_state.state)
106105

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
1+
# Copyright (c) Microsoft Corporation. All rights reserved.
2+
# Licensed under the MIT License.
3+
4+
from datetime import datetime
15

26
class DateRange:
37

4-
def __init__(self, start, end):
8+
def __init__(self, start: datetime, end: datetime):
59
self.start = start
610
self.end = end
711

samples/Core-Bot/datatypes_timex_expression/time.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# Copyright (c) Microsoft Corporation. All rights reserved.
2+
# Licensed under the MIT License.
3+
4+
from math import floor
15

26
class Time:
37

@@ -9,8 +13,8 @@ def __init__(self, hour, minute, second):
913
@classmethod
1014
def fromSeconds(seconds):
1115
hour = floor(seconds / 3600000)
12-
minute = floor((seconds - (Hour * 3600000)) / 60000)
13-
second = (seconds - (Hour * 3600000) - (Minute * 60000)) / 1000
16+
minute = floor((seconds - (hour * 3600000)) / 60000)
17+
second = (seconds - (hour * 3600000) - (minute * 60000)) / 1000
1418
return Time(hour, minute, second)
1519

1620
def get_time(self):

samples/Core-Bot/datatypes_timex_expression/time_range.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# Copyright (c) Microsoft Corporation. All rights reserved.
2+
# Licensed under the MIT License.
13

24
class TimeRange:
35

samples/Core-Bot/datatypes_timex_expression/timex.py

Lines changed: 5 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1+
# Copyright (c) Microsoft Corporation. All rights reserved.
2+
# Licensed under the MIT License.
13

2-
from decimal import *
4+
from decimal import Decimal
5+
from copy import copy
36
from .timex_parsing import TimexParsing
47
from .timex_inference import TimexInference
58
from .timex_convert import TimexConvert
@@ -111,28 +114,7 @@ def second(self, value):
111114
delattr(self, '__time')
112115

113116
def clone(self):
114-
result = Timex()
115-
result.now = self.now
116-
result.years = self.years
117-
result.months = self.months
118-
result.weeks = self.weeks
119-
result.days = self.days
120-
result.hours = self.hours
121-
result.minutes = self.minutes
122-
result.seconds = self.seconds
123-
result.year = self.year
124-
result.month = self.month
125-
result.day_of_month = self.day_of_month
126-
result.day_of_week = self.day_of_week
127-
result.season = self.season
128-
result.week_of_year = self.week_of_year
129-
result.weekend = self.weekend
130-
result.week_of_month = self.week_of_month
131-
result.hour = self.hour
132-
result.minute = self.minute
133-
result.second = self.second
134-
result.part_of_day = self.part_of_day
135-
return result
117+
return copy(self)
136118

137119
def assign_properties(self, source):
138120
for key, value in source.items():

samples/Core-Bot/datatypes_timex_expression/timex_constants.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# Copyright (c) Microsoft Corporation. All rights reserved.
2+
# Licensed under the MIT License.
13

24
class Constants:
35
TIMEX_TYPES_PRESENT = 'present'

samples/Core-Bot/datatypes_timex_expression/timex_convert.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# Copyright (c) Microsoft Corporation. All rights reserved.
2+
# Licensed under the MIT License.
13

24
class TimexConvert:
35

samples/Core-Bot/datatypes_timex_expression/timex_date_helpers.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# Copyright (c) Microsoft Corporation. All rights reserved.
2+
# Licensed under the MIT License.
13

24
class TimexDateHelpers:
35

samples/Core-Bot/datatypes_timex_expression/timex_format.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# Copyright (c) Microsoft Corporation. All rights reserved.
2+
# Licensed under the MIT License.
13

24
from .timex_constants import Constants
35
from .timex_helpers import TimexHelpers

samples/Core-Bot/datatypes_timex_expression/timex_helpers.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1+
# Copyright (c) Microsoft Corporation. All rights reserved.
2+
# Licensed under the MIT License.
3+
4+
import math
15
from datetime import date, time, timedelta
6+
from .time import Time
27
from .timex import Timex
38
from .date_range import DateRange
49
from .time_range import TimeRange

0 commit comments

Comments
 (0)
0