Taranjeet
a8a4caf2c0
zerver: Fix lines with length greater than 120.
2016-07-08 11:41:43 -07:00
Eklavya Sharma
6bb266d262
bugdown's __init__.py: Add python 3 compatibility.
...
* Use Response.text instead of Response.content.
* Make unescaping work on python 3.
2016-07-07 09:52:24 -07:00
Eklavya Sharma
b902c1ae45
bugdown: Replace raw unicode literal with non-raw.
...
Raw unicode literals are disallowed in python 3.
2016-07-02 10:38:48 -07:00
Alex Wilson
8c62cff1b7
bugdown: Clean up paths to emojis.
2016-06-30 15:48:02 -07:00
Alex Wilson
5ec29101eb
Add unicode emoji support to bugdown.
...
Fixes half of #1011 .
2016-06-30 15:48:02 -07:00
Tim Abbott
ce7c7d3510
Wrap youtube_re.
2016-06-25 10:52:03 -07:00
Eklavya Sharma
744007f33f
zerver/lib/bugdown/__init__.py: Fix string types.
...
Change important string constants from str to text_type.
Replace str by text_type in annotations where relevant.
2016-06-16 15:21:17 -07:00
Eklavya Sharma
04f44b12ad
zerver/lib/bugdown/testing_mocks.py: Fix types.
...
Also fix clashing annotations in zerver/lib/bugdown/__init__.py.
2016-06-16 15:21:17 -07:00
Eklavya Sharma
a485d63975
zerver/lib/bugdown/__init__.py: Fix non-string annotations.
2016-06-16 15:21:17 -07:00
Tim Abbott
eafb91719c
get_tweet_id: Fix return type to by None.
2016-06-16 15:21:01 -07:00
Eklavya Sharma
72ed1f4187
Fix python 3 pyflakes error.
...
Change raw unicode literal to non-raw. A raw unicode literal is a
syntax error in python 3. This error was detected by pyflakes.
2016-06-13 19:44:56 -07:00
Tim Abbott
2219ef7bef
bugdown: Rename upload_re to upload_title_re for clarity.
2016-06-13 19:44:56 -07:00
Tim Abbott
5b1cfbc977
bugdown: Fix extraction of titles for uploaded files.
...
The previous code was associated with a previous version of the upload
URL naming scheme, and thus never triggered in practice.
2016-06-13 19:44:51 -07:00
Umair Khan
c8d139b2b1
Fix emoji urls interaction with i18n.
...
When accessing emojis with relative urls we should start the urls with
a slash so that language code doesn't become part of these urls.
Fixes #1014 .
2016-06-13 09:10:11 -07:00
Eklavya Sharma
8acc51218e
Fix realm emoji and realm filter annotations.
...
Change `str` to `text_type` in annotations in zerver/models.py
related to realm emoji and realm filters.
Also fix clashing annotations in zerver/lib/bugdown/__init__.py.
2016-06-12 09:25:42 -07:00
Tim Abbott
1ca7c3378b
Annotate zerver.lib.testing_mocks.
...
Also fix some annotations in bugdown to match.
2016-06-04 22:54:49 -07:00
Tim Abbott
6f69053911
Annotate most of the rest of bugdown.
2016-06-04 11:35:29 -07:00
Tim Abbott
e89730dc8f
subject_links: Remove useless RealmFilter.DoesNotExist case.
2016-06-03 23:18:39 -07:00
Tim Abbott
654bd663aa
bugdown: Add annotations for a few more functions.
...
This resolves the issue with Typeshed #244 by making `upload_re` start
with `ur`.
2016-06-03 18:11:53 -07:00
Oren Leaffer
2916fb30cb
bugdown: add some type annotations.
...
Had to add some "type: ignore" because the pattern used in match
doesn't affect the type returned. A fix for this issue has been pushed
to typeshed - https://github.com/python/typeshed/pull/244
2016-06-03 17:03:52 -07:00
Tim Abbott
b869be9301
style: Use 'not in' consistently rather than `not foo in`.
2016-05-09 17:00:10 -07:00
Tim Abbott
5bd94c15c7
Use camo to avoid mixed content warnings when displaying emoji.
2016-05-02 17:21:31 -07:00
Tim Abbott
65207477c4
bugdown: Annotate emoji handleMatch function.
2016-05-02 17:01:09 -07:00
Tim Abbott
4644967afc
dropbox preview: Remove preview_fail.png error condition.
...
Since we don't have a stable way to get the Dropbox preview failure
image (and it was sorta a weird setup anyway), it seems best to just
remove the condition.
2016-04-29 15:40:52 -07:00
Tim Abbott
755695d3c0
bugdown: Add type: ignore for fenced_code import.
...
This is a workaround to allow us to type-check files that depend on
this. Ideally in the future we'll fix the type errors in
fenced_code.py.
2016-04-28 12:50:47 -07:00
Tim Abbott
3e5ad69ffc
Extract camo encoding to a library.
2016-04-27 22:23:40 -07:00
Varshit
4e1060076d
Purge 'from typing import *' from zerver/.
...
This is a partial implementation of #636 .
2016-04-07 14:07:07 -07:00
Tim Abbott
2059f650ab
Add PEP-484 type annotations to zerver/lib/.
2016-04-03 15:40:23 -07:00
Tim Abbott
96eb81e5d5
Add documentation of Zulip's markdown implementation.
2016-04-01 09:56:59 -07:00
Eklavya Sharma
9e3c3e14f5
Partially apply Python 3 libmodernize.fixes.fix_dict_six.
...
Refer to #256
2016-03-19 15:52:58 -07:00
Eklavya Sharma
186efc6a6d
Handle unicode properly in camo.
...
In Bugdown's InlineHttpsProcessor.run, hex_encoded_url was not being
decoded to utf-8. This was causing problems in python 3.
Refer to #256 .
2016-03-19 15:46:07 -07:00
Tim Abbott
df0d2a726d
python3: Add missing utf-8 encoding/decoding in various places.
2016-03-08 09:14:15 -08:00
Tim Abbott
df1670ef59
Fix various float initialization to use 0.0 instead of 0.
...
This is needed to type-check these values.
2016-02-03 19:29:07 -08:00
Tim Abbott
8654b57c7b
bugdown: Move definition of current_node above set_text function using it.
2016-02-03 19:25:18 -08:00
Tim Abbott
5bacda3662
python3: Fix usage of .keys()/.values() to handle iterators.
...
This fixes the places where we use the result of .keys(), .items(),
and .values() that wouldn't work with an iterator to wrap them with
list().
2016-01-26 21:11:25 -08:00
Tim Abbott
6528b18ad3
Switch all urllib/urlparse usage to six.moves.urllib.
...
This provides Python 2+3 compatibility for our use of urllib.
Also add a test to avoid future regressions.
2016-01-26 21:09:43 -08:00
Tim Abbott
f7878a61e1
Apply Python 3 futurize transform libmodernize.fixes.fix_xrange_six.
2015-11-01 09:35:06 -08:00
Tim Abbott
2ea0663a4a
Apply Python 3 futurize transform libmodernize.fixes.fix_imports_six.
2015-11-01 09:26:16 -08:00
Tim Abbott
651b011514
Apply Python 3 futurize transform libmodernize.fixes.fix_basestring.
2015-11-01 09:26:16 -08:00
Darren Worrall
8b002040e0
Correct twitter library in requirements.
...
This also requires updating the required version of oauthlib; previously an
appropriate version was being installed only because it was a dependency of
the wrong twitter library.
This only affects development environments and/or hand-built
installations relying on the contents of requirements.txt.
To fix existing environments, the incorrect api needs to be explicitly
removed with `pip uninstall twitter`.
Fixes #86 .
2015-09-30 13:49:33 -07:00
Darren Worrall
bec3c0943a
Fix validation that twitter creds are present.
...
They are looked up as secrets which initialize to `None`, but the code
was checking for empty strings.
This, along with #80 , fixes #81 .
2015-09-30 09:27:37 -07:00
Tim Abbott
3770142635
Revert "Host "preview failed" image locally."
...
This reverts commit 39f2908a32c0276b1d87ecedc876c71dd35a9b2f.
We're not including the preview_fail.png image in the release.
(imported from commit 2de1451de2f9b1727fc3a7e64c380b71c0f2caa8)
2015-09-25 00:44:20 -07:00
David Roe
edf7e732a2
ENTERPRISE => VOYAGER.
...
(imported from commit 4f8080b9f506a87ca40bef32e39de5218cba916a)
2015-08-21 10:33:35 -07:00
David Roe
13f3b448e5
Kill Embed.ly integration.
...
(imported from commit dfe42a26e57100108c3c50298041bd520e0d8b1b)
2015-08-20 19:46:48 -07:00
Waseem Daher
569abda653
Host "preview failed" image locally.
...
Who knows when this Cloudfront URL will stop working!
(imported from commit 39f2908a32c0276b1d87ecedc876c71dd35a9b2f)
2014-07-29 21:46:35 -07:00
Paul Ruan
12cb8ceae0
Time out when waiting for OpenGraph links that take too long.
...
One common place that this happens (for us) is on a local
Dropbox .dev.corp.dropbox.com instance, which can't be reached
by the Zulip servers.
This commit also:
* Fixes the test suite
* Properly previews /photos/ links
(imported from commit b4788b6236e7a9d390e1efc4673be34d9ba5e091)
2014-07-29 21:46:35 -07:00
Jason Michalski
94ec1f3741
Better previews for dropbox shmodel.
...
Getting previews for docs using open-graph protocol images.
(imported from commit 11a9b446eeb5786fdbf536681a100f43ad6db978)
2014-07-29 21:46:34 -07:00
Waseem Daher
a9f01e382a
Switch streams page over to use consistent buttons.
...
(imported from commit c4d7f658f361a759a38951349e027ac3e279fe9b)
2014-03-05 17:23:23 -05:00
Leo Franchi
05d911b913
Allow auto-linked URLs to end with a !, without including the ! in the url
...
(imported from commit 26fbf8d8318dc32f31f94f366750521afab94ac5)
2014-03-05 15:22:05 -05:00
Waseem Daher
243c327d0a
Properly preview images from Dropbox photo albums.
...
Reported by jhurwitz (sorta).
(imported from commit 8ae4c5f7af86c5492842142b89be8cab1a2c3fae)
2014-02-27 20:25:35 -05:00