Skip to content
This repository was archived by the owner on Apr 13, 2018. It is now read-only.

Commit 5a503e4

Browse files
committed
新增 /home/pi/.dingdang/custom 作为用户个人插件目录
1 parent 2e90a1a commit 5a503e4

File tree

2 files changed

+14
-5
lines changed

2 files changed

+14
-5
lines changed

client/brain.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,11 @@ def get_plugins(cls):
3434
"""
3535

3636
logger = logging.getLogger(__name__)
37-
locations = [dingdangpath.PLUGIN_PATH, dingdangpath.CONTRIB_PATH]
37+
locations = [
38+
dingdangpath.PLUGIN_PATH,
39+
dingdangpath.CONTRIB_PATH,
40+
dingdangpath.CUSTOM_PATH
41+
]
3842
logger.debug("Looking for plugins in: %s",
3943
', '.join(["'%s'" % location for location in locations]))
4044
plugins = []

client/dingdangpath.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,15 @@
1010
TEMP_PATH = os.path.join(APP_PATH, "temp")
1111
PLUGIN_PATH = os.path.join(LIB_PATH, "plugins")
1212

13-
CONFIG_PATH = os.path.expanduser(os.getenv
14-
('DINGDANG_CONFIG', '~/.dingdang'))
15-
CONTRIB_PATH = os.path.expanduser(os.getenv
16-
('DINGDANG_CONFIG', '~/.dingdang/contrib'))
13+
CONFIG_PATH = os.path.expanduser(
14+
os.getenv('DINGDANG_CONFIG', '~/.dingdang')
15+
)
16+
CONTRIB_PATH = os.path.expanduser(
17+
os.getenv('DINGDANG_CONFIG', '~/.dingdang/contrib')
18+
)
19+
CUSTOM_PATH = os.path.expanduser(
20+
os.getenv('DINGDANG_CONFIG', '~/.dingdang/custom')
21+
)
1722

1823

1924
def config(*fname):

0 commit comments

Comments
 (0)