本文整理汇总了Python中FileUtils.make_zipfile方法的典型用法代码示例。如果您正苦于以下问题:Python FileUtils.make_zipfile方法的具体用法?Python FileUtils.make_zipfile怎么用?Python FileUtils.make_zipfile使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FileUtils
的用法示例。
在下文中一共展示了FileUtils.make_zipfile方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: process_form
# 需要导入模块: import FileUtils [as 别名]
# 或者: from FileUtils import make_zipfile [as 别名]
def process_form(global_config, form):
global_config['logger'].debug( 'Process UI Generator Form' )
# form.d.boe and form['boe'].value are equivalent ways of
# extracting the validated arguments from the form.
base_root_dir = form[base_root_dir_label].value
base_project_path = os.path.join(base_root_dir, form[base_dir_label].value)
base_projectname = form[base_project_label].value
dest_root_dir = form[dest_root_dir_label].value
dest_project_dir = form[dest_dir_label].value
dest_project_path = os.path.join(dest_root_dir, dest_project_dir)
dest_projectname = form[dest_project_label].value
dest_activity_prefix = form[sheet_type_label].value
dest_app_label = form[app_name_label].value
dest_app_name = form[app_title_label].value
attr_defs_file = './config/' + form[attr_defs_label].value
generated_code_fragments = UiGenerator.gen_ui(attr_defs_file, \
dest_activity_prefix, \
create_fragment_file=True)
AppGenerator.prepare_destination_project( base_project_path, base_projectname, dest_project_path, dest_projectname, \
dest_activity_prefix, dest_app_name, dest_app_label )
AppGenerator.update_generated_xml_code(dest_project_path, generated_code_fragments)
AppGenerator.update_generated_java_code(base_projectname, dest_project_path, dest_activity_prefix, generated_code_fragments)
FileUtils.make_zipfile( dest_project_path + '.zip', dest_project_path )
return "User Interface Generated!\n\tSource Directory: %s\n\tDestination Directory: %s\n\tSheet Type: %s\n\tAttribute Definitions File: %s\n\tGenerate Action: %s" % \
(form[base_dir_label].value, \
form[dest_dir_label].value, \
form[sheet_type_label].value, \
form[attr_defs_label].value, \
form[gen_action_label].value)