コード例 #1
0
ファイル: test_config.py プロジェクト: rycase/shiftleft
def test_override():
    build_break_rules = config.get("build_break_rules").copy()
    golang_cmd = config.get("scan_tools_args_map").get("go")
    assert list(golang_cmd.keys()) == ["source-go", "staticcheck"]
    test_data_dir = os.path.join(os.path.dirname(os.path.realpath(__file__)), "data")
    config.set("SAST_SCAN_SRC_DIR", test_data_dir)
    config.reload()
    # Test if we are able to override the whole dict
    new_rules = config.get("build_break_rules")
    assert build_break_rules != new_rules
    # Test if we are able to override a command
    golang_cmd = config.get("scan_tools_args_map").get("go")
    assert golang_cmd[0] == "echo"
    assert config.get("scan_type") == "credscan,java"
コード例 #2
0
ファイル: widgets.py プロジェクト: edusegzy/pychemqt
 def value(self, config, section="MEOS"):
     config.set(section, self.confSection + "Color",
                self.ColorButton.color.name())
     config.set(section, self.confSection + "lineWidth",
                self.Grosor.value())
     config.set(section, self.confSection + "lineStyle",
                self.Linea.currentValue())
     config.set(section, self.confSection + "marker",
                self.Marca.currentValue())
     return config
コード例 #3
0
ファイル: runtime.py プロジェクト: CISC/exp-python2-sdk
def start(
    host='http://localhost',
    port=9000,
    uuid=None,
    secret=None,
    username=None,
    password=None,
    organization=None,
    token=None,
    **kwargs):
  config.set(host=host, port=port)
  if uuid and secret:
    credentials.set_device_credentials(uuid, secret)
  elif username and password and organization:
    credentials.set_user_credentials(username, password, organization)
  elif token:
    credentials.set_token(token)
  socket.start(host, port, credentials.get_token())
コード例 #4
0
ファイル: widgets.py プロジェクト: edusegzy/pychemqt
 def default(cls, config, confSection, section="MEOS"):
     config.set(section, confSection + "Color", "#000000")
     config.set(section, confSection + "lineWidth", "0.5")
     config.set(section, confSection + "lineStyle", "-")
     config.set(section, confSection + "marker", "None")
     return config
コード例 #5
0
ファイル: widgets.py プロジェクト: ChEsolve/pychemqt
 def default(cls, config, confSection, section="MEOS"):
     config.set(section, confSection + "Color", "#000000")
     config.set(section, confSection + "lineWidth", "0.5")
     config.set(section, confSection + "lineStyle", "-")
     config.set(section, confSection + "marker", "None")
     return config
コード例 #6
0
ファイル: widgets.py プロジェクト: ChEsolve/pychemqt
 def value(self, config, section="MEOS"):
     config.set(section, self.confSection + "Color", self.ColorButton.color.name())
     config.set(section, self.confSection + "lineWidth", str(self.Grosor.value()))
     config.set(section, self.confSection + "lineStyle", self.Linea.currentValue())
     config.set(section, self.confSection + "marker", self.Marca.currentValue())
     return config