Beispiel #1
0
def nonnegative_int_list(argument):
    """
    Converts a space- or comma-separated list of values into a Python list
    of integers.

    (Directive option conversion function.)

    Raises ValueError for values that aren't non-negative integers.
    """
    if ',' in argument:
        entries = argument.split(',')
    else:
        entries = argument.split()
    return [directives.nonnegative_int(entry) for entry in entries]
Beispiel #2
0
def nonnegative_int_list(argument):
    """
    Converts a space- or comma-separated list of values into a Python list
    of integers.

    (Directive option conversion function.)

    Raises ValueError for values that aren't non-negative integers.
    """
    if ',' in argument:
        entries = argument.split(',')
    else:
        entries = argument.split()
    return [directives.nonnegative_int(entry) for entry in entries]
Beispiel #3
0
 def run(self):
     id = directives.nonnegative_int(self.arguments.pop(0))
     log.debug(self.arguments)
     return [
         nodes.raw(
             '', 
             self.html.format(
                 path=self.widget_path,
                 id=id,
                 type=self.type,
                 autoplay=('autoplay&' if 'autoplay' in self.arguments else '')
             ), 
             format='html'
         )
     ]
Beispiel #4
0
def nonnegative_int_list(argument):
    if ',' in argument:
        entries = argument.split(',')
    else:
        entries = argument.split()
    return [directives.nonnegative_int(entry) for entry in entries]
Beispiel #5
0
def figwidth_value(argument):
    if argument.lower() == 'image':
        return 'image'
    else:
        return directives.nonnegative_int(argument)
Beispiel #6
0
def figwidth_value(argument):
    if argument.lower() == 'image':
        return 'image'
    else:
        return directives.nonnegative_int(argument)
Beispiel #7
0
def figwidth_value(argument):
    if argument.lower() == "image":
        return "image"
    else:
        return directives.nonnegative_int(argument)
def nonnegative_int_or_all(argument):
    if argument == 'all':
        return
    return nonnegative_int(argument)