Commit graph

499 commits

Author SHA1 Message Date
Raghav Jajodia 58f5e729b6 mypy: Added Dict, List and Set imports.
Fixed mypy errors associated with the upgrade.
2017-03-04 14:33:44 -08:00
Rishi Gupta 6c47fa77b6 Use time.time() instead of datetime.now() to measure elapsed time.
Both because it is more idiomatic and because we will soon start enforcing
that all datetimes in Zulip are timezone aware.
2017-03-01 22:54:28 -08:00
Tim Abbott 722fc56534 lint: Clean up E126 PEP-8 rule. 2017-01-23 22:06:13 -08:00
Tim Abbott 55e8d5f58d lint: Clean up E123 PEP-8 rule. 2017-01-23 21:34:26 -08:00
Tim Abbott 5b3d2c9100 lint: Clean up E241 PEP-8 rule. 2017-01-23 21:21:14 -08:00
Tim Abbott 07cdd69e42 lint: Clean up W503 PEP-8 warning. 2017-01-23 20:50:04 -08:00
JefftheBest1 5e95dc3bdc Fixed typos with threshold. 2017-01-12 04:50:20 -08:00
Tommy Ip d5690c80c9 bots: Fix bare except clause. 2017-01-09 00:39:33 +00:00
Tommy Ip 6302f0d645 bots: Fix bare except clause. 2017-01-08 16:25:22 -08:00
Tommy Ip 39d7db40b3 bots: Fix bare except clause. 2017-01-08 16:25:22 -08:00
Tim Abbott b352dc85f0 bots: Move gcal-bot into official API release. 2016-12-30 12:01:31 -08:00
Tim Abbott adc678a3ab bots: Fix jabber_mirror_backend annotations.
mypy was super confused because the name "zulip" was both an import
and a global variable in the file.
2016-12-27 21:39:32 -08:00
Steve Howell 5ad39e3971 Remove mypy exemption for api/zulip/__init__.py.
This required instead exempting these files:

    bots/jabber_mirror_backend.py
    tools/deprecated/iframe-bot/show-last-messages

Turning on mypy for the API exposes issues in the annotations
of other files.
2016-12-21 11:22:42 -08:00
Tim Abbott 42eaabf203 bots: Remove obsolete tddium-notify-humbug. 2016-12-15 12:16:26 -08:00
Tim Abbott ca12fd8009 bots: Remove old zulip.com configuration files. 2016-12-15 09:39:32 -08:00
reallyly 9d6e7cfea5 pep8: Fix E128 violations.
With some line-wrapping tweaks by tabbott.
2016-12-13 10:50:14 -08:00
anirudhjain75 92981590f5 Annotate zephyr_mirror_backend.py.
With some tweaks by tabbott to update tuple->Tuple and update comments.
2016-12-07 15:57:55 -08:00
Tudor Nazarie 476a591ef5 Annotate bots/jabber_mirror_backend.py 2016-12-06 09:52:08 -08:00
nikolay cc5444a725 pep8: Fix many rule E128 violations.
[Tweaked by tabbott to adjust some approaches used in wrapping]
2016-12-03 13:33:31 -08:00
bulat22101 47488217b1 pep8: Fix E129 violations 2016-12-03 10:56:36 -08:00
bulat22101 dc48a41efe pep8: Fix E502 violations 2016-12-03 10:56:36 -08:00
Alex Huang 6eb6016913 pep8: Fix E131. 2016-12-01 23:16:47 -08:00
Alex Huang 68f7dae482 pep8: Fix E122. 2016-12-01 23:16:35 -08:00
AZtheAsian e410264372 pep8: fix E201 violations 2016-12-01 23:06:02 -08:00
AZtheAsian 439dc8ca96 pep8: fix E202 violations 2016-12-01 23:06:02 -08:00
AZtheAsian 418f396b32 pep8: Fix E203 violations 2016-12-01 20:37:57 -08:00
Bickio bc9bb4287d pep8: Fix E125. 2016-11-30 20:03:29 -08:00
Tommy Ip 1cb7c41786 pep8: Fix E701 violations. 2016-11-30 20:45:09 +00:00
Heidi Dong 836e3379c9 mypy: Annotate bots/gcal-bot. 2016-11-29 20:49:11 -08:00
Rafid Aslam 1ae8ac85d8 pep8: Fix E301 pep8 violations.
Fix "E301: expected (1 or 2) blank line" pep8 violations.
2016-11-29 08:51:44 -08:00
Anders Kaseorg fe99695210 Always start python via shebang lines.
This is preparation for supporting using Python 3 in production.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
2016-11-26 14:46:37 -08:00
Anders Kaseorg f2b82f3ad8 Mark scripts executable
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
2016-11-26 13:20:22 -08:00
Tim Abbott 2ed9f15ff7 Annotate remaining scripts. 2016-10-15 22:36:10 -07:00
reyha 28b697ac9d irc-mirror: Update the installation link.
This updates the link to python-irc to its current URL.
2016-10-10 16:23:11 -07:00
Sahil Dua 6900cd2e9a Remove extra new lines at the ends of Zulip authoried files.
Fixes #1627.

