Fix: Folder create when --enable_drop_screenshot disabled

This commit is contained in:
LmeSzinc 2020-05-29 17:08:43 +08:00
parent 3702b1c6da
commit c402d3e047
2 changed files with 10 additions and 9 deletions

View File

@ -61,12 +61,10 @@ class CampaignRun(CampaignUI, Reward, LoginHandler):
return True
def campaign_name_set(self, name):
# self.config.CAMPAIGN_NAME = name
# folder = self.config.SCREEN_SHOT_SAVE_FOLDER_BASE + '/' + name
# if not os.path.exists(folder):
# os.mkdir(folder)
# self.config.SCREEN_SHOT_SAVE_FOLDER = folder
if not self.campaign.config.ENABLE_SAVE_GET_ITEMS \
or not len(self.campaign.config.SCREEN_SHOT_SAVE_FOLDER_BASE.strip()):
return False
# Create folder to save drop screenshot
folder = self.campaign.config.SCREEN_SHOT_SAVE_FOLDER_BASE + '/' + name
if not os.path.exists(folder):
os.mkdir(folder)

View File

@ -340,9 +340,12 @@ class AzurLaneConfig:
C124_AMMO_PICK_UP = 3
def create_folder(self):
for folder in [self.ASSETS_FOLDER, self.PERSPECTIVE_ERROR_LOG_FOLDER, self.ERROR_LOG_FOLDER]:
if folder and not os.path.exists(folder):
os.mkdir(folder)
self.SCREEN_SHOT_SAVE_FOLDER = self.SCREEN_SHOT_SAVE_FOLDER_BASE + '/' + self.CAMPAIGN_NAME
for folder in [self.SCREEN_SHOT_SAVE_FOLDER_BASE, self.ASSETS_FOLDER, self.SCREEN_SHOT_SAVE_FOLDER,
self.PERSPECTIVE_ERROR_LOG_FOLDER, self.ERROR_LOG_FOLDER]:
if self.ENABLE_SAVE_GET_ITEMS and len(self.SCREEN_SHOT_SAVE_FOLDER_BASE.strip()):
for folder in [self.SCREEN_SHOT_SAVE_FOLDER_BASE, self.SCREEN_SHOT_SAVE_FOLDER]:
if folder and not os.path.exists(folder):
os.mkdir(folder)