示例#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)
示例#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)
示例#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)
示例#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)
示例#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'))
示例#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'))
示例#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)
示例#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)
示例#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())
示例#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())
示例#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
示例#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
示例#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)
示例#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)
示例#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)
示例#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)
示例#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)
示例#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)
示例#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)
示例#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)
示例#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)
示例#22
0
 def handle_noargs(self, **options):
     create_project_local(smart_decode(options.get('pname')))
示例#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)
示例#24
0
 def handle_noargs(self, **options):
     create_release_db(smart_decode(options.get('pname')),
                       smart_decode(options.get('release')),
                       options.get('is_major'))
示例#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)
示例#26
0
 def handle_noargs(self, **options):
     pname = smart_decode(options.get('pname'))
     cname = smart_decode(options.get('cname'))
     clear_channel_elements(pname, cname)
示例#27
0
 def handle_noargs(self, **options):
     pname = smart_decode(options.get('pname'))
     cname = smart_decode(options.get('cname'))
     clear_channel_elements(pname, cname)
示例#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)
示例#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)
示例#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)
示例#31
0
 def handle_noargs(self, **options):
     create_release_db(smart_decode(options.get('pname')),
                       smart_decode(options.get('release')),
                       options.get('is_major'))
示例#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)
示例#33
0
def func2(arg1, arg2):
    return su.smart_decode(arg1 + arg2)
示例#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')))
示例#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)
示例#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)
示例#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)
示例#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')))
示例#39
0
 def handle_noargs(self, **options):
     pname = smart_decode(options.get('pname'))
     cname = smart_decode(options.get('cname'))
     post_process_channel(pname, cname)
示例#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)
示例#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)
示例#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)
示例#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)
示例#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)
示例#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)
示例#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)
示例#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)
示例#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)
示例#49
0
 def handle_noargs(self, **options):
     pname = smart_decode(options.get('pname'))
     cname = smart_decode(options.get('cname'))
     toc_view(pname, cname)
示例#50
0
文件: tests.py 项目: bartdag/recodoc2
def func2(arg1, arg2):
    return su.smart_decode(arg1 + arg2)
示例#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)
示例#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)
示例#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)