Пример #1
0
 def __init__(self, env, options):
     Type.__init__(self, env, options)
     self.extra_params = {
         'doctitle_xform': False,
         'initial_header_level': '2',
         'syntax_highlight': 'short'}
     self.extra_params.update(options)
Пример #2
0
 def __init__(self, env, options):
     Type.__init__(self, env, options)
     self.extra_params = {
         'doctitle_xform': False,
         'initial_header_level': '2',
         'syntax_highlight': 'short'
     }
     self.extra_params.update(options)
Пример #3
0
    def to_json(self, pad, record=None, alt=PRIMARY_ALT):
        rv = Type.to_json(self, pad, record, alt)

        rv["flowblocks"] = discover_relevant_flowblock_models(self, pad, record, alt)

        block_order = self.flow_blocks
        if block_order is None:
            block_order = [k for k, v in sorted(pad.db.flowblocks.items(), key=lambda x: x[1].order)]
        rv["flowblock_order"] = block_order

        return rv
Пример #4
0
    def to_json(self, pad, record=None, alt=PRIMARY_ALT):
        rv = Type.to_json(self, pad, record, alt)

        rv["flowblocks"] = discover_relevant_flowblock_models(self, pad, record, alt)

        block_order = self.flow_blocks
        if block_order is None:
            block_order = [
                k
                for k, v in sorted(pad.db.flowblocks.items(), key=lambda x: x[1].order)
            ]
        rv["flowblock_order"] = block_order

        return rv
Пример #5
0
 def to_json(self, pad):
     rv = Type.to_json(self, pad)
     rv['checkbox_label'] = self.options.get('checkbox_label')
     return rv
Пример #6
0
 def to_json(self, pad):
     rv = Type.to_json(self, pad)
     if self.source.has_choices:
         rv['choices'] = [[key, value] for key, value in
                          self.source.iter_choices(pad)]
     return rv
Пример #7
0
 def __init__(self, env, options):
     Type.__init__(self, env, options)
     self.source = ChoiceSource(env, options)
Пример #8
0
Файл: flow.py Проект: jab/lektor
 def __init__(self, env, options):
     Type.__init__(self, env, options)
Пример #9
0
 def to_json(self, pad, record=None, alt=PRIMARY_ALT):
     rv = Type.to_json(self, pad, record, alt)
     rv['checkbox_label_i18n'] = get_i18n_block(
         self.options, 'checkbox_label')
     return rv
Пример #10
0
 def to_json(self, pad, record=None, alt=PRIMARY_ALT):
     rv = Type.to_json(self, pad, record, alt)
     if self.source.has_choices:
         rv['choices'] = list(self.source.iter_choices(pad, record, alt))
     return rv
Пример #11
0
 def to_json(self, pad):
     rv = Type.to_json(self, pad)
     rv['checkbox_label'] = self.options.get('checkbox_label')
     return rv
Пример #12
0
 def to_json(self, pad, record=None, alt=PRIMARY_ALT):
     rv = Type.to_json(self, pad, record, alt)
     rv["is_fake_type"] = True
     return rv
Пример #13
0
 def __init__(self, env, options):
     Type.__init__(self, env, options)
     self.flow_blocks = [x.strip() for x in options.get("flow_blocks", "").split(",") if x.strip()] or None
 def __init__(self, env, options, client_id, client_secret, access_token=None):
     Type.__init__(self, env, options)
     self.client_id = client_id
     self.client_secret = client_secret
     self.access_token = access_token
Пример #15
0
Файл: flow.py Проект: jab/lektor
 def to_json(self, pad):
     rv = Type.to_json(self, pad)
     rv['flowblocks'] = dict((k, v.to_json(pad)) for k, v in
                             pad.db.flowblocks.iteritems())
     return rv
Пример #16
0
 def to_json(self, pad, record=None, alt=PRIMARY_ALT):
     rv = Type.to_json(self, pad, record, alt)
     rv['is_fake_type'] = True
     return rv
Пример #17
0
 def __init__(self, env, options):
     Type.__init__(self, env, options)
     self.flow_blocks = [
         x.strip() for x in options.get("flow_blocks", "").split(",") if x.strip()
     ] or None
Пример #18
0
Файл: flow.py Проект: jab/lektor
 def __init__(self, env, options):
     Type.__init__(self, env, options)
Пример #19
0
 def __init__(self, env, options):
     Type.__init__(self, env, options)
     self.source = ChoiceSource(env, options)
Пример #20
0
Файл: flow.py Проект: jab/lektor
 def to_json(self, pad):
     rv = Type.to_json(self, pad)
     rv['flowblocks'] = dict(
         (k, v.to_json(pad)) for k, v in pad.db.flowblocks.iteritems())
     return rv
Пример #21
0
 def to_json(self, pad, record=None, alt=PRIMARY_ALT):
     rv = Type.to_json(self, pad, record, alt)
     rv['addon_label_i18n'] = get_i18n_block(
         self.options, 'addon_label') or None
     return rv
Пример #22
0
 def to_json(self, pad, record=None, alt=PRIMARY_ALT):
     rv = Type.to_json(self, pad, record, alt)
     if self.source.has_choices:
         rv['choices'] = list(self.source.iter_choices(pad, record, alt))
     return rv
Пример #23
0
 def __init__(self, env, options):
     Type.__init__(self, env, options)
     self.flow_blocks = [
         x.strip()
         for x in options.get('flow_blocks', '').split(',') if x.strip()
     ] or None
Пример #24
0
 def __init__(self, env, options):
     Type.__init__(self, env, options)
     self.flow_blocks = [
         x.strip() for x in options.get('flow_blocks', '').split(',')
         if x.strip()] or None