From 6f15a67eab8c88ae43def2acd2cfaaa943c7537d Mon Sep 17 00:00:00 2001 From: JCTutorius Date: Thu, 05 Nov 2009 20:13:55 +0000 Subject: Added code review modifications to Valut ressource managing. --- (limited to 'tutorius/vault.py') diff --git a/tutorius/vault.py b/tutorius/vault.py index 728cf64..7ec0a23 100644 --- a/tutorius/vault.py +++ b/tutorius/vault.py @@ -353,7 +353,7 @@ class Vault(object): @param file_path the file path of the resource to add @returns the resource_id of the resource """ - + assert os.path.isfile(file_path) # Get the tutorial path bundler = TutorialBundler(tutorial_guid) tutorial_path = bundler.get_tutorial_path(tutorial_guid) @@ -370,7 +370,6 @@ class Vault(object): # Copy the resource file in the vault if os.path.isdir(os.path.join(tutorial_path, RESOURCES_FOLDER)) == False: os.makedirs(os.path.join(tutorial_path, RESOURCES_FOLDER)) - assert os.path.isfile(file_path) shutil.copyfile(file_path, new_file_path) return file_name_appended @@ -392,7 +391,7 @@ class Vault(object): # Delete the resource os.remove(file_path) else: - print('File not found, no delete took place') + logging.info('File not found, no delete took place') @staticmethod def get_resource_path(tutorial_guid, resource_id): -- cgit v0.9.1