Skip to content

Commit

Permalink
Merge branch 'master' of github.com:VirtualCable/uds-actor
Browse files Browse the repository at this point in the history
  • Loading branch information
dkmstr committed Oct 7, 2024
2 parents e822a87 + 32d89d3 commit c2b5da0
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions src/actor_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class UDSConfigDialog(QDialog):
def __init__(self) -> None:
QDialog.__init__(self, None)
# Get local config config
config: udsactor.types.ActorConfigurationType = udsactor.platform.store.readConfig()
config: udsactor.types.ActorConfigurationType = udsactor.platform.store.read_config()
self.ui = Ui_UdsActorSetupDialog()
self.ui.setupUi(self)
self.ui.host.setText(config.host)
Expand Down Expand Up @@ -113,7 +113,7 @@ def finish(self) -> None:
self.close()

def testUDSServer(self) -> None:
config: udsactor.types.ActorConfigurationType = udsactor.platform.store.readConfig()
config: udsactor.types.ActorConfigurationType = udsactor.platform.store.read_config()
if not config.master_token or not config.host:
self.ui.testButton.setEnabled(False)
return
Expand Down
4 changes: 2 additions & 2 deletions src/actor_config_unmanaged.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class UDSConfigDialog(QDialog):
def __init__(self) -> None:
QDialog.__init__(self, None)
# Get local config config
self._config = udsactor.platform.store.readConfig()
self._config = udsactor.platform.store.read_config()
self.ui = Ui_UdsActorSetupDialog()
self.ui.setupUi(self)
self.ui.host.setText(self._config.host)
Expand Down Expand Up @@ -176,7 +176,7 @@ def saveConfig(self) -> None:
try:
with open(sys.argv[2], 'wb') as export_:
pickle.dump(
udsactor.platform.store.readConfig(), export_, protocol=3
udsactor.platform.store.read_config(), export_, protocol=3
)
except Exception as e:
print('Error exporting configuration file: {}'.format(e))
Expand Down
2 changes: 1 addition & 1 deletion src/udsactor/linux/store.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
CONFIGFILE = '/etc/udsactor/udsactor.cfg'


def readConfig() -> types.ActorConfigurationType:
def read_config() -> types.ActorConfigurationType:
try:
cfg = configparser.ConfigParser()
cfg.read(CONFIGFILE)
Expand Down
4 changes: 2 additions & 2 deletions src/udsactor/macos/store.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@

CONFIGFILE = '/etc/udsactor/udsactor.cfg'

def readConfig() -> types.ActorConfigurationType:
def read_config() -> types.ActorConfigurationType:
try:
cfg = configparser.ConfigParser()
cfg.read(CONFIGFILE)
Expand Down Expand Up @@ -66,7 +66,7 @@ def readConfig() -> types.ActorConfigurationType:
except Exception:
return types.ActorConfigurationType('', False)

def writeConfig(config: types.ActorConfigurationType) -> None:
def write_config(config: types.ActorConfigurationType) -> None:
cfg = configparser.ConfigParser()
cfg.add_section('uds')
uds: configparser.SectionProxy = cfg['uds']
Expand Down
4 changes: 2 additions & 2 deletions src/udsactor/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
from udsactor.http import clients_pool, server, cert

# def setup() -> None:
# cfg = platform.store.readConfig()
# cfg = platform.store.read_config()

# if logger.logger.windows:
# # Logs will also go to windows event log for services
Expand Down Expand Up @@ -82,7 +82,7 @@ def execute(cmdLine: str, section: str) -> bool:
return True

def __init__(self) -> None:
self._cfg = platform.store.readConfig()
self._cfg = platform.store.read_config()
self._interfaces = []
self._api = rest.UDSServerApi(self._cfg.host, self._cfg.validateCertificate)
self._secret = secrets.token_urlsafe(33)
Expand Down
6 changes: 3 additions & 3 deletions src/udsactor/windows/store.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
from .. import types

PATH: typing.Final[str] = 'Software\\UDSActor'
BASEKEY: typing.Final[str] = wreg.HKEY_LOCAL_MACHINE
BASEKEY: typing.Final[int] = wreg.HKEY_LOCAL_MACHINE

def fixRegistryPermissions(handle) -> None:
# Fix permissions so users can't read this key
Expand All @@ -61,7 +61,7 @@ def fixRegistryPermissions(handle) -> None:
None
)

def readConfig() -> types.ActorConfigurationType:
def read_config() -> types.ActorConfigurationType:
try:
key = wreg.OpenKey(BASEKEY, PATH, 0, wreg.KEY_QUERY_VALUE)
data, _ = wreg.QueryValueEx(key, '')
Expand All @@ -71,7 +71,7 @@ def readConfig() -> types.ActorConfigurationType:
return types.ActorConfigurationType('', False)


def writeConfig(config: types.ActorConfigurationType) -> None:
def write_config(config: types.ActorConfigurationType) -> None:
try:
key = wreg.OpenKey(BASEKEY, PATH, 0, wreg.KEY_ALL_ACCESS)
except Exception:
Expand Down

0 comments on commit c2b5da0

Please sign in to comment.