[tweaked by tabbott to avoid patching third-party modules, for now]
2016-09-26 21:05:24 -07:00
Tim Abbott ea7991443c check-mirroring: Fix unnecessary type: ignore. 2016-09-12 21:43:45 -07:00
Tim Abbott bb68ad4269 Annotate bots/summarize_stream.py. 2016-09-11 17:09:27 -07:00
Tim Abbott 38b62518af Annotate irc-mirror.py. 2016-09-10 12:20:24 -07:00
Tim Abbott 33733e67ba Annotate bots/zulip_git_config.py. 2016-09-10 11:57:08 -07:00
Tim Abbott 534774bd7e Annotate check-mirroring. 2016-09-10 11:57:01 -07:00
Tim Abbott b46aa33656 lint: Ban lines longer than 140 characters without #ignorelongline. 2016-08-19 12:03:09 -07:00
Tim Abbott 7b80e9bcc4 zephyr_mirror_backend: Update support email address.
Arguably we should figure out a way to make this fetch the support
email from the server (or something), but in the short term it seems
worth making the email address at least correct.
2016-08-17 22:39:08 -07:00
Tim Abbott ede820c9e3 log2zulip: use a Zulip virtualenv if available.
This makes it easier to use log2zulip in a Zulip server environment.
2016-08-12 13:17:36 -07:00
Tim Abbott 80a4826f49 Annotate zephyr_mirror.py. 2016-08-04 15:57:03 -07:00
Tim Abbott f50548d644 zephyr_mirror: Add typing import. 2016-08-04 15:57:03 -07:00
Tim Abbott a33c565ddc jabber_mirror: Add missing annotation. 2016-08-04 15:57:03 -07:00
Taranjeet 6034ae7b9a Wrap some lines with length greater than 120.
With some tweaks by tabbott.
2016-07-06 14:35:16 -07:00
Eklavya Sharma e786295352 Replace python2.7 by python everywhere. 2016-05-29 05:03:08 -07:00
Eklavya Sharma a21cb61b3f Change shebangs from python2.7 to python. 2016-05-29 05:03:08 -07:00
Tim Abbott ab505749ad Move rabbitmq consumer checks from bots/ to scripts/nagios/. 2016-05-07 19:37:06 -07:00
Tim Abbott e1deeba72a nagios: Move cron_file_helper from bots/ to scripts/lib.
This ensures the tool is available in Zulip production deployments.
2016-05-07 19:37:06 -07:00
Tim Abbott 2b386921f0 Finish purging 'fromt typing import *' from Zulip codebase. 2016-04-07 14:11:21 -07:00
Tim Abbott dd4fe7e099 Add PEP-484 annotations to bots/. 2016-04-03 15:40:23 -07:00
Eklavya Sharma 5e3013d2c2 Partially apply Python 3 libmodernize.fixes.fix_dict_six.
Refer to #256
2016-03-19 15:52:58 -07:00
Eklavya Sharma 7ccd60584a Apply Python 3 futurize transform libmodernize.fixes.fix_xrange_six
Refer to #256
2016-03-10 22:03:58 -08:00
Eklavya Sharma ab2692b217 Apply Python 3 futurize transform libmodernize.fixes.fix_file
Refer to #256
2016-03-10 22:02:34 -08:00
Eklavya Sharma 37365ba5a3 Apply Python 3 futurize transform libfuturize.fixes.fix_print_with_import
Refer #256
2016-03-10 22:02:17 -08:00
Eklavya Sharma 5272ca0674 Apply Python 3 futurize transform lib2to3.fixes.fix_except 2016-03-10 22:01:50 -08:00
Zev Benjamin 8c188cda49 Make log2zulip error message more accurate.
In particular, in the case of a permissions issue reading the log
file, it would claim the log file doesn't exist.
2016-02-02 23:04:48 -08:00
Tim Abbott b9eacb19c9 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 4dc5761ce2 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 91d851c448 Apply modernize transform libmodernize.fixes.fix_file.
This replaces use of file() with open() which is python 3 compatible,
and also adds it to our python 3 support test suite.
2016-01-26 21:09:42 -08:00
Tim Abbott e4f85d2462 Use new-style classes consistently for Python 3 support.
Also add the fixer for this to our list of fixers we check.
2015-11-04 08:01:52 -08:00
Tim Abbott c5e2995b6e Apply Python 3 futurize transform libmodernize.fixes.fix_xrange_six. 2015-11-01 09:35:06 -08:00
Tim Abbott 3cfe157299 Apply Python 3 futurize transform libmodernize.fixes.fix_map. 2015-11-01 09:35:05 -08:00
Tim Abbott 239d080616 Apply Python 3 futurize transform libmodernize.fixes.fix_imports_six. 2015-11-01 09:26:16 -08:00
Tim Abbott ec5103191e Apply Python 3 futurize transform libmodernize.fixes.fix_filter. 2015-11-01 09:26:16 -08:00
Tim Abbott 328816a329 Apply Python 3 futurize transform libfuturize.fixes.fix_print_with_import. 2015-11-01 09:26:16 -08:00
Tim Abbott 9b9ca80fab Apply Python 3 futurize transform libfuturize.fixes.fix_absolute_import. 2015-11-01 09:26:16 -08:00
Steven Oud b0325fef5b Consistently use /usr/bin/env python2.7 in shebangs and commands. 2015-10-21 22:58:21 +00:00
Waseem Daher 8281e557b1 Update Zulip support email to zulip-devel@googlegroups.com.
Ideally some of these templates should really point to the
local installation's support email address, but this is a
good start.

