Skip to content

Commit

Permalink
version 0.50
Browse files Browse the repository at this point in the history
  • Loading branch information
FriendsOfGalaxy committed Nov 15, 2019
1 parent 7bb7254 commit d73c609
Show file tree
Hide file tree
Showing 5 changed files with 435 additions and 305 deletions.
14 changes: 13 additions & 1 deletion src/local_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ def __init__(self):
self.last_modification_times = None
self.configurations_path = None
self.ownership_path = None
self.settings_path = None
self.launcher_log_path = None
self.user_id = None
self._is_installed = None
Expand All @@ -28,12 +29,18 @@ def initialize(self, user_id):
# Start tracking ownership file if exists
self.ownership_changed()

def ownership_accesible(self):
def ownership_accessible(self):
if self.ownership_path is None:
return False
else:
return os.access(self.ownership_path, os.R_OK)

def settings_accessible(self):
if self.settings_path is None:
return False
else:
return os.access(self.settings_path, os.R_OK)

def configurations_accessible(self):
if self.configurations_path is None:
return False
Expand All @@ -54,6 +61,9 @@ def read_config(self):
def read_ownership(self):
return self.__read_file(self.ownership_path)

def read_settings(self):
return self.__read_file(self.settings_path)

@property
def is_installed(self):
return self._is_installed
Expand Down Expand Up @@ -89,12 +99,14 @@ def refresh(self):
self.launcher_log_path = os.path.join(path, "logs", "launcher_log.txt")
if self.user_id is not None:
self.ownership_path = os.path.join(path, "cache", "ownership", self.user_id)
self.settings_path = os.path.join(path, "cache", "settings", self.user_id)
else:
if self._is_installed:
log.info('Local client uninstalled')
self._is_installed = False
self.configurations_path = None
self.ownership_path = None
self.settings_path = None
self.launcher_log_path = None

def ownership_changed(self):
Expand Down

0 comments on commit d73c609

Please sign in to comment.