mirror of https://github.com/zulip/zulip.git
Wrap some lines with length greater than 120.
With some tweaks by tabbott.
This commit is contained in:
parent
e26afeeecf
commit
a137bf15ed
|
@ -55,7 +55,8 @@ is shown for all realms"""
|
||||||
option_list = BaseCommand.option_list + (
|
option_list = BaseCommand.option_list + (
|
||||||
make_option('--realm', action='store'),
|
make_option('--realm', action='store'),
|
||||||
make_option('--date', action='store', default="2013-09-06"),
|
make_option('--date', action='store', default="2013-09-06"),
|
||||||
make_option('--duration', action='store', default=1, type=int, help="How many days to show usage information for"),
|
make_option('--duration', action='store', default=1, type=int,
|
||||||
|
help="How many days to show usage information for"),
|
||||||
)
|
)
|
||||||
|
|
||||||
def handle(self, *args, **options):
|
def handle(self, *args, **options):
|
||||||
|
|
|
@ -208,7 +208,8 @@ def handle_event(event):
|
||||||
subject = "Discussion: %s" % (subj,)
|
subject = "Discussion: %s" % (subj,)
|
||||||
|
|
||||||
if category:
|
if category:
|
||||||
content = "%s started a new discussion in %s:\n\n~~~ quote\n%s\n~~~" % (actor_name, category, comment_content)
|
format_str = "%s started a new discussion in %s:\n\n~~~ quote\n%s\n~~~"
|
||||||
|
content = format_str % (actor_name, category, comment_content)
|
||||||
else:
|
else:
|
||||||
content = "%s posted:\n\n~~~ quote\n%s\n~~~" % (actor_name, comment_content)
|
content = "%s posted:\n\n~~~ quote\n%s\n~~~" % (actor_name, comment_content)
|
||||||
|
|
||||||
|
@ -223,7 +224,8 @@ def handle_event(event):
|
||||||
|
|
||||||
start_ref_url = make_url("projects/%s/repositories/%s/commit/%s" % (project_link, repo_link, start_ref))
|
start_ref_url = make_url("projects/%s/repositories/%s/commit/%s" % (project_link, repo_link, start_ref))
|
||||||
end_ref_url = make_url("projects/%s/repositories/%s/commit/%s" % (project_link, repo_link, end_ref))
|
end_ref_url = make_url("projects/%s/repositories/%s/commit/%s" % (project_link, repo_link, end_ref))
|
||||||
between_url = make_url("projects/%s/repositories/%s/compare/%s...%s" % (project_link, repo_link, start_ref, end_ref))
|
between_url = make_url("projects/%s/repositories/%s/compare/%s...%s" % (
|
||||||
|
project_link, repo_link, start_ref, end_ref))
|
||||||
|
|
||||||
subject = "Deployment to %s" % (environment,)
|
subject = "Deployment to %s" % (environment,)
|
||||||
|
|
||||||
|
|
|
@ -45,11 +45,12 @@ parser = optparse.OptionParser(r"""
|
||||||
|
|
||||||
Slurp tweets on your timeline into a specific zulip stream.
|
Slurp tweets on your timeline into a specific zulip stream.
|
||||||
|
|
||||||
Run this on your personal machine. Your API key and twitter id are revealed to local
|
Run this on your personal machine. Your API key and twitter id
|
||||||
users through the command line or config file.
|
are revealed to local users through the command line or config
|
||||||
|
file.
|
||||||
|
|
||||||
This bot uses OAuth to authenticate with twitter. Please create a ~/.zulip_twitterrc with
|
This bot uses OAuth to authenticate with twitter. Please create a
|
||||||
the following contents:
|
~/.zulip_twitterrc with the following contents:
|
||||||
|
|
||||||
[twitter]
|
[twitter]
|
||||||
consumer_key =
|
consumer_key =
|
||||||
|
@ -57,14 +58,16 @@ parser = optparse.OptionParser(r"""
|
||||||
access_token_key =
|
access_token_key =
|
||||||
access_token_secret =
|
access_token_secret =
|
||||||
|
|
||||||
In order to obtain a consumer key & secret, you must register a new application under your twitter account:
|
In order to obtain a consumer key & secret, you must register a
|
||||||
|
new application under your twitter account:
|
||||||
|
|
||||||
1. Go to http://dev.twitter.com
|
1. Go to http://dev.twitter.com
|
||||||
2. Log in
|
2. Log in
|
||||||
3. In the menu under your username, click My Applications
|
3. In the menu under your username, click My Applications
|
||||||
4. Create a new application
|
4. Create a new application
|
||||||
|
|
||||||
Make sure to go the application you created and click "create my access token" as well. Fill in the values displayed.
|
Make sure to go the application you created and click "create my
|
||||||
|
access token" as well. Fill in the values displayed.
|
||||||
|
|
||||||
Depends on: twitter-python
|
Depends on: twitter-python
|
||||||
""")
|
""")
|
||||||
|
|
|
@ -150,7 +150,8 @@ def get_default_config_filename():
|
||||||
config_file = os.path.join(os.environ["HOME"], ".zuliprc")
|
config_file = os.path.join(os.environ["HOME"], ".zuliprc")
|
||||||
if (not os.path.exists(config_file) and
|
if (not os.path.exists(config_file) and
|
||||||
os.path.exists(os.path.join(os.environ["HOME"], ".humbugrc"))):
|
os.path.exists(os.path.join(os.environ["HOME"], ".humbugrc"))):
|
||||||
raise RuntimeError("The Zulip API configuration file is now ~/.zuliprc; please run:\n\n mv ~/.humbugrc ~/.zuliprc\n")
|
raise RuntimeError("The Zulip API configuration file is now ~/.zuliprc; please run:\n\n"
|
||||||
|
" mv ~/.humbugrc ~/.zuliprc\n")
|
||||||
return config_file
|
return config_file
|
||||||
|
|
||||||
class Client(object):
|
class Client(object):
|
||||||
|
|
|
@ -381,7 +381,8 @@ option does not affect login credentials.'''.replace("\n", " "))
|
||||||
config.readfp(f, config_file)
|
config.readfp(f, config_file)
|
||||||
except IOError:
|
except IOError:
|
||||||
pass
|
pass
|
||||||
for option in ("jid", "jabber_password", "conference_domain", "mode", "zulip_email_suffix", "jabber_server_address", "jabber_server_port"):
|
for option in ("jid", "jabber_password", "conference_domain", "mode", "zulip_email_suffix",
|
||||||
|
"jabber_server_address", "jabber_server_port"):
|
||||||
if (getattr(options, option) is None
|
if (getattr(options, option) is None
|
||||||
and config.has_option("jabber_mirror", option)):
|
and config.has_option("jabber_mirror", option)):
|
||||||
setattr(options, option, config.get("jabber_mirror", option))
|
setattr(options, option, config.get("jabber_mirror", option))
|
||||||
|
|
|
@ -73,7 +73,8 @@ if remote_postgres_host != '':
|
||||||
postgres_sslmode = settings.REMOTE_POSTGRES_SSLMODE
|
postgres_sslmode = settings.REMOTE_POSTGRES_SSLMODE
|
||||||
else:
|
else:
|
||||||
postgres_sslmode = 'verify-full'
|
postgres_sslmode = 'verify-full'
|
||||||
conn = psycopg2.connect("user=zulip %s host='%s' dbname=zulip connect_timeout=600 sslmode='%s'" % (postgres_password, remote_postgres_host, postgres_sslmode))
|
conn = psycopg2.connect("user=zulip %s host='%s' dbname=zulip connect_timeout=600 sslmode='%s'" % (
|
||||||
|
postgres_password, remote_postgres_host, postgres_sslmode))
|
||||||
else:
|
else:
|
||||||
conn = psycopg2.connect("user=zulip")
|
conn = psycopg2.connect("user=zulip")
|
||||||
cursor = conn.cursor()
|
cursor = conn.cursor()
|
||||||
|
|
|
@ -171,7 +171,8 @@ def get_html_tag(text, i):
|
||||||
return s
|
return s
|
||||||
|
|
||||||
def check_our_files():
|
def check_our_files():
|
||||||
git_files = [line.strip() for line in subprocess.check_output(['git', 'ls-files'], universal_newlines=True).split('\n')]
|
git_files = [line.strip() for line in subprocess.check_output(['git', 'ls-files'],
|
||||||
|
universal_newlines=True).split('\n')]
|
||||||
|
|
||||||
# Check all our handlebars templates.
|
# Check all our handlebars templates.
|
||||||
templates = [fn for fn in git_files if fn.endswith('.handlebars')]
|
templates = [fn for fn in git_files if fn.endswith('.handlebars')]
|
||||||
|
|
|
@ -85,7 +85,8 @@ if not os.path.exists(CLOSURE_BINARY):
|
||||||
CLOSURE_BINARY = 'tools/closure-compiler/run'
|
CLOSURE_BINARY = 'tools/closure-compiler/run'
|
||||||
if not os.path.exists(CLOSURE_BINARY):
|
if not os.path.exists(CLOSURE_BINARY):
|
||||||
print("closure-compiler not installed; the Vagrant tools/provision.py installs it via apt "\
|
print("closure-compiler not installed; the Vagrant tools/provision.py installs it via apt "\
|
||||||
"or you can manually unpack http://dl.google.com/closure-compiler/compiler-latest.zip to tools/closure-compiler")
|
"or you can manually unpack http://dl.google.com/closure-compiler/compiler-latest.zip to "\
|
||||||
|
"tools/closure-compiler")
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
# Where to put minified JS and source maps
|
# Where to put minified JS and source maps
|
||||||
|
|
Loading…
Reference in New Issue