b7376af878c8f73dd0f52e5334a2b92e52380eb5
[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 default_colorset = 'rainbowstream/colorset/default.json'
34 try:
35 if os.path.exists(default_colorset):
36 data = json.load(open(default_colorset))
37 for d in data:
38 locals()[d] = data[d]
39 except:
40 pass
41
42 # Load json config
43 rainbow_config = os.environ.get('HOME', os.environ.get('USERPROFILE','')) + os.sep + '.rainbow_config.json'
44 try:
45 if os.path.exists(rainbow_config):
46 data = json.load(open(rainbow_config))
47 for d in data:
48 locals()[d] = data[d]
49 except:
50 pass
51
52