plugins: use util.make_dir for creating external plugin dir
This sets more restrictive unix permissions on the folder. Also, util.make_dir is "multiprocess-safe".
This commit is contained in:
@@ -46,7 +46,7 @@ from electrum_ecc import ECPrivkey, ECPubkey
|
|||||||
from ._vendor.distutils.version import StrictVersion
|
from ._vendor.distutils.version import StrictVersion
|
||||||
from .version import ELECTRUM_VERSION
|
from .version import ELECTRUM_VERSION
|
||||||
from .i18n import _
|
from .i18n import _
|
||||||
from .util import (profiler, DaemonThread, UserCancelled, ThreadJob, UserFacingException, ChoiceItem)
|
from .util import (profiler, DaemonThread, UserCancelled, ThreadJob, UserFacingException, ChoiceItem, make_dir)
|
||||||
from . import bip32
|
from . import bip32
|
||||||
from . import plugins
|
from . import plugins
|
||||||
from .simple_config import SimpleConfig
|
from .simple_config import SimpleConfig
|
||||||
@@ -485,8 +485,7 @@ class Plugins(DaemonThread):
|
|||||||
|
|
||||||
def get_external_plugin_dir(self) -> str:
|
def get_external_plugin_dir(self) -> str:
|
||||||
pkg_path = os.path.join(self.config.electrum_path(), 'plugins')
|
pkg_path = os.path.join(self.config.electrum_path(), 'plugins')
|
||||||
if not os.path.exists(pkg_path):
|
make_dir(pkg_path)
|
||||||
os.mkdir(pkg_path)
|
|
||||||
return pkg_path
|
return pkg_path
|
||||||
|
|
||||||
async def download_external_plugin(self, url: str) -> str:
|
async def download_external_plugin(self, url: str) -> str:
|
||||||
|
|||||||
Reference in New Issue
Block a user