Skip to content
This repository was archived by the owner on Feb 17, 2021. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
language: python

python:
- '2.7'
- '3.3'
- '3.4'
- '3.5'
- '3.6'
- pypy

before_install:
- pip install flake8

install:
- pip install -r requirements.txt

script:
- flake8 .
8 changes: 1 addition & 7 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1 @@
nose==1.3.7
numpy==1.13.3
protobuf==3.4.1
pycairo==1.15.3
twitter==1.17.1
yasm==0.0
zenmap==7.60
twitter
5 changes: 5 additions & 0 deletions twitterstatus.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@
except ImportError as e:
print("ERROR: Could not import config. Make sure config.py exists.")

try:
FileNotFoundError
except NameError:
FileNotFoundError = IOError

try:
from wordlist import wordlist

Expand Down
29 changes: 12 additions & 17 deletions wordlist.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ class MissingTranslationException(Exception):
pass


translations = {}

def wordlist(language="en_US"):
"""
Returns a list of lists containing words to be used in a status update
Expand All @@ -23,21 +21,18 @@ def wordlist(language="en_US"):
* fill words - good
* fill words - bad
"""
if language in translations:
return translations[language]
else:
path = './words/{0}/wordlist.json'.format(
language)
if os.path.exists(path):
translations = {}
path = './words/{0}/wordlist.json'.format(
language)

with open(path) as wordfile:
translations[language] = json.load(wordfile)
if os.path.exists(path):

# fixup space name
translations[language][0].append(config.SPACE_NAME)
return translations[language]
else:
raise MissingTranslationException(
"No translation for %s found" %
language)
with open(path) as wordfile:
translations[language] = json.load(wordfile)

# fixup space name
translations[language][0].append(config.SPACE_NAME)
return translations[language]
else:
raise MissingTranslationException(
"No translation for %s found" % language)