當前位置: 首頁>>代碼示例>>Python>>正文


Python X.delimiter方法代碼示例

本文整理匯總了Python中invenio.htmlutils.X.delimiter方法的典型用法代碼示例。如果您正苦於以下問題:Python X.delimiter方法的具體用法?Python X.delimiter怎麽用?Python X.delimiter使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在invenio.htmlutils.X的用法示例。


在下文中一共展示了X.delimiter方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: oai_identify

# 需要導入模塊: from invenio.htmlutils import X [as 別名]
# 或者: from invenio.htmlutils.X import delimiter [as 別名]
def oai_identify(argd):
    """Generates a response to oai_identify verb.

     script_url - *str* URL of the script used to access the
                  service. This is made necessary since the gateway
                  can be accessed either via /oai2d or /oai2d/ (or for
                  backward compatibility: oai2d.py or oai2d.py/), and
                  that the base URL must be returned in the Identify
                  response
    """

    out = X.repositoryName()(CFG_SITE_NAME)
    out += X.baseURL()((CFG_SITE_SECURE_URL or CFG_SITE_URL) + '/oai2d')
    out += X.protocolVersion()("2.0")
    out += X.adminEmail()(CFG_SITE_SUPPORT_EMAIL)
    out += X.earliestDatestamp()(get_earliest_datestamp())
    out += X.deletedRecord()(CFG_OAI_DELETED_POLICY)
    out += X.granularity()("YYYY-MM-DDThh:mm:ssZ")
    if CFG_WEBSTYLE_HTTP_USE_COMPRESSION:
        out += X.compression()('deflate')
    out += X.description("""<oai-identifier xmlns="http://www.openarchives.org/OAI/2.0/oai-identifier"
                   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                   xsi:schemaLocation="http://www.openarchives.org/OAI/2.0/oai-identifier
                                       http://www.openarchives.org/OAI/2.0/oai-identifier.xsd">""" +
                X.scheme()("oai") +
                X.repositoryIdentifier()(CFG_OAI_ID_PREFIX) +
                X.delimiter()(":") +
                X.sampleIdentifier()(CFG_OAI_SAMPLE_IDENTIFIER) +
                """</oai-identifier>""")
    out += CFG_OAI_IDENTIFY_DESCRIPTION % {'CFG_SITE_URL': EscapedXMLString(CFG_SITE_SECURE_URL or CFG_SITE_URL)}
    if CFG_OAI_FRIENDS:
        friends = """<friends xmlns="http://www.openarchives.org/OAI/2.0/friends/"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.openarchives.org/OAI/2.0/friends/
      http://www.openarchives.org/OAI/2.0/friends.xsd">"""
        for baseurl in CFG_OAI_FRIENDS:
            friends += X.baseURL()(baseurl)
        friends += """</friends>"""
        out += X.description(friends)

    out = oai_header(argd, "Identify") + out + oai_footer("Identify")

    return out
開發者ID:peskk3am,項目名稱:b2share,代碼行數:45,代碼來源:oai_repository_server.py


注:本文中的invenio.htmlutils.X.delimiter方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。