Beispiel #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)
Beispiel #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)
Beispiel #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
Beispiel #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
Beispiel #5
0
 def to_json(self, pad):
     rv = Type.to_json(self, pad)
     rv['checkbox_label'] = self.options.get('checkbox_label')
     return rv
Beispiel #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
Beispiel #7
0
 def __init__(self, env, options):
     Type.__init__(self, env, options)
     self.source = ChoiceSource(env, options)
Beispiel #8
0
 def __init__(self, env, options):
     Type.__init__(self, env, options)
 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
Beispiel #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
Beispiel #11
0
 def to_json(self, pad):
     rv = Type.to_json(self, pad)
     rv['checkbox_label'] = self.options.get('checkbox_label')
     return rv
Beispiel #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
Beispiel #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
Beispiel #15
0
 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
Beispiel #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
Beispiel #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
Beispiel #18
0
 def __init__(self, env, options):
     Type.__init__(self, env, options)
Beispiel #19
0
 def __init__(self, env, options):
     Type.__init__(self, env, options)
     self.source = ChoiceSource(env, options)
Beispiel #20
0
 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
 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
Beispiel #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
Beispiel #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
Beispiel #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