Exceptions:
* Where to report security incidents
* MIT Zephyr-related pages
* zulip.com terms and conditions
2015-09-29 17:59:47 -07:00
Jon Johnson a2765aef3a Fix typo in jabber mirror error
assistence -> assistance
2015-09-26 22:03:00 +00:00
Tim Abbott aed2e0d2f9 Remove certain hardcoded email addresses in Zephyr mirroring.
(imported from commit 9fd492b5463f04741558687f27522d48a5dc795b)
2015-09-20 00:36:12 -07:00
Tim Abbott c20623b841 Change API example usernames to use example.com domain.
(imported from commit 41b7be58735df0ea3d3a3daf23bc0f78606abc0d)
2015-09-19 18:12:02 -07:00
Zev Benjamin 7784fb9758 Update Trac bot config
(imported from commit 07e976637882030faedbf2e34448404e7e1de379)
2015-02-05 22:46:30 -08:00
Zev Benjamin 2cd47bba2b Update Git bot config
(imported from commit 8c189e199178efd8aa054d9762cb26330ab4ae86)
2015-02-05 22:46:30 -08:00
Zev Benjamin b2e1acfd44 Update Nagio's zuliprc
(imported from commit ac06b7cf41b1c0353c2096c4b9befae432fd7c5b)
2015-02-05 22:46:30 -08:00
Jason Michalski 56a353c5ac Raise the queue depth limits for missedmessage_emails
(imported from commit 73a0da21930d9bc121e07c811483311ec171fe7b)
2014-10-06 15:27:54 -07:00
Jason Michalski 1d649fe611 Add an options to set jabber server details
--jabber-server-address=JABBER_SERVER_ADDRESS
                    The hostname of your Jabber server
--jabber-server-port=JABBER_SERVER_PORT
                    The port of your Jabber server

(imported from commit f6b73ce6a2e3dcdbb100a1b6aba5ad89fc99a457)
2014-07-29 21:46:34 -07:00
Jason Michalski 700e744690 Update message events to include is_mirror_dummy
This can be used by mirroring scripts to only forward messages to users
who do not zulip accounts.

(imported from commit 200d6bcaaf39238bfb01480a9e906d567d4d9e11)
2014-07-29 21:46:34 -07:00
Zev Benjamin ec97f93ba5 Update user_root path for personal zmirrors
The location of the api directory moved.

(imported from commit 408ef7d47e729a0ad2454a5326cfaddcfff9855f)
2014-05-20 17:29:29 -07:00
Zev Benjamin 8829e654c1 zephyr_mirror: Specify a z_charset of utf-8
andersk reports that we are "incorrectly sending outgoing zephyrs with z_charset
= ZCHARSET_ISO_8859_1, which breaks zwgc (other clients tend to ignore
z_charset). I'm assuming you're shelling out to zwrite; you need to use zwrite
-x UTF-8, or export LC_ALL=en_US.UTF-8."

