projects
/
python_utils.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Reduce import scopes, remove cycles.
[python_utils.git]
/
presence.py
diff --git
a/presence.py
b/presence.py
index b6e9fc304be31188b7fd01bc7ac8616057a203ba..682855d7491245a232e2d1ec3414e67eef5dae2a 100644
(file)
--- a/
presence.py
+++ b/
presence.py
@@
-9,8
+9,6
@@
from typing import Dict, List
import argparse_utils
import config
import argparse_utils
import config
-import dict_utils
-import exec_utils
logger = logging.getLogger(__name__)
logger = logging.getLogger(__name__)
@@
-83,9
+81,10
@@
class PresenceDetection(object):
self.update()
def update(self) -> None:
self.update()
def update(self) -> None:
+ from exec_utils import cmd
persisted_macs = config.config['presence_macs_file']
self.read_persisted_macs_file(persisted_macs, Location.HOUSE)
persisted_macs = config.config['presence_macs_file']
self.read_persisted_macs_file(persisted_macs, Location.HOUSE)
- raw =
exec_utils.
cmd(
+ raw = cmd(
"ssh
[email protected]
'cat /home/scott/cron/persisted_mac_addresses.txt'"
)
self.parse_raw_macs_file(raw, Location.CABIN)
"ssh
[email protected]
'cat /home/scott/cron/persisted_mac_addresses.txt'"
)
self.parse_raw_macs_file(raw, Location.CABIN)
@@
-142,6
+141,8
@@
class PresenceDetection(object):
return False
def where_is_person_now(self, name: Person) -> Location:
return False
def where_is_person_now(self, name: Person) -> Location:
+ import dict_utils
+
if name is Person.UNKNOWN:
if self.weird_mac_at_cabin:
return Location.CABIN
if name is Person.UNKNOWN:
if self.weird_mac_at_cabin:
return Location.CABIN