New options to force coming event detection to True
This commit is contained in:
parent
a5a07d447d
commit
9dd2cc5624
9
main.py
9
main.py
@ -45,7 +45,7 @@ class WidgetPlacement:
|
||||
self.kwargs = kwargs
|
||||
|
||||
|
||||
def main(only_on_coming_evt=False, ignore_module=[], **config_args):
|
||||
def main(only_on_coming_evt=False, ignore_module=[], force_coming_event=True, **config_args):
|
||||
image = Image.new('1', (480, 800), 255)
|
||||
#image = Image.new('L', (480, 800), 'white')
|
||||
draw = ImageDraw.Draw(image)
|
||||
@ -80,9 +80,9 @@ def main(only_on_coming_evt=False, ignore_module=[], **config_args):
|
||||
shape.append(WidgetPlacement(IcalModule, config, size=(480-int(480/1.6), 255), position=(0, 250)))
|
||||
|
||||
occuped_space = 0
|
||||
if "IcalModule" not in ignore_module:
|
||||
if "IcalModule" not in ignore_module or force_coming_event:
|
||||
ical = IcalModule(config)
|
||||
evt_coming = ical.non_local_event_coming(config) or ical.local_event_ending(config)
|
||||
evt_coming = force_coming_event or ical.non_local_event_coming(config) or ical.local_event_ending(config)
|
||||
if evt_coming:
|
||||
from modules.ratp import RATPNextStopModule
|
||||
nstops = RATPNextStopModule().draw_module(config, ["RB/cite+universitaire", "M7/porte+d'italie"], int(480/1.6), 275)
|
||||
@ -192,6 +192,8 @@ if __name__ == '__main__':
|
||||
|
||||
parser.add_argument('--ignore-module', '-I', nargs="*", default=[],
|
||||
help='Ignore the given modules')
|
||||
parser.add_argument('--force-coming-evt', '-E', action='store_const', const=True,
|
||||
help='Consider an event coming, whatever calendar says')
|
||||
parser.add_argument('--only-on-coming-evt', '-O', action='store_const', const=True,
|
||||
help='Refresh screen only if there is upcoming event')
|
||||
parser.add_argument('--cache-timeout', '-C', type=int, default=90,
|
||||
@ -204,6 +206,7 @@ if __name__ == '__main__':
|
||||
main(
|
||||
args.only_on_coming_evt,
|
||||
args.ignore_module,
|
||||
args.force_coming_evt,
|
||||
cache_timeout=args.cache_timeout,
|
||||
max_cache_timeout=args.max_cache_timeout,
|
||||
)
|
||||
|
Loading…
x
Reference in New Issue
Block a user