| 1 |
#!/usr/bin/env python3 |
| 2 |
# -*- coding: utf-8 -*- |
| 3 |
|
| 4 |
# Fenrir TTY screen reader |
| 5 |
# By Chrys, Storm Dragon, and contributors. |
| 6 |
|
| 7 |
from fenrirscreenreader.core import debug |
| 8 |
|
| 9 |
|
| 10 |
class ApplicationManager: |
| 11 |
def __init__(self): |
| 12 |
pass |
| 13 |
|
| 14 |
def initialize(self, environment): |
| 15 |
self.env = environment |
| 16 |
|
| 17 |
def shutdown(self): |
| 18 |
pass |
| 19 |
|
| 20 |
def get_current_application(self): |
| 21 |
curr_app = self.env["screen"]["new_application"].upper() |
| 22 |
if not curr_app: |
| 23 |
curr_app = "DEFAULT" |
| 24 |
if curr_app == "": |
| 25 |
curr_app = "DEFAULT" |
| 26 |
return curr_app |
| 27 |
|
| 28 |
def get_prev_application(self): |
| 29 |
prev_app = self.env["screen"]["oldApplication"].upper() |
| 30 |
if not prev_app: |
| 31 |
prev_app = "DEFAULT" |
| 32 |
if prev_app == "": |
| 33 |
prev_app = "DEFAULT" |
| 34 |
return prev_app |
| 35 |
|
| 36 |
def is_application_change(self): |
| 37 |
return ( |
| 38 |
self.env["screen"]["oldApplication"] |
| 39 |
!= self.env["screen"]["new_application"] |
| 40 |
) |