projects
/
python_utils.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Obscure some passwords/keys. There's actually nothing valuable here
[python_utils.git]
/
site_config.py
diff --git
a/site_config.py
b/site_config.py
index 7f6410d39356c1d0d8f910cfcece67eaf4cff29e..5a4eeffbafd5c2f32ddd412f41986ec92f481985 100644
(file)
--- a/
site_config.py
+++ b/
site_config.py
@@
-82,15
+82,18
@@
def other_location() -> str:
>>> x in set(['HOUSE', 'CABIN'])
True
>>> x in set(['HOUSE', 'CABIN'])
True
+ >>> y = this_location()
+ >>> x == y
+ False
+
"""
"""
-
hostname = platform.node
()
- if
'.house' in hostname
:
-
location =
'CABIN'
- elif
'.cabin' in hostname
:
-
location =
'HOUSE'
+
this = this_location
()
+ if
this == 'HOUSE'
:
+
return
'CABIN'
+ elif
this == 'CABIN'
:
+
return
'HOUSE'
else:
else:
- raise Exception(f"{hostname} doesn't help me know where I'm running?!")
- return location
+ raise Exception(f"{this} doesn't tell me where I'm running?!")
def this_location() -> str:
def this_location() -> str:
@@
-107,6
+110,8
@@
def this_location() -> str:
location = 'HOUSE'
elif '.cabin' in hostname:
location = 'CABIN'
location = 'HOUSE'
elif '.cabin' in hostname:
location = 'CABIN'
+ elif '.local' in hostname:
+ location = 'HOUSE'
else:
raise Exception(f"{hostname} doesn't help me know where I'm running?!")
return location
else:
raise Exception(f"{hostname} doesn't help me know where I'm running?!")
return location