Exemplo n.º 1
0
 def handle_noargs(self, **options):
     pname = smart_decode(options.get('pname'))
     bname = smart_decode(options.get('bname'))
     release = smart_decode(options.get('release'))
     create_code_local(pname, bname, release)
     if options.get('link', False):
         link_eclipse(pname, bname, release)
Exemplo n.º 2
0
 def handle_noargs(self, **options):
     pname = smart_decode(options.get('pname'))
     bname = smart_decode(options.get('bname'))
     release = smart_decode(options.get('release'))
     parser = smart_decode(options.get('parser'))
     pinput = smart_decode(options.get('input'))
     parse_code(pname, bname, release, parser, pinput)
Exemplo n.º 3
0
 def handle_noargs(self, **options):
     pname = smart_decode(options.get('pname'))
     dname = smart_decode(options.get('dname'))
     release = smart_decode(options.get('release'))
     url = smart_decode(options.get('url'))
     syncer = smart_decode(options.get('syncer'))
     create_doc_local(pname, dname, release, syncer, url)
Exemplo n.º 4
0
 def handle_noargs(self, **options):
     pname = smart_decode(options.get('pname'))
     dname = smart_decode(options.get('dname'))
     release = smart_decode(options.get('release'))
     url = smart_decode(options.get('url'))
     syncer = smart_decode(options.get('syncer'))
     create_doc_local(pname, dname, release, syncer, url)
Exemplo n.º 5
0
 def handle_noargs(self, **options):
     pname = smart_decode(options.get('pname'))
     bname = smart_decode(options.get('bname'))
     release = smart_decode(options.get('release'))
     fqn = smart_decode(options.get('fqn'))
     add_a_filter(pname, bname, release, fqn, not options.get('no-snippet'),
                  options.get('one-ref-only'))
Exemplo n.º 6
0
 def handle_noargs(self, **options):
     pname = smart_decode(options.get('pname'))
     bname = smart_decode(options.get('bname'))
     release = smart_decode(options.get('release'))
     fqn = smart_decode(options.get('fqn'))
     add_a_filter(pname, bname, release, fqn, not options.get('no-snippet'),
         options.get('one-ref-only'))
Exemplo n.º 7
0
 def handle_noargs(self, **options):
     pname = smart_decode(options.get('pname'))
     cname = smart_decode(options.get('cname'))
     start = options.get('start')
     end = options.get('end')
     if start == -1:
         start = None
     if end == -1:
         end = None
     force = options.get('force')
     toc_download_section(pname, cname, start, end, force)
Exemplo n.º 8
0
 def handle_noargs(self, **options):
     pname = smart_decode(options.get('pname'))
     cname = smart_decode(options.get('cname'))
     start = options.get('start')
     end = options.get('end')
     if start == -1:
         start = None
     if end == -1:
         end = None
     force = options.get('force')
     toc_download_entries(pname, cname, start, end, force)
Exemplo n.º 9
0
def get_recursive_text(element, text_parts):
    # Terminal
    if element.tag == 'pre':
        text_parts.append('')
        text_parts.append(XTEXT(element))
        text_parts.append('')
    # Terminal
    elif element.tag == 'br':
        tail = element.tail
        # This is a lone <br>
        if tail is None:
            text_parts.append('')
        else:
            text_parts.append(smart_decode(tail).strip())
    else:
        if element.tag in PARAGRAPHS:
            text_parts.append('')

        text = element.text
        if text is None:
            text = ''

        # If it is a paragraph, separate the content.
        # Otherwise, inline the content with previous line.
        if element.tag in PARAGRAPHS or len(text_parts) == 0:
            text_parts.append(smart_decode(text).strip())
        else:
            text_parts[-1] = '{0} {1}'.format(text_parts[-1],
                                              smart_decode(text).strip())

        for child in element:
            get_recursive_text(child, text_parts)

        if element.tag in PARAGRAPHS:
            text_parts.append('')

        tail = element.tail
        if tail is None:
            tail = ''

        # If it is a paragraph, separate the content.
        # Otherwise, inline the content with previous line.
        if element.tag in PARAGRAPHS or len(text_parts) == 0:
            text_parts.append(smart_decode(tail).strip())
        else:
            text_parts[-1] = '{0} {1}'.format(text_parts[-1],
                                              smart_decode(tail).strip())
