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

Commit

Permalink
新增 /home/pi/.dingdang/custom 作为用户个人插件目录
Browse files Browse the repository at this point in the history
  • Loading branch information
wzpan committed Jul 14, 2017
1 parent 2e90a1a commit 5a503e4
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
6 changes: 5 additions & 1 deletion client/brain.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,11 @@ def get_plugins(cls):
"""

logger = logging.getLogger(__name__)
locations = [dingdangpath.PLUGIN_PATH, dingdangpath.CONTRIB_PATH]
locations = [
dingdangpath.PLUGIN_PATH,
dingdangpath.CONTRIB_PATH,
dingdangpath.CUSTOM_PATH
]
logger.debug("Looking for plugins in: %s",
', '.join(["'%s'" % location for location in locations]))
plugins = []
Expand Down
13 changes: 9 additions & 4 deletions client/dingdangpath.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,15 @@
TEMP_PATH = os.path.join(APP_PATH, "temp")
PLUGIN_PATH = os.path.join(LIB_PATH, "plugins")

CONFIG_PATH = os.path.expanduser(os.getenv
('DINGDANG_CONFIG', '~/.dingdang'))
CONTRIB_PATH = os.path.expanduser(os.getenv
('DINGDANG_CONFIG', '~/.dingdang/contrib'))
CONFIG_PATH = os.path.expanduser(
os.getenv('DINGDANG_CONFIG', '~/.dingdang')
)
CONTRIB_PATH = os.path.expanduser(
os.getenv('DINGDANG_CONFIG', '~/.dingdang/contrib')
)
CUSTOM_PATH = os.path.expanduser(
os.getenv('DINGDANG_CONFIG', '~/.dingdang/custom')
)


def config(*fname):
Expand Down

0 comments on commit 5a503e4

Please sign in to comment.