kopia lustrzana https://github.com/OpenDroneMap/WebODM
Renamed core plugin paths, bump version
rodzic
de17943440
commit
0d7e924849
|
@ -194,11 +194,11 @@ def get_plugins():
|
||||||
if settings.TESTING:
|
if settings.TESTING:
|
||||||
module = importlib.import_module("app.media_test.plugins.{}".format(dir))
|
module = importlib.import_module("app.media_test.plugins.{}".format(dir))
|
||||||
else:
|
else:
|
||||||
module = importlib.import_module("app.media.plugins.{}".format(dir))
|
module = importlib.import_module("plugins.{}".format(dir))
|
||||||
|
|
||||||
plugin = (getattr(module, "Plugin"))()
|
plugin = (getattr(module, "Plugin"))()
|
||||||
except (ImportError, AttributeError):
|
except (ImportError, AttributeError):
|
||||||
module = importlib.import_module("plugins.{}".format(dir))
|
module = importlib.import_module("coreplugins.{}".format(dir))
|
||||||
plugin = (getattr(module, "Plugin"))()
|
plugin = (getattr(module, "Plugin"))()
|
||||||
|
|
||||||
# Check version
|
# Check version
|
||||||
|
@ -284,7 +284,7 @@ def get_plugins_paths():
|
||||||
current_path = os.path.dirname(os.path.realpath(__file__))
|
current_path = os.path.dirname(os.path.realpath(__file__))
|
||||||
return [
|
return [
|
||||||
os.path.abspath(get_plugins_persistent_path()),
|
os.path.abspath(get_plugins_persistent_path()),
|
||||||
os.path.abspath(os.path.join(current_path, "..", "..", "plugins")),
|
os.path.abspath(os.path.join(current_path, "..", "..", "coreplugins")),
|
||||||
]
|
]
|
||||||
|
|
||||||
def get_plugins_persistent_path(*paths):
|
def get_plugins_persistent_path(*paths):
|
||||||
|
|
|
@ -131,7 +131,11 @@ class PluginBase(ABC):
|
||||||
:param path: unix-style path
|
:param path: unix-style path
|
||||||
:return: path used to reference Django templates for a plugin
|
:return: path used to reference Django templates for a plugin
|
||||||
"""
|
"""
|
||||||
return "plugins/{}/templates/{}".format(self.get_name(), path)
|
if self.is_persistent():
|
||||||
|
return "coreplugins/{}/templates/{}".format(self.get_name(), path)
|
||||||
|
else:
|
||||||
|
return "plugins/{}/templates/{}".format(self.get_name(), path)
|
||||||
|
|
||||||
|
|
||||||
def path_exists(self, path):
|
def path_exists(self, path):
|
||||||
return os.path.exists(self.get_path(path))
|
return os.path.exists(self.get_path(path))
|
||||||
|
|
Przed Szerokość: | Wysokość: | Rozmiar: 1.6 KiB Po Szerokość: | Wysokość: | Rozmiar: 1.6 KiB |
|
@ -19,7 +19,7 @@ def upload_to_ion(
|
||||||
from shutil import rmtree
|
from shutil import rmtree
|
||||||
from enum import Enum
|
from enum import Enum
|
||||||
from app.plugins import logger
|
from app.plugins import logger
|
||||||
from plugins.cesiumion.api_views import (
|
from .api_views import (
|
||||||
get_asset_info,
|
get_asset_info,
|
||||||
set_asset_info,
|
set_asset_info,
|
||||||
AssetType,
|
AssetType,
|
||||||
|
@ -28,11 +28,11 @@ def upload_to_ion(
|
||||||
ASSET_TO_FILE,
|
ASSET_TO_FILE,
|
||||||
pluck,
|
pluck,
|
||||||
)
|
)
|
||||||
from plugins.cesiumion.model_tools import (
|
from .model_tools import (
|
||||||
to_ion_texture_model,
|
to_ion_texture_model,
|
||||||
IonInvalidZip,
|
IonInvalidZip,
|
||||||
)
|
)
|
||||||
from plugins.cesiumion.globals import ION_API_URL
|
from .globals import ION_API_URL
|
||||||
class LoggerAdapter(logging.LoggerAdapter):
|
class LoggerAdapter(logging.LoggerAdapter):
|
||||||
def __init__(self, prefix, logger):
|
def __init__(self, prefix, logger):
|
||||||
super().__init__(logger, {})
|
super().__init__(logger, {})
|
Przed Szerokość: | Wysokość: | Rozmiar: 1.1 KiB Po Szerokość: | Wysokość: | Rozmiar: 1.1 KiB |
|
@ -1,6 +1,6 @@
|
||||||
from abc import ABC, abstractmethod
|
from abc import ABC, abstractmethod
|
||||||
from app.plugins import get_current_plugin
|
from app.plugins import get_current_plugin
|
||||||
from .cloud_platform import CloudPlatform
|
from coreplugins.cloudimport.cloud_platform import CloudPlatform
|
||||||
|
|
||||||
class PlatformExtension(CloudPlatform):
|
class PlatformExtension(CloudPlatform):
|
||||||
"""A platform extension is a platform with extra capacities. It may require extra configuration, or it might provide new features."""
|
"""A platform extension is a platform with extra capacities. It may require extra configuration, or it might provide new features."""
|
|
@ -28,7 +28,7 @@ def read_platform_from_files():
|
||||||
# Each python script must have a class called Platform
|
# Each python script must have a class called Platform
|
||||||
# Instantiate the platform
|
# Instantiate the platform
|
||||||
try:
|
try:
|
||||||
module_path = "plugins.cloudimport.platforms.{}".format(path.splitext(platform_script)[0])
|
module_path = "coreplugins.cloudimport.platforms.{}".format(path.splitext(platform_script)[0])
|
||||||
module = importlib.import_module(module_path)
|
module = importlib.import_module(module_path)
|
||||||
platform = (getattr(module, "Platform"))()
|
platform = (getattr(module, "Platform"))()
|
||||||
platforms.append(platform)
|
platforms.append(platform)
|
|
@ -1,7 +1,7 @@
|
||||||
# Check https://github.com/
|
# Check https://github.com/
|
||||||
from urllib.parse import urlparse
|
from urllib.parse import urlparse
|
||||||
from os import path
|
from os import path
|
||||||
from plugins.cloudimport.cloud_platform import File, Folder, CloudPlatform
|
from coreplugins.cloudimport.cloud_platform import File, Folder, CloudPlatform
|
||||||
from app.plugins import logger
|
from app.plugins import logger
|
||||||
|
|
||||||
class Platform(CloudPlatform):
|
class Platform(CloudPlatform):
|
|
@ -1,8 +1,8 @@
|
||||||
# Check http://piwigo.com/
|
# Check http://piwigo.com/
|
||||||
from urllib.parse import urlparse
|
from urllib.parse import urlparse
|
||||||
from os import path
|
from os import path
|
||||||
from plugins.cloudimport.cloud_platform import File, Folder
|
from coreplugins.cloudimport.cloud_platform import File, Folder
|
||||||
from plugins.cloudimport.extensions.cloud_library import CloudLibrary
|
from coreplugins.cloudimport.extensions.cloud_library import CloudLibrary
|
||||||
|
|
||||||
class Platform(CloudLibrary):
|
class Platform(CloudLibrary):
|
||||||
def __init__(self):
|
def __init__(self):
|
Przed Szerokość: | Wysokość: | Rozmiar: 3.3 KiB Po Szerokość: | Wysokość: | Rozmiar: 3.3 KiB |
Some files were not shown because too many files have changed in this diff Show More
Ładowanie…
Reference in New Issue