Merge "Fix tox -e docs build in py3"
This commit is contained in:
commit
0c1914de63
@ -12,6 +12,7 @@
|
||||
# under the License.
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from functools import cmp_to_key
|
||||
import pydoc
|
||||
|
||||
from docutils import core
|
||||
@ -188,13 +189,14 @@ resources:
|
||||
x_key, x_prop = x
|
||||
y_key, y_prop = y
|
||||
if x_prop.support_status.status == y_prop.support_status.status:
|
||||
return cmp(x_key, y_key)
|
||||
if x_prop.support_status.status == support.SUPPORTED:
|
||||
return (x_key > y_key) - (x_key < y_key)
|
||||
x_status = x_prop.support_status.status
|
||||
y_status = y_prop.support_status.status
|
||||
if x_status == support.SUPPORTED:
|
||||
return -1
|
||||
if x_prop.support_status.status == support.DEPRECATED:
|
||||
if x_status == support.DEPRECATED:
|
||||
return 1
|
||||
return cmp(x_prop.support_status.status,
|
||||
y_prop.support_status.status)
|
||||
return (x_status > y_status) - (x_status < y_status)
|
||||
|
||||
def contribute_property(self, parent, prop_key, prop, upd_para=None,
|
||||
id_pattern_prefix=None):
|
||||
@ -260,13 +262,13 @@ resources:
|
||||
sub_schema = prop.schema
|
||||
|
||||
if sub_schema:
|
||||
for sub_prop_key, sub_prop in sorted(sub_schema.items(),
|
||||
self.cmp_prop):
|
||||
if sub_prop.support_status.status != support.HIDDEN:
|
||||
for _key, _prop in sorted(sub_schema.items(),
|
||||
key=cmp_to_key(self.cmp_prop)):
|
||||
if _prop.support_status.status != support.HIDDEN:
|
||||
indent = nodes.block_quote()
|
||||
definition.append(indent)
|
||||
self.contribute_property(
|
||||
indent, sub_prop_key, sub_prop, upd_para, id_pattern)
|
||||
indent, _key, _prop, upd_para, id_pattern)
|
||||
|
||||
def contribute_properties(self, parent):
|
||||
if not self.props_schemata:
|
||||
@ -282,7 +284,7 @@ resources:
|
||||
parent, _('Required Properties'), '%s-props-req')
|
||||
|
||||
for prop_key, prop in sorted(required_props.items(),
|
||||
self.cmp_prop):
|
||||
key=cmp_to_key(self.cmp_prop)):
|
||||
self.contribute_property(section, prop_key, prop)
|
||||
|
||||
optional_props = dict((k, v) for k, v in props.items()
|
||||
@ -292,7 +294,7 @@ resources:
|
||||
parent, _('Optional Properties'), '%s-props-opt')
|
||||
|
||||
for prop_key, prop in sorted(optional_props.items(),
|
||||
self.cmp_prop):
|
||||
key=cmp_to_key(self.cmp_prop)):
|
||||
self.contribute_property(section, prop_key, prop)
|
||||
|
||||
def contribute_attributes(self, parent):
|
||||
@ -315,9 +317,9 @@ resources:
|
||||
if not self.update_policy_schemata:
|
||||
return
|
||||
section = self._section(parent, _('update_policy'), '%s-updpolicy')
|
||||
for prop_key, prop in sorted(self.update_policy_schemata.items(),
|
||||
self.cmp_prop):
|
||||
self.contribute_property(section, prop_key, prop)
|
||||
for _key, _prop in sorted(self.update_policy_schemata.items(),
|
||||
key=cmp_to_key(self.cmp_prop)):
|
||||
self.contribute_property(section, _key, _prop)
|
||||
|
||||
|
||||
class IntegrateResourcePages(ResourcePages):
|
||||
|
Loading…
Reference in New Issue
Block a user