Exemplo n.º 10
0
def get_recursive_text(element, text_parts):
    # Terminal
    if element.tag == "pre":
        text_parts.append("")
        text_parts.append(XTEXT(element))
        text_parts.append("")
    # Terminal
    elif element.tag == "br":
        tail = element.tail
        # This is a lone <br>
        if tail is None:
            text_parts.append("")
        else:
            text_parts.append(smart_decode(tail).strip())
    else:
        if element.tag in PARAGRAPHS:
            text_parts.append("")

        text = element.text
        if text is None:
            text = ""

        # If it is a paragraph, separate the content.
        # Otherwise, inline the content with previous line.
        if element.tag in PARAGRAPHS or len(text_parts) == 0:
            text_parts.append(smart_decode(text).strip())
        else:
            text_parts[-1] = "{0} {1}".format(text_parts[-1], smart_decode(text).strip())

        for child in element:
            get_recursive_text(child, text_parts)

        if element.tag in PARAGRAPHS:
            text_parts.append("")

        tail = element.tail
        if tail is None:
            tail = ""

        # If it is a paragraph, separate the content.
        # Otherwise, inline the content with previous line.
        if element.tag in PARAGRAPHS or len(text_parts) == 0:
            text_parts.append(smart_decode(tail).strip())
        else:
            text_parts[-1] = "{0} {1}".format(text_parts[-1], smart_decode(tail).strip())
Exemplo n.º 11
0
def get_value(prefix, key, cache_function, args=None, expiration=DEFAULT_EXPIRATION_TIME):
    """Please note that even if CACHE_MIDDLEWARE_KEY_PREFIX is set in
       settings, the prefix is not appended to the key when manually
       using the cache so a prefix is required.
    """
    global cache_total
    global cache_miss

    new_key = get_safe_key(smart_decode(prefix) + smart_decode(key))
    value = cache.get(new_key, DEFAULT_EXPIRED)
    cache_total += 1
    if value == DEFAULT_EXPIRED:
        cache_miss += 1
        if args is None:
            value = cache_function()
        else:
            value = cache_function(*args)
        cache.set(new_key, value, expiration)
    return value
Exemplo n.º 12
0
def get_value(prefix,
              key,
              cache_function,
              args=None,
              expiration=DEFAULT_EXPIRATION_TIME):
    '''Please note that even if CACHE_MIDDLEWARE_KEY_PREFIX is set in
       settings, the prefix is not appended to the key when manually
       using the cache so a prefix is required.
    '''
    global cache_total
    global cache_miss

    new_key = get_safe_key(smart_decode(prefix) + smart_decode(key))
    value = cache.get(new_key, DEFAULT_EXPIRED)
    cache_total += 1
    if value == DEFAULT_EXPIRED:
        cache_miss += 1
        if args is None:
            value = cache_function()
        else:
            value = cache_function(*args)
        cache.set(new_key, value, expiration)
    return value
Exemplo n.º 13
0
 def handle_noargs(self, **options):
     pname = smart_decode(options.get('pname'))
     cname = smart_decode(options.get('cname'))
     cfull_name = smart_decode(options.get('cfull_name'))
     url = smart_decode(options.get('url'))
     syncer = smart_decode(options.get('syncer'))
     parser = smart_decode(options.get('parser'))
     create_channel_db(pname, cfull_name, cname, syncer, parser, url)
     if (options.get('local', False)):
         create_channel_local(pname, cname, syncer, url)
Exemplo n.º 14
0
 def handle_noargs(self, **options):
     pname = smart_decode(options.get('pname'))
     dname = smart_decode(options.get('dname'))
     release = smart_decode(options.get('release'))
     url = smart_decode(options.get('url'))
     syncer = smart_decode(options.get('syncer'))
     parser = smart_decode(options.get('parser'))
     create_doc_db(pname, dname, release, url, syncer, parser)
     if (options.get('local', False)):
         create_doc_local(pname, dname, release, syncer, url)
Exemplo n.º 15
0
 def handle_noargs(self, **options):
     pname = smart_decode(options.get('pname'))
     cname = smart_decode(options.get('cname'))
     cfull_name = smart_decode(options.get('cfull_name'))
     url = smart_decode(options.get('url'))
     syncer = smart_decode(options.get('syncer'))
     parser = smart_decode(options.get('parser'))
     create_channel_db(pname, cfull_name, cname, syncer, parser, url)
     if (options.get('local', False)):
         create_channel_local(pname, cname, syncer, url)
Exemplo n.º 16
0
 def handle_noargs(self, **options):
     file_path = smart_decode(options.get('file'))
     url = smart_decode(options.get('url'))
     create_filter_file(file_path, url)
Exemplo n.º 17
0
 def handle_noargs(self, **options):
     pname = smart_decode(options.get('pname'))
     bname = smart_decode(options.get('bname'))
     release = smart_decode(options.get('release'))
     parser = smart_decode(options.get('parser'))
     clear_code_elements(pname, bname, release, parser)
