Beispiel #1
0
 def _list_album_msg(self, pic_url, news_url):
     return {
         'MsgType':
         'news',
         'ArticleCount':
         1,
         'Articles': [{
             'Title': ec('我的相册'),
             'Description': ec('查看我的相册'),
             'PicUrl': pic_url,
             'Url': news_url
         }],
     }
Beispiel #2
0
 def _manage_album_msg(self, news_url):
     return {
         'MsgType':
         'news',
         'ArticleCount':
         1,
         'Articles': [{
             'Title': ec('管理相册'),
             'Description': '',
             'PicUrl': '',
             'Url': news_url
         }],
     }
Beispiel #3
0
    def _set_streaming_content(self, value):
        if isinstance(value, six.string_types) and os.path.exists(value):
            self['Content-Length'] = os.path.getsize(value)
            self['Content-Type'] = 'application/octet-stream'
            self['Content-Disposition'] = 'attachment;filename="%s"' % os.path.basename(ec(value))
            value = tmp_file_iter(value, self.block_size)

        super(TmpFileResponse, self)._set_streaming_content(value)