当前位置: 首页>>代码示例>>Python>>正文


Python FileCheckin.set_description方法代码示例

本文整理汇总了Python中pyasm.checkin.FileCheckin.set_description方法的典型用法代码示例。如果您正苦于以下问题:Python FileCheckin.set_description方法的具体用法?Python FileCheckin.set_description怎么用?Python FileCheckin.set_description使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在pyasm.checkin.FileCheckin的用法示例。


在下文中一共展示了FileCheckin.set_description方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: _parse_form

# 需要导入模块: from pyasm.checkin import FileCheckin [as 别名]
# 或者: from pyasm.checkin.FileCheckin import set_description [as 别名]
    def _parse_form(my):

        # get the downloaded files and sort them
        web = WebContainer.get_web()

        my.upload_values.sort()

        filenames = []
        ticket = web.get_cookie("login_ticket")
        # create a new entry for every file
        for upload_value in my.upload_values:
            tmp_dir = Environment.get_tmp_dir()
            basename = os.path.basename(upload_value)
            file_path = "%s/upload/%s/%s" % (tmp_dir, ticket, basename)

            filenames.append(basename)

            creator = IconCreator(file_path)
            creator.create_icons()

            my.file_paths = [file_path]
            file_types = ["main"]

            web_path = creator.get_web_path()
            if web_path != None:
                my.file_paths.append(web_path)
                file_types.append("web")

            icon_path = creator.get_icon_path()
            if icon_path != None:
                my.file_paths.append(icon_path)
                file_types.append("icon")

            sobject = None
            if my.search_key:
                sobject = Search.get_by_search_key(my.search_key)
            else:
                sobject = SObjectFactory.create(my.search_type)
                sobject.commit()

            checkin = FileCheckin(sobject, my.file_paths, file_types, column=my.column)

            checkin.set_description(web.get_form_value(SObjectUploadCmd.PUBLISH_COMMENT))
            checkin.execute()
            my.repo_file_list.append(checkin.file_dict)

        my.description = "Added files: %s" % filenames
开发者ID:hellios78,项目名称:TACTIC,代码行数:49,代码来源:sobject_upload_wdg.py

示例2: FileCheckin

# 需要导入模块: from pyasm.checkin import FileCheckin [as 别名]
# 或者: from pyasm.checkin.FileCheckin import set_description [as 别名]
                    my.file_paths.append(web_path)
                    file_types.append("web")

        # checkin all of the files into the sobjects
        if my._is_flash(search_type_obj):
            snapshot_type = "flash"
        else:
            snapshot_type = "file"

        checkin = FileCheckin(sobject, my.file_paths, file_types, column=my.column, snapshot_type=snapshot_type)
        # handle the description
        web = WebContainer.get_web()

        comment = web.get_form_value(my.PUBLISH_COMMENT)
        my.add_description("[%s] %s " % (sobject.get_code(), comment))
        checkin.set_description(comment)

        checkin.execute()
        checkin_info = []
        for key, value in checkin.file_dict.items():
            if not my.get_response_list():
                checkin_info.append("'%s=%s'" % (key, value))
            else:
                for type in my.get_response_list():
                    if type in key:
                        checkin_info.append("'%s=%s'" % (key, value))
                        break

        my.repo_file_list.append(",".join(checkin_info))

    def get_response_list(my):
开发者ID:hellios78,项目名称:TACTIC,代码行数:33,代码来源:sobject_upload_wdg.py


注:本文中的pyasm.checkin.FileCheckin.set_description方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。