Commit 8981b8ebdc85f8e69cd55498eeded62266b6f402
1 parent
fd4b5381
Split service_keywords.py (Newtend)
Showing
3 changed files
with
23 additions
and
20 deletions
@@ -2,6 +2,7 @@ | @@ -2,6 +2,7 @@ | ||
2 | Library Selenium2Screenshots | 2 | Library Selenium2Screenshots |
3 | Library String | 3 | Library String |
4 | Library DateTime | 4 | Library DateTime |
5 | +Library newtend_service.py | ||
5 | 6 | ||
6 | *** Variables *** | 7 | *** Variables *** |
7 | ${locator.title} xpath=//div[@ng-bind="tender.title"] | 8 | ${locator.title} xpath=//div[@ng-bind="tender.title"] |
@@ -66,7 +67,7 @@ Login | @@ -66,7 +67,7 @@ Login | ||
66 | [Documentation] | 67 | [Documentation] |
67 | ... ${ARGUMENTS[0]} == username | 68 | ... ${ARGUMENTS[0]} == username |
68 | ... ${ARGUMENTS[1]} == initial_tender_data | 69 | ... ${ARGUMENTS[1]} == initial_tender_data |
69 | -## Inicialisation | 70 | +## Initialisation |
70 | #${prepared_tender_data}= Add_data_for_GUI_FrontEnds ${ARGUMENTS[1]} | 71 | #${prepared_tender_data}= Add_data_for_GUI_FrontEnds ${ARGUMENTS[1]} |
71 | ${INITIAL_TENDER_DATA}= Add_data_for_GUI_FrontEnds ${INITIAL_TENDER_DATA} | 72 | ${INITIAL_TENDER_DATA}= Add_data_for_GUI_FrontEnds ${INITIAL_TENDER_DATA} |
72 | ${INITIAL_TENDER_DATA}= Update_data_for_Newtend ${INITIAL_TENDER_DATA} | 73 | ${INITIAL_TENDER_DATA}= Update_data_for_Newtend ${INITIAL_TENDER_DATA} |
1 | +from datetime import datetime | ||
2 | +from iso8601 import parse_date | ||
3 | +from calendar import monthrange | ||
4 | + | ||
5 | + | ||
6 | +def newtend_date_picker_index(isodate): | ||
7 | + now = datetime.today() | ||
8 | + date_str = '01' + str(now.month) + str(now.year) | ||
9 | + first_day_of_month = datetime.strptime(date_str, "%d%m%Y") | ||
10 | + mod = first_day_of_month.isoweekday() - 2 | ||
11 | + iso_dt = parse_date(isodate) | ||
12 | + # last_day_of_month = monthrange(now.year, now.month)[1] | ||
13 | + # LOGGER.log_message(Message("last_day_of_month: {}".format(last_day_of_month), "INFO")) | ||
14 | + if now.day > iso_dt.day: | ||
15 | + mod = monthrange(now.year, now.month)[1] + mod | ||
16 | + return mod + iso_dt.day | ||
17 | + | ||
18 | + | ||
19 | +def update_data_for_newtend(INITIAL_TENDER_DATA): | ||
20 | + INITIAL_TENDER_DATA.data.procuringEntity['name'] = u"openprocurement" | ||
21 | + return INITIAL_TENDER_DATA |
@@ -18,7 +18,6 @@ from .initial_data import ( | @@ -18,7 +18,6 @@ from .initial_data import ( | ||
18 | test_complaint_reply_data, test_question_answer_data, | 18 | test_complaint_reply_data, test_question_answer_data, |
19 | test_question_data, test_tender_data, test_tender_data_multiple_lots | 19 | test_question_data, test_tender_data, test_tender_data_multiple_lots |
20 | ) | 20 | ) |
21 | -import calendar | ||
22 | import os | 21 | import os |
23 | import time | 22 | import time |
24 | 23 | ||
@@ -222,24 +221,6 @@ def procuringEntity_name(INITIAL_TENDER_DATA): | @@ -222,24 +221,6 @@ def procuringEntity_name(INITIAL_TENDER_DATA): | ||
222 | INITIAL_TENDER_DATA.data.procuringEntity['name'] = u"Повна назва невідомо чого" | 221 | INITIAL_TENDER_DATA.data.procuringEntity['name'] = u"Повна назва невідомо чого" |
223 | return INITIAL_TENDER_DATA | 222 | return INITIAL_TENDER_DATA |
224 | 223 | ||
225 | -##Newtend | ||
226 | -def newtend_date_picker_index(isodate): | ||
227 | - now = datetime.today() | ||
228 | - date_str = '01' + str(now.month) + str(now.year) | ||
229 | - first_day_of_month = datetime.strptime(date_str, "%d%m%Y") | ||
230 | - mod = first_day_of_month.isoweekday() - 2 | ||
231 | - iso_dt=parse_date(isodate) | ||
232 | - last_day_of_month = calendar.monthrange(now.year, now.month)[1] | ||
233 | - #LOGGER.log_message(Message("last_day_of_month: {}".format(last_day_of_month), "INFO")) | ||
234 | - if now.day>iso_dt.day: | ||
235 | - mod = calendar.monthrange(now.year, now.month)[1] + mod | ||
236 | - return mod + iso_dt.day | ||
237 | - | ||
238 | -def Update_data_for_Newtend(INITIAL_TENDER_DATA): | ||
239 | - #INITIAL_TENDER_DATA.data.items[0].classification['description'] = u"Картонки" | ||
240 | - INITIAL_TENDER_DATA.data.procuringEntity['name'] = u"openprocurement" | ||
241 | - return INITIAL_TENDER_DATA | ||
242 | - | ||
243 | def subtract_from_time(date_time,substr_min,substr_sec): | 224 | def subtract_from_time(date_time,substr_min,substr_sec): |
244 | now = datetime.strptime(date_time,"%d.%m.%Y %H:%M") | 225 | now = datetime.strptime(date_time,"%d.%m.%Y %H:%M") |
245 | now = (now - timedelta(minutes=int(substr_min), seconds = int (substr_sec) )).isoformat() | 226 | now = (now - timedelta(minutes=int(substr_min), seconds = int (substr_sec) )).isoformat() |
Please
register
or
login
to post a comment