-
Notifications
You must be signed in to change notification settings - Fork 3
/
config.py
52 lines (40 loc) · 1.32 KB
/
config.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# -*- coding: utf-8 -*-
# !!! DO NOT EDIT !!! >>>
USER_BASE_URL = "www.evernote.com"
USER_STORE_URI = "https://www.evernote.com/edam/user"
CONSUMER_KEY = "skaizer-5314"
CONSUMER_SECRET = "6f4f9183b3120801"
USER_BASE_URL_SANDBOX = "sandbox.evernote.com"
USER_STORE_URI_SANDBOX = "https://sandbox.evernote.com/edam/user"
CONSUMER_KEY_SANDBOX = "skaizer-1250"
CONSUMER_SECRET_SANDBOX = "ed0fcc0c97c032a5"
# !!! DO NOT EDIT !!! <<<
import os, sys
# Evernote config
VERSION = 0.1
IS_IN_TERMINAL = sys.stdin.isatty()
IS_OUT_TERMINAL = sys.stdout.isatty()
# Application path
APP_DIR = os.path.join(os.getenv("USERPROFILE") or os.getenv("HOME"), ".geeknote")
ERROR_LOG = os.path.join(APP_DIR, "error.log")
# Set default system editor
DEF_UNIX_EDITOR = "nano"
DEF_WIN_EDITOR = "notepad.exe"
EDITOR_OPEN = "WRITE"
DEV_MODE = False
DEBUG = False
# Url view the note
NOTE_URL = "https://%domain%/Home.action?#n=%s"
# validate config
try:
if not os.path.exists(APP_DIR):
os.mkdir(APP_DIR)
except Exception, e:
sys.stdout.write("Can not create application dirictory : %s" % APP_DIR)
exit()
if DEV_MODE:
USER_STORE_URI = USER_STORE_URI_SANDBOX
CONSUMER_KEY = CONSUMER_KEY_SANDBOX
CONSUMER_SECRET = CONSUMER_SECRET_SANDBOX
USER_BASE_URL = USER_BASE_URL_SANDBOX
NOTE_URL = NOTE_URL.replace('%domain%', USER_BASE_URL)