mirror of
https://github.com/Kozea/WeasyPrint.git
synced 2024-10-04 16:07:57 +03:00
Fix some comments
This commit is contained in:
parent
f78eb3763e
commit
17abfbd1c9
@ -1301,7 +1301,7 @@ def validate_content_list_token(token):
|
|||||||
prototype = (name, [a.type for a in args])
|
prototype = (name, [a.type for a in args])
|
||||||
args = [getattr(a, 'value', a) for a in args]
|
args = [getattr(a, 'value', a) for a in args]
|
||||||
if prototype == ('attr', ['IDENT']):
|
if prototype == ('attr', ['IDENT']):
|
||||||
# TODO: remove this line when attr is supported in pages.py
|
# TODO: remove this line when attr is supported in build.py
|
||||||
raise InvalidValues
|
raise InvalidValues
|
||||||
return (name, args[0])
|
return (name, args[0])
|
||||||
elif prototype in (('content', []), ('content', ['IDENT'])):
|
elif prototype in (('content', []), ('content', ['IDENT'])):
|
||||||
@ -1312,13 +1312,13 @@ def validate_content_list_token(token):
|
|||||||
return (name, args[0])
|
return (name, args[0])
|
||||||
elif prototype in (('counter', ['IDENT']),
|
elif prototype in (('counter', ['IDENT']),
|
||||||
('counters', ['IDENT', 'STRING'])):
|
('counters', ['IDENT', 'STRING'])):
|
||||||
# TODO: remove this line when counters are supported in pages.py
|
# TODO: remove this line when counters are supported in build.py
|
||||||
raise InvalidValues
|
raise InvalidValues
|
||||||
args.append('decimal')
|
args.append('decimal')
|
||||||
return (name, args)
|
return (name, args)
|
||||||
elif prototype in (('counter', ['IDENT', 'IDENT']),
|
elif prototype in (('counter', ['IDENT', 'IDENT']),
|
||||||
('counters', ['IDENT', 'STRING', 'IDENT'])):
|
('counters', ['IDENT', 'STRING', 'IDENT'])):
|
||||||
# TODO: remove this line when counters are supported in pages.py
|
# TODO: remove this line when counters are supported in build.py
|
||||||
raise InvalidValues
|
raise InvalidValues
|
||||||
style = args[-1]
|
style = args[-1]
|
||||||
if style in ('none', 'decimal') or style in counters.STYLES:
|
if style in ('none', 'decimal') or style in counters.STYLES:
|
||||||
|
@ -95,21 +95,22 @@ class LayoutContext(object):
|
|||||||
self.excluded_shapes = None
|
self.excluded_shapes = None
|
||||||
|
|
||||||
def get_string_set_for(self, name, keyword=None):
|
def get_string_set_for(self, name, keyword=None):
|
||||||
""" Resolve value of string function (as set by string set)
|
"""Resolve value of string function (as set by string set).
|
||||||
|
|
||||||
We'll have something like this that represents all assignments
|
We'll have something like this that represents all assignments on a
|
||||||
on a given page
|
given page:
|
||||||
{1: [u'First Header'], 3: [u'Second Header'],
|
|
||||||
4: [u'Third Header', u'3.5th Header']}
|
|
||||||
|
|
||||||
Value depends on current page
|
{1: [u'First Header'], 3: [u'Second Header'],
|
||||||
http://dev.w3.org/csswg/css-gcpm/#funcdef-string
|
4: [u'Third Header', u'3.5th Header']}
|
||||||
|
|
||||||
:param name: the name of the named string.
|
Value depends on current page.
|
||||||
:param keyword: indicates which value of the named string to use.
|
http://dev.w3.org/csswg/css-gcpm/#funcdef-string
|
||||||
Default is the first assignment on the current page
|
|
||||||
else the most recent assignment (entry value)
|
:param name: the name of the named string.
|
||||||
:returns: text
|
:param keyword: indicates which value of the named string to use.
|
||||||
|
Default is the first assignment on the current page
|
||||||
|
else the most recent assignment (entry value)
|
||||||
|
:returns: text
|
||||||
|
|
||||||
"""
|
"""
|
||||||
last = keyword == "last"
|
last = keyword == "last"
|
||||||
|
Loading…
Reference in New Issue
Block a user