From 5a503e426a32739ef34bd46222c49a24c2926144 Mon Sep 17 00:00:00 2001 From: Joseph Pan Date: Sat, 15 Jul 2017 00:59:50 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20/home/pi/.dingdang/custom?= =?UTF-8?q?=20=E4=BD=9C=E4=B8=BA=E7=94=A8=E6=88=B7=E4=B8=AA=E4=BA=BA?= =?UTF-8?q?=E6=8F=92=E4=BB=B6=E7=9B=AE=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/brain.py | 6 +++++- client/dingdangpath.py | 13 +++++++++---- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/client/brain.py b/client/brain.py index fc4b3b8..442854d 100644 --- a/client/brain.py +++ b/client/brain.py @@ -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 = [] diff --git a/client/dingdangpath.py b/client/dingdangpath.py index c127d51..1e39fd0 100755 --- a/client/dingdangpath.py +++ b/client/dingdangpath.py @@ -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):