diff --git a/ice/configuration.py b/ice/configuration.py index 5749731..629388f 100644 --- a/ice/configuration.py +++ b/ice/configuration.py @@ -144,7 +144,7 @@ def set_userdata_directory(self, dir): ) self.config_backing_store.save() - def shortcuts_backup_path(self, user, timestamp_format="%Y%m%d%H%M%S"): + def shortcuts_backup_path(self, user, filesystem, timestamp_format="%Y%m%d%H%M%S"): """ Returns the path for a shortcuts.vdf backup file. @@ -157,10 +157,15 @@ def shortcuts_backup_path(self, user, timestamp_format="%Y%m%d%H%M%S"): timestamp = datetime.datetime.now().strftime('%Y%m%d%H%M%S') filename = "shortcuts." + timestamp + ".vdf" - return os.path.join( + dirname = ( backup_dir, str(user.user_id), - 'config', + 'config' + ) + if filesystem.path_exists(dirname) == False: + filesystem.create_directories(dirname) + return os.path.join( + dirname, filename ) diff --git a/ice/runners/ice_engine.py b/ice/runners/ice_engine.py index 3ba73c8..bd7fb66 100644 --- a/ice/runners/ice_engine.py +++ b/ice/runners/ice_engine.py @@ -129,6 +129,8 @@ def main(self, dry_run=False): # TODO: Create any missing directories that Ice will need log_configuration(self.logger, self.config) for user_context in steam.local_user_contexts(self.steam): + if user_context.user_id == "anonymous": + continue self.logger.info("=========== User: %s ===========" % str(user_context.user_id)) self.run_for_user(user_context, dry_run=dry_run) @@ -159,7 +161,7 @@ def _create_backup(self, user, dry_run=False): self.logger.debug("Not creating backup because its a dry run") return - backup_path = self.config.shortcuts_backup_path(user) + backup_path = self.config.shortcuts_backup_path(user, self.filesystem) if backup_path is None: self.logger.info("No backups directory specified, so not backing up shortcuts.vdf before overwriting. See config.txt for more info") return