forked from kercos/PickMeUp
-
Notifications
You must be signed in to change notification settings - Fork 1
/
params.py
37 lines (29 loc) · 1.19 KB
/
params.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# -*- coding: utf-8 -*-
GIORNI_SETTIMANA = ['LU', 'MA', 'ME', 'GI', 'VE', 'SA', 'DO']
GIORNI_SETTIMANA_FULL = ['lunedì', 'martedì', 'mercoledì', 'giovedì', 'venerdì', 'sabato', 'domenica']
#TIME_TOLERANCE_MIN = 5 # show also rides scheduled 5 min ago
TIME_TOLERANCE_MIN = 25 # show also rides scheduled 5 min ago
MAX_FERMATE_NEAR_LOCATION = 5
MAX_PERCORSI = 8
PATH_FERMATA_PROXIMITY_THRESHOLD = 1.0
DAY_START_HOUR = 6
MIN_TO_SWITCH_TO_NEXT_HOUR = 52 # if it's 13.52 don't show 13
NOTIFICATION_MODE_NONE = "NONE"
NOTIFICATION_MODE_ALL = "ALL"
NOTIFICATION_MODE_PERCORSI = "PERCORSI"
DEFAULT_NOTIFICATIONS_MODE = NOTIFICATION_MODE_ALL
NOTIFICATIONS_MODES = [NOTIFICATION_MODE_ALL, NOTIFICATION_MODE_PERCORSI, NOTIFICATION_MODE_NONE]
# should follow same order as in main.NOTIFICHE_BUTTONS
PERCORSO_COMMAND_PREFIX = '/percorso_'
def getCommand(prefix, suffix, escapeMarkdown=True):
import utility
result = "{}{}".format(prefix, suffix)
if escapeMarkdown:
return utility.escapeMarkdown(result)
return result
def getIndexFromCommand(command, prefix):
import utility
index = command[len(prefix):]
if utility.representsInt(index):
return int(index)
return None