# HG changeset patch # User Goffi # Date 1482680485 -3600 # Node ID 17094a075fd25c0553db56b28fc86332a8862c7d # Parent c711be670ecdebb1f7a90908041d2aa8a5218302 core: use C.PLUGIN_EXT to know which plugin extension to use diff -r c711be670ecd -r 17094a075fd2 src/cagou/core/cagou_main.py --- a/src/cagou/core/cagou_main.py Sun Dec 25 16:41:21 2016 +0100 +++ b/src/cagou/core/cagou_main.py Sun Dec 25 16:41:25 2016 +0100 @@ -71,6 +71,7 @@ # so we change it to allow backend to detect android sys.platform = "android" import mmap + C.PLUGIN_EXT = 'pyo' class NotifsIcon(IconButton): @@ -380,13 +381,8 @@ def _import_plugins(self): """import all plugins""" self.default_wid = None - if sys.platform == "android": - # FIXME: android hack, need to be moved to separate file - plugins_path = "/data/data/org.goffi.cagou.cagou/files/cagou/plugins" - plugin_glob = "plugin*.pyo" - else: - plugins_path = os.path.dirname(cagou.plugins.__file__) - plugin_glob = "plugin*.py" + plugins_path = os.path.dirname(cagou.plugins.__file__) + plugin_glob = u"plugin*." + C.PLUGIN_EXT plug_lst = [os.path.splitext(p)[0] for p in map(os.path.basename, glob.glob(os.path.join(plugins_path, plugin_glob)))] imported_names_main = set() # used to avoid loading 2 times plugin with same import name diff -r c711be670ecd -r 17094a075fd2 src/service/main.py --- a/src/service/main.py Sun Dec 25 16:41:21 2016 +0100 +++ b/src/service/main.py Sun Dec 25 16:41:25 2016 +0100 @@ -33,6 +33,7 @@ # sys.platform is "linux" on android by default # so we change it to allow backend to detect android sys.platform = "android" + C.PLUGIN_EXT = "pyo" from sat.core import sat_main from twisted.internet import reactor