コード例 #1
0
ファイル: features.py プロジェクト: 4nakin/freeciv-android
def load_config():
    import osutil
    FEATURE_FILE_PATH = osutil.get_internal_storage() + '/features'
    print 'features', FEATURE_FILE_PATH

    try:
        for line in open(FEATURE_FILE_PATH):
            try:
                k, v = _parse_arg(line.rstrip())
                pernaments[k] = v
            except Exception as err:
                print 'failed to parse config line %r' % line
    except IOError:
        print 'feature config not read'
コード例 #2
0
def get_feature_file_path():
    import osutil
    return osutil.get_internal_storage() + '/features'
コード例 #3
0
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.

import sys
import osutil

features = {}
appliers = {}
feature_types = {}
pernaments = {}

FEATURE_FILE_PATH = osutil.get_internal_storage() + '/features'
print 'features', FEATURE_FILE_PATH

monitor = None

def log(str):
    global monitor
    if not monitor:
        try:
            import monitor
        except ImportError:
            print str
            return
    monitor.log('features', str)

def get(name):