Ejemplo n.º 1
0
 def test_load(self, mock_load_utf_text_file, mock_loads):
     res = load('filename')
     self.assertEqual(res, 'loads_return_value')
     mock_loads.assert_called_with('{k:0}')
     mock_load_utf_text_file.assert_called_with(
         'filename',
         default_encoding='UTF-8',
         use_utf8_strings=True,
     )
Ejemplo n.º 2
0
 def test_load(self, mock_load_utf_text_file, mock_loads):
     res = load('filename')
     self.assertEqual(res, 'loads_return_value')
     mock_loads.assert_called_with('{k:0}')
     mock_load_utf_text_file.assert_called_with(
         'filename',
         default_encoding='UTF-8',
         use_utf8_strings=True,
     )
Ejemplo n.º 3
0
def merge_plugin_configs(plugins):

  global _c
  _c = {}
  for plugin in plugins:
    config_file = os.path.join(plugin.folder, 'config.json')
    if os.path.exists(config_file):
      print 'merging: ',config_file, plugin.id
      _merge_config(config_file, plugin.id)
  #override with more important settings
  if os.path.exists('config.json'):
    extend(_c, jsoncfg.load('config.json'))
Ejemplo n.º 4
0
def _merge_config(config_file, plugin_id):
  c = jsoncfg.load(config_file)
  extend(_c, { plugin_id : c })
Ejemplo n.º 5
0
    return CaleydoConfigSection(self._expand(section))

_c = {}
def _merge_config(config_file, plugin_id):
  c = jsoncfg.load(config_file)
  extend(_c, { plugin_id : c })

_own_config = os.path.dirname(os.path.abspath(__file__)) + '/config.json'
if os.path.exists(_own_config):
  _merge_config(_own_config, 'caleydo_server')

_web_config = os.path.dirname(os.path.abspath(__file__)) + '/../caleydo_core/config.json'
if os.path.exists(_web_config):
  _merge_config(_web_config, 'caleydo_core')

if os.path.exists('config.json'):
  extend(_c, jsoncfg.load('config.json'))

def merge_plugin_configs(plugins):

  global _c
  _c = {}
  for plugin in plugins:
    config_file = os.path.join(plugin.folder, 'config.json')
    if os.path.exists(config_file):
      print 'merging: ',config_file, plugin.id
      _merge_config(config_file, plugin.id)
  #override with more important settings
  if os.path.exists('config.json'):
    extend(_c, jsoncfg.load('config.json'))
Ejemplo n.º 6
0
 def vParseFile(self, srcFile):
     cfg = jsoncfg.load(srcFile.path)
     for asset in cfg[self.assetKey]:
         srcFile.appendAsset(asset[self.key], asset)
Ejemplo n.º 7
0
 def get_hbuild_environment(self):
     """读取Hbuild项目的manifest.json文件"""
     manifest_path = os.path.join(self.hbuild_project_path, 'manifest.json')
     _json = jsoncfg.load(manifest_path)
     return _json
Ejemplo n.º 8
0
def load_build_config():
    config = jsoncfg.load(os.path.join(CURRENT_PATH, 'config.json'))
    return config
Ejemplo n.º 9
0
 def get_android_h5plussdk_json(self):
     h5_sdk_json = jsoncfg.load(
         os.path.join(CURRENT_PATH, '5+sdk_android.json'))
     return h5_sdk_json
Ejemplo n.º 10
0
 def __init__(self, milleniumFalconJsonFile):
     self.milleniumFalconJson = jsoncfg.load(milleniumFalconJsonFile)
     self.autonomy = self.milleniumFalconJson['autonomy']
     self.paths = C3PO.generatePaths(self)
Ejemplo n.º 11
0
 def __init__(self, empireJsonFile):
     self.json = jsoncfg.load(empireJsonFile)
     self.paths = Empire.grabEmpirePath(self.json)
     self.countdown = self.json['countdown']