Attempt to load configuration from a module my_ipsc_config.py to allow leaving your systems configured without editing the main Python source file - and as that file is expected to have IPs / keys that may not be intended for the public, tell git to ignore that file.

This commit is contained in:
Adam Fast 2013-06-28 23:38:28 -05:00
parent 1253c7f405
commit 3413dee576
2 changed files with 79 additions and 74 deletions

2
.gitignore vendored
View File

@ -1,3 +1,5 @@
.DS_Store .DS_Store
.dropbox .dropbox
Icon Icon
my_ipsc_config.py
*.pyc

View File

@ -62,7 +62,10 @@ logger = logging.getLogger('ipsc')
# Data structure for holding IPSC information # Data structure for holding IPSC information
NETWORK = { try:
from my_ipsc_config import NETWORK
except ImportError:
NETWORK = {
'IPSC1': { 'IPSC1': {
'LOCAL': { 'LOCAL': {
'DESCRIPTION': 'IPSC Network #1', 'DESCRIPTION': 'IPSC Network #1',
@ -139,7 +142,7 @@ NETWORK = {
#{'IP': '100.200.1.1', 'PORT': 50000, 'RADIO_ID': b'\x00\x00\x00\xFF'}, #{'IP': '100.200.1.1', 'PORT': 50000, 'RADIO_ID': b'\x00\x00\x00\xFF'},
] ]
} }
} }
# Known IPSC Message Types # Known IPSC Message Types