File: config.py

package info (click to toggle)
mc-foo 0.0.13
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 268 kB
  • ctags: 532
  • sloc: python: 1,967; makefile: 6
file content (20 lines) | stat: -rw-r--r-- 430 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import os

class ConfigStore:
    host=None
    port=None

    def __init__(self):
        if self.host==None:
            try:
                self.host=os.environ['MCFOOHOST']
            except KeyError:
                self.host='localhost'

        if self.port==None:
            try:
                self.port=int(os.environ['MCFOOPORT'])
            except KeyError:
                self.port=25706

store = ConfigStore()