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