(imported from commit 8abb28bf8acbe0b5aa99ca13faab24e1e554a031)
2014-05-20 17:29:29 -07:00
Zev Benjamin 9e4b680e1f zephyr_mirror: Use timeout_success_equivalent in front-end script
(imported from commit 2263a371edda74c1c38a377e0fef5372999888b4)
2014-04-23 11:31:04 -07:00
Zev Benjamin d12490b3e5 jabber_mirror: Use timeout_success_equivalent in front-end script
(imported from commit 6ca8ec5a2c31d20e4e437804c65650c5a98c69f9)
2014-04-23 11:31:04 -07:00
Zev Benjamin 45b90fc33d jabber_mirror: Explicitly exit when we encounter an error in the main loop
(imported from commit 19b0f29bfd8c01fa300bdb9db2011bba0b55ddd4)
2014-04-23 11:31:04 -07:00
Zev Benjamin 43ef992ab0 jabber_mirror: Don't try to restart on errors caused by initial configuration
(imported from commit 5d9e6c88e1a159fe6e5e46c21c483b5c79444223)
2014-04-23 11:31:03 -07:00
Zev Benjamin a4f3a0c79e jabber_mirror: Split out into front-end and back-end processes
This adds auto-restarting capability.

(imported from commit 74a01a0272025706f2eb902eeedd9c05ee054272)
2014-04-23 11:31:03 -07:00
Zev Benjamin 41a782e011 Move backoff classes to the Zulip API
(imported from commit 76c5d499874f0397c505ab3fcda631a1a46847b6)
2014-04-23 11:31:03 -07:00
Jessica McKellar ee04f7b3e8 [puppet] Change digest email send time by 1 hour for daylight savings.
(imported from commit 8ac1747f15e10b850f73ce28ea4579bee62ba1a4)
2014-03-14 20:48:49 -04:00
Zev Benjamin 9fcd95b2df jabber_mirror: Calculate the zulip domain from the client email address
We were previously calculating it from the zulip_email option, which might not
be set if it is being specified via the config file.

(imported from commit 76866c239ca63ef90a7967c9a6027aeec9be6390)
2014-03-06 21:59:55 -05:00
Zev Benjamin 83afe8f6f8 jabber_mirror: Report a useful error message when fetching initial Zulip streams/subscriptions
(imported from commit 1133cb0ddb349cda7e16586fba4ba72888e66887)
2014-03-04 23:02:27 -05:00
Zev Benjamin 799953e7df jabber_mirror: Fix Zulip error handling
(imported from commit 8548576635e5be9b725e059c2d4d9ef9953ec97a)
2014-03-04 23:02:27 -05:00
Zev Benjamin ce660ac03f jabber_mirror: Add option to append a suffix to Zulip usernames
This is needed for the ist.mit.edu realm, where the same email address could be
used for all three of Zulip, Jabber, and Zephyr.  To disambiguate Jabber mirror
dummy users from Zephyr mirror dummy users with the same email address (but
which would be in a different realm), we force all email addresses in the
ist.mit.edu realm to have local parts that end in "+ist".

(imported from commit 5ebad2cc8f6c7286b4b9426d57ed75578703fb86)
2014-03-04 23:02:27 -05:00
Zev Benjamin 967b3c7156 jabber_mirror: Remove dead code
(imported from commit b67faad6888713554929c7e6a8147d19c489956a)
2014-03-04 23:02:27 -05:00
Zev Benjamin c040d16425 jabber_mirror: Allow the mode to be specified in the config file
(imported from commit 8de5006f6935271997204d958c44c03ebf14c403)
2014-03-04 23:02:27 -05:00
Zev Benjamin b5c326b444 jabber_mirror: Remove --openfire option
It doesn't actually seem to be necessary to adjust the SSL version in current
versions of Openfire.

(imported from commit 6766d9fd5081cf16f2a5e3e2b008f20e7498caa4)
2014-03-04 23:02:27 -05:00
Zev Benjamin 2f70b8ff39 jabber_mirror: Allow the MUC nickname to be specified
This allows users to run the public mirror as a regular user.

(imported from commit 3512dacf329dadc784d7be492ad290b17082bad4)
2014-03-04 23:02:27 -05:00
Zev Benjamin 88458043bb jabber_mirror: Change the default resource to 'zulip'
(imported from commit 290dca7fce5230dc94425478ad48fb8b8a0952b6)
2014-03-04 23:02:26 -05:00
Zev Benjamin 3e13e87a84 jabber_mirror: Guess the conference domain when it isn't specified
(imported from commit 3fed4bdf5ca73b3b9d58ec42a2031e75e813bbd2)
2014-03-04 23:02:26 -05:00
Zev Benjamin d2bc74003e jabber_mirror: Use sleekxmpp.JID when manipulating message recipients
(imported from commit 57b8384bf79a60abbaf535bd11f222d7f63db251)
2014-03-04 23:02:26 -05:00