Exemplo n.º 18
0
 def handle_noargs(self, **options):
     pname = smart_decode(options.get('pname'))
     bname = smart_decode(options.get('bname'))
     release1 = smart_decode(options.get('release1'))
     release2 = smart_decode(options.get('release2'))
     diff_codebases(pname, bname, release1, release2)
Exemplo n.º 19
0
 def handle_noargs(self, **options):
     pname = smart_decode(options.get('pname'))
     bname = smart_decode(options.get('bname'))
     release = smart_decode(options.get('release'))
     link_eclipse(pname, bname, release)
Exemplo n.º 20
0
 def handle_noargs(self, **options):
     pname = smart_decode(options.get('pname'))
     dname = smart_decode(options.get('dname'))
     release = smart_decode(options.get('release'))
     sync_doc(pname, dname, release)
Exemplo n.º 21
0
 def handle_noargs(self, **options):
     pname = smart_decode(options.get('pname'))
     cname = smart_decode(options.get('cname'))
     skip = options.get('skip_refs')
     entry_url = smart_decode(options.get('url'))
     debug_channel(pname, cname, not skip, entry_url)
Exemplo n.º 22
0
 def handle_noargs(self, **options):
     create_project_local(smart_decode(options.get('pname')))
Exemplo n.º 23
0
 def handle_noargs(self, **options):
     pname = smart_decode(options.get('pname'))
     parser = smart_decode(options.get('parser'))
     source = smart_decode(options.get('source'))
     parse_snippets(pname, source, parser)
Exemplo n.º 24
0
 def handle_noargs(self, **options):
     create_release_db(smart_decode(options.get('pname')),
                       smart_decode(options.get('release')),
                       options.get('is_major'))
Exemplo n.º 25
0
 def handle_noargs(self, **options):
     pname = smart_decode(options.get('pname'))
     cname = smart_decode(options.get('cname'))
     url = smart_decode(options.get('url'))
     syncer = smart_decode(options.get('syncer'))
     create_channel_local(pname, cname, syncer, url)
Exemplo n.º 26
0
 def handle_noargs(self, **options):
     pname = smart_decode(options.get('pname'))
     cname = smart_decode(options.get('cname'))
     clear_channel_elements(pname, cname)
Exemplo n.º 27
0
 def handle_noargs(self, **options):
     pname = smart_decode(options.get('pname'))
     cname = smart_decode(options.get('cname'))
     clear_channel_elements(pname, cname)
Exemplo n.º 28
0
 def handle_noargs(self, **options):
     file_path = smart_decode(options.get('file'))
     url = smart_decode(options.get('url'))
     create_filter_file(file_path, url)
Exemplo n.º 29
0
 def handle_noargs(self, **options):
     pname = smart_decode(options.get('pname'))
     bname = smart_decode(options.get('bname'))
     release = smart_decode(options.get('release'))
     filter_files = smart_decode(options.get('filters'))
     add_filter(pname, bname, release, filter_files)
Exemplo n.º 30
0
 def handle_noargs(self, **options):
     pname = smart_decode(options.get('pname'))
     dname = smart_decode(options.get('dname'))
     release1 = smart_decode(options.get('release1'))
     release2 = smart_decode(options.get('release2'))
     diff_doc(pname, dname, release1, release2)
Exemplo n.º 31
0
 def handle_noargs(self, **options):
     create_release_db(smart_decode(options.get('pname')),
                       smart_decode(options.get('release')),
                       options.get('is_major'))
Exemplo n.º 32
0
 def handle_noargs(self, **options):
     pname = smart_decode(options.get('pname'))
     bname = smart_decode(options.get('bname'))
     release = smart_decode(options.get('release'))
     link_eclipse(pname, bname, release)
Exemplo n.º 33
0
def func2(arg1, arg2):
    return su.smart_decode(arg1 + arg2)
Exemplo n.º 34
0
 def handle_noargs(self, **options):
     create_project_db(smart_decode(options.get('pfullname')),
                       smart_decode(options.get('url')),
                       smart_decode(options.get('pname')))
     if (options.get('local', False)):
         create_project_local(smart_decode(options.get('pname')))
Exemplo n.º 35
0
 def handle_noargs(self, **options):
     pname = smart_decode(options.get('pname'))
     bname = smart_decode(options.get('bname'))
     release1 = smart_decode(options.get('release1'))
     release2 = smart_decode(options.get('release2'))
     diff_codebases(pname, bname, release1, release2)
Exemplo n.º 36
0
 def handle_noargs(self, **options):
     pname = smart_decode(options.get('pname'))
     dname = smart_decode(options.get('dname'))
     release = smart_decode(options.get('release'))
     clear_doc_elements(pname, dname, release)
Exemplo n.º 37
0
 def handle_noargs(self, **options):
     pname = smart_decode(options.get('pname'))
     dname = smart_decode(options.get('dname'))
     release1 = smart_decode(options.get('release1'))
     release2 = smart_decode(options.get('release2'))
     diff_doc(pname, dname, release1, release2)
Exemplo n.º 38
0
 def handle_noargs(self, **options):
     create_project_db(smart_decode(options.get('pfullname')),
                       smart_decode(options.get('url')),
                       smart_decode(options.get('pname')))
     if (options.get('local', False)):
         create_project_local(smart_decode(options.get('pname')))
Exemplo n.º 39
0
 def handle_noargs(self, **options):
     pname = smart_decode(options.get('pname'))
     cname = smart_decode(options.get('cname'))
     post_process_channel(pname, cname)
Exemplo n.º 40
0
 def handle_noargs(self, **options):
     pname = smart_decode(options.get('pname'))
     cname = smart_decode(options.get('cname'))
     output_path = smart_decode(options.get('output'))
     json_snippet(pname, cname, output_path)
Exemplo n.º 41
0
def set_value(prefix, key, value, expiration=DEFAULT_EXPIRATION_TIME):
    new_key = get_safe_key(smart_decode(prefix) + smart_decode(key))
    cache.set(new_key, value, expiration)
Exemplo n.º 42
0
 def handle_noargs(self, **options):
     pname = smart_decode(options.get("pname"))
     bname = smart_decode(options.get("bname"))
     release = smart_decode(options.get("release"))
     filter_files = smart_decode(options.get("filters"))
     add_filter(pname, bname, release, filter_files)
Exemplo n.º 43
0
 def handle_noargs(self, **options):
     pname = smart_decode(options.get('pname'))
     language = smart_decode(options.get('language'))
     source = smart_decode(options.get('source'))
     clear_snippets(pname, language, source)
Exemplo n.º 44
0
 def handle_noargs(self, **options):
     pname = smart_decode(options.get('pname'))
     cname = smart_decode(options.get('cname'))
     output_path = smart_decode(options.get('output'))
     json_snippet(pname, cname, output_path)
Exemplo n.º 45
0
 def handle_noargs(self, **options):
     pname = smart_decode(options.get('pname'))
     bname = smart_decode(options.get('bname'))
     release = smart_decode(options.get('release'))
     parser = smart_decode(options.get('parser'))
     clear_code_elements(pname, bname, release, parser)
Exemplo n.º 46
0
def set_value(prefix, key, value, expiration=DEFAULT_EXPIRATION_TIME):
    new_key = get_safe_key(smart_decode(prefix) + smart_decode(key))
    cache.set(new_key, value, expiration)
Exemplo n.º 47
0
 def handle_noargs(self, **options):
     pname = smart_decode(options.get('pname'))
     cname = smart_decode(options.get('cname'))
     skip = options.get('skip_refs')
     entry_url = smart_decode(options.get('url'))
     debug_channel(pname, cname, not skip, entry_url)
Exemplo n.º 48
0
 def handle_noargs(self, **options):
     pname = smart_decode(options.get('pname'))
     cname = smart_decode(options.get('cname'))
     skip = options.get('skip_refs')
     parse_channel(pname, cname, not skip)
Exemplo n.º 49
0
 def handle_noargs(self, **options):
     pname = smart_decode(options.get('pname'))
     cname = smart_decode(options.get('cname'))
     toc_view(pname, cname)
Exemplo n.º 50
0
def func2(arg1, arg2):
    return su.smart_decode(arg1 + arg2)
Exemplo n.º 51
0
 def handle_noargs(self, **options):
     pname = smart_decode(options.get('pname'))
     parser = smart_decode(options.get('parser'))
     source = smart_decode(options.get('source'))
     parse_snippets(pname, source, parser)
Exemplo n.º 52
0
 def handle_noargs(self, **options):
     pname = smart_decode(options.get('pname'))
     cname = smart_decode(options.get('cname'))
     url = smart_decode(options.get('url'))
     syncer = smart_decode(options.get('syncer'))
     create_channel_local(pname, cname, syncer, url)
Exemplo n.º 53
0
 def handle_noargs(self, **options):
     pname = smart_decode(options.get('pname'))
     dname = smart_decode(options.get('dname'))
     release = smart_decode(options.get('release'))
     skip = options.get('skip_refs')
     parse_doc(pname, dname, release, not skip)