sdf_export.py 文件源码

python
阅读 22 收藏 0 点赞 0 评论 0

项目:BlenderRobotDesigner 作者: HBPNeurorobotics 项目源码 文件源码
def invoke(self, context, event):
        context.window_manager.fileselect_add(self)
        return {'RUNNING_MODAL'}

    #
    #
    # filepath = StringProperty(name="Filename", subtype='FILE_PATH')
    # gazebo = BoolProperty(name="Export Gazebo tags", default=True)
    #
    # package_url = BoolProperty(name="Package URL", default=True)
    #
    # base_link_name = StringProperty(name="Base link:", default="root_link")
    #
    # @RDOperator.OperatorLogger
    # @RDOperator.Postconditions(ModelSelected, ObjectMode)
    # def execute(self, context):
    #     """
    #     Code snipped from `<http://stackoverflow.com/questions/1855095/how-to-create-a-zip-archive-of-a-directory>`_
    #     """
    #     import zipfile
    #
    #     if os.path.isdir(self.filepath):
    #         self.logger.debug(self.filepath)
    #         self.report({'ERROR'}, "No File selected!")
    #         return {'FINISHED'}
    #
    #     def zipdir(path, ziph):
    #         # ziph is zipfile handle
    #         for root, dirs, files in os.walk(path):
    #             self.logger.debug("%s, %s, %s,", root, dirs, files)
    #             for file in files:
    #                 file_path = os.path.join(root, file)
    #                 ziph.write(file_path, os.path.relpath(file_path, path))
    #
    #     with tempfile.TemporaryDirectory() as target:
    #         create_package(self, context, target, self.base_link_name)
    #
    #         with zipfile.ZipFile(self.filepath, 'w') as zipf:
    #             zipdir(target, zipf)
    #
    #     return {'FINISHED'}
    #
    # def invoke(self, context, event):
    #     context.window_manager.fileselect_add(self)
    #     return {'RUNNING_MODAL'}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号