Example #1
0
def _export_rtf(html, flag, wf):
    """Convert to RTF"""
    path = wf.cachefile('temp_export.html')
    html = _prepare_html(html)
    if flag == 'citation':
        if zq.backend.csl_style == 'bibtex':
            html = '[@' + html.strip() + ']'
    utils.write_path(html, path)
    rtf = html2rtf(path)
    return rtf
Example #2
0
def _export_rtf(html, flag, wf):
    """Convert to RTF"""
    path = wf.cachefile('temp_export.html')
    html = _prepare_html(html)
    if flag == 'citation':
        if zq.backend.csl_style == 'bibtex':
            html = '[@' + html.strip() + ']'
    utils.write_path(html, path)
    rtf = html2rtf(path)
    return rtf
Example #3
0
    def store_codepath(self):
        """Store data in appropriate file.

        :returns: status of store process
        :rtype: :class:`boolean`

        """
        # TODO: use `self.wf.cache_data()`
        path = self.wf.cachefile('{}_query_result.txt'.format(self.flag))
        utils.write_path(self.arg, path)
        return True
Example #4
0
def store(flag, arg, wf):
    """Store data in appropriate file.

    :returns: status of store process
    :rtype: :class:`boolean`

    """
    path = wf.cachefile('{}_query_result.txt'.format(flag))
    utils.write_path(arg, path)
    config.log.info('Item ID stored in cache file.')
    return True
Example #5
0
    def store_codepath(self):
        """Store data in appropriate file.

        :returns: status of store process
        :rtype: :class:`boolean`

        """
        # TODO: use `self.wf.cache_data()`
        path = self.wf.cachefile('{}_query_result.txt'.format(self.flag))
        utils.write_path(self.arg, path)
        return True
Example #6
0
    def _export_rtf(self, html):
        """Convert to RTF

        """
        path = self.wf.cachefile('temp_export.html')
        html = self._prepare_html(html)
        if self.flag == 'citation':
            if self.zotquery.csl_style == 'bibtex':
                html = '[@' + html.strip() + ']'
        utils.write_path(html, path)
        rtf = self.html2rtf(path)
        return rtf
Example #7
0
    def _export_rtf(self, html):
        """Convert to RTF

        """
        path = self.wf.cachefile('temp_export.html')
        html = self._prepare_html(html)
        if self.flag == 'citation':
            if self.zotquery.csl_style == 'bibtex':
                html = '[@' + html.strip() + ']'
        utils.write_path(html, path)
        rtf = self.html2rtf(path)
        return rtf