本文整理汇总了Python中preupg.utils.FileHelper.check_executable方法的典型用法代码示例。如果您正苦于以下问题:Python FileHelper.check_executable方法的具体用法?Python FileHelper.check_executable怎么用?Python FileHelper.check_executable使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类preupg.utils.FileHelper
的用法示例。
在下文中一共展示了FileHelper.check_executable方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: check_scripts
# 需要导入模块: from preupg.utils import FileHelper [as 别名]
# 或者: from preupg.utils.FileHelper import check_executable [as 别名]
def check_scripts(self, type_name):
"""
The function checks whether script exists in content directory
If check_script exists then the script checks whether it is executable
"""
if not os.path.exists(self.full_path_name):
print ("ERROR: ", self.full_path_name, "Script name does not exists")
print ("List of directory (", self.dir_name, ") is:")
for file_name in os.listdir(self.dir_name):
print (file_name)
raise MissingFileInContentError
if type_name != 'solution':
FileHelper.check_executable(self.full_path_name)
示例2: check_scripts
# 需要导入模块: from preupg.utils import FileHelper [as 别名]
# 或者: from preupg.utils.FileHelper import check_executable [as 别名]
def check_scripts(self, type_name):
"""
The function checks whether script exists in content directory
If check_script exists then the script checks whether it is executable
@param {str} type_name - name of the script e.g. solution
or check_script
@throws {MissingFileInContentError}
"""
if type_name == 'check_script':
if not os.path.isfile(self.check_script_path):
raise MissingFileInContentError(file=self.check_script_path,
dir=self.dir_name)
FileHelper.check_executable(self.check_script_path)
else:
if not os.path.isfile(self.solution_txt_path):
raise MissingFileInContentError(file=self.solution_txt_path,
dir=self.dir_name)