load config
[rainbowstream.git] / rainbowstream / config.py
... / ...
CommitLineData
1from .colors import *
2import json
3import os
4import os.path
5
6# 'search': max search record
7SEARCH_MAX_RECORD = 5
8# 'home': default number of home's tweets
9HOME_TWEET_NUM = 5
10# 'allrt': default number of retweets
11RETWEETS_SHOW_NUM = 5
12# 'inbox','sent': default number of direct message
13MESSAGES_DISPLAY = 5
14# 'trend': max trending topics
15TREND_MAX = 10
16# 'switch': Filter and Ignore list ex: ['@fat','@mdo']
17ONLY_LIST = []
18IGNORE_LIST = []
19
20# Autocomplete history file name
21HISTORY_FILENAME = 'completer.hist'
22
23USER_DOMAIN = 'userstream.twitter.com'
24PUBLIC_DOMAIN = 'stream.twitter.com'
25SITE_DOMAIN = 'sitestream.twitter.com'
26DOMAIN = USER_DOMAIN
27
28# Image config
29IMAGE_SHIFT = 10
30IMAGE_MAX_HEIGHT = 40
31
32# Load colorset
33COLOR_SET = ['colorset.default']
34modules = map(__import__, COLOR_SET)
35
36# Load json config
37rainbow_config = os.environ.get(
38 'HOME', os.environ.get('USERPROFILE',''))
39 + os.sep + '.rainbow_config.json'
40try:
41 if os.path.exists(rainbow_config):
42 data = json.load(open(rainbow_config))
43 for d in data:
44 locals()[d] = data[d]
45except:
46 pass
47
48