[tor-commits] [gettor/master] Better name for OS (twitter/xmpp)

ilv at torproject.org ilv at torproject.org
Tue Feb 16 20:26:27 UTC 2016


commit e45a517df93e762865520fa671acc493293c94ea
Author: ilv <ilv at users.noreply.github.com>
Date:   Tue Feb 16 17:27:15 2016 -0300

    Better name for OS (twitter/xmpp)
---
 gettor/twitter.py | 8 +++++++-
 gettor/xmpp.py    | 8 +++++++-
 2 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/gettor/twitter.py b/gettor/twitter.py
index 7fedffe..deced9b 100644
--- a/gettor/twitter.py
+++ b/gettor/twitter.py
@@ -24,6 +24,12 @@ import blacklist
 
 """Twitter channel for distributing links to download Tor Browser."""
 
+OS = {
+    'osx': 'Mac OS X',
+    'linux': 'Linux',
+    'windows': 'Windows'
+}
+
 
 class ConfigError(Exception):
     pass
@@ -234,7 +240,7 @@ class TwitterBot(object):
                     )
 
                     reply = self._get_msg('links', 'en')
-                    reply = reply % (req['os'], req['lc'], links)
+                    reply = reply % (OS[req['os']], links)
 
                 elif req['type'] == 'mirrors':
                     self.log.info('mirrors; none; %s' % req['lc'])
diff --git a/gettor/xmpp.py b/gettor/xmpp.py
index 1bea716..4df7ac9 100644
--- a/gettor/xmpp.py
+++ b/gettor/xmpp.py
@@ -30,6 +30,12 @@ import blacklist
 
 """XMPP module for processing requests."""
 
+OS = {
+    'osx': 'Mac OS X',
+    'linux': 'Linux',
+    'windows': 'Windows'
+}
+
 
 class ConfigError(Exception):
     pass
@@ -316,7 +322,7 @@ class XMPP(object):
                         req['lc']
                     )
                     reply = self._get_msg('links', 'en')
-                    reply = reply % (req['os'], req['lc'], links)
+                    reply = reply % (OS[req['os']], links)
 
         except (core.ConfigError, core.InternalError) as e:
             # if core failes, send the user an error message, but keep going





More information about the tor-commits mailing list