diff --git a/components/api/api-modules-python/src/main/resources/META-INF/dirigible/python-modules/dirigible/core/__init__.py b/components/api/api-modules-python/src/main/resources/META-INF/dirigible/python-modules/dirigible/core/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/components/api/api-modules-python/src/main/resources/META-INF/dirigible/python-modules/dirigible/core/configurations.py b/components/api/api-modules-python/src/main/resources/META-INF/dirigible/python-modules/dirigible/core/configurations.py new file mode 100644 index 00000000000..1fa5a749387 --- /dev/null +++ b/components/api/api-modules-python/src/main/resources/META-INF/dirigible/python-modules/dirigible/core/configurations.py @@ -0,0 +1,63 @@ +# Copyright (c) 2023 SAP SE or an SAP affiliate company and Eclipse Dirigible contributors +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Eclipse Public License v2.0 +# which accompanies this distribution, and is available at +# http://www.eclipse.org/legal/epl-v20.html +# SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and Eclipse Dirigible contributors +# SPDX-License-Identifier: EPL-2.0 + +import java + +Configuration = java.type('org.eclipse.dirigible.commons.config') + +class Configurations: + + @staticmethod + def get(key, defaultValue=None): + if defaultValue is not None: + return Configuration.get(key, defaultValue) + return Configuration.get(key) + + @staticmethod + def set(key, value): + Configuration.set(key, value) + + @staticmethod + def remove(key): + Configuration.remove(key) + + @staticmethod + def getKeys(): + keys = [] + keysAsArray = Configuration.getKeys() + for i in range(len(keysAsArray)): + keys.append(keysAsArray[i]) + return keys + + @staticmethod + def load(path): + Configuration.load(path) + + @staticmethod + def update(): + Configuration.update() + + @staticmethod + def getOS(): + return Configuration.getOS() + + @staticmethod + def isOSWindows(): + return Configuration.isOSWindows() + + @staticmethod + def isOSMac(): + return Configuration.isOSMac() + + @staticmethod + def isOSUNIX(): + return Configuration.isOSUNIX() + + @staticmethod + def isOSSolaris(): + return Configuration.isOSSolaris() diff --git a/components/api/api-modules-python/src/main/resources/META-INF/dirigible/python-modules/dirigible/core/context.py b/components/api/api-modules-python/src/main/resources/META-INF/dirigible/python-modules/dirigible/core/context.py new file mode 100644 index 00000000000..6df59670582 --- /dev/null +++ b/components/api/api-modules-python/src/main/resources/META-INF/dirigible/python-modules/dirigible/core/context.py @@ -0,0 +1,20 @@ +# Copyright (c) 2023 SAP SE or an SAP affiliate company and Eclipse Dirigible contributors +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Eclipse Public License v2.0 +# which accompanies this distribution, and is available at +# http://www.eclipse.org/legal/epl-v20.html +# SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and Eclipse Dirigible contributors +# SPDX-License-Identifier: EPL-2.0 + + +import java +ContextFacade = java.type('org.eclipse.dirigible.components.api.core') + +class Context: + @staticmethod + def get(name): + return ContextFacade.get(name) + + @staticmethod + def set(name, value): + ContextFacade.set(name, value) diff --git a/components/api/api-modules-python/src/main/resources/META-INF/dirigible/python-modules/dirigible/core/env.py b/components/api/api-modules-python/src/main/resources/META-INF/dirigible/python-modules/dirigible/core/env.py new file mode 100644 index 00000000000..893e39bca20 --- /dev/null +++ b/components/api/api-modules-python/src/main/resources/META-INF/dirigible/python-modules/dirigible/core/env.py @@ -0,0 +1,20 @@ + +# Copyright (c) 2023 SAP SE or an SAP affiliate company and Eclipse Dirigible contributors +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Eclipse Public License v2.0 +# which accompanies this distribution, and is available at +# http://www.eclipse.org/legal/epl-v20.html +# SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and Eclipse Dirigible contributors +# SPDX-License-Identifier: EPL-2.0 + +import java +EnvFacade = java.type('org.eclipse.dirigible.components.api.core') + +class Env: + @staticmethod + def get(name): + return EnvFacade.get(name) + + @staticmethod + def list(): + return EnvFacade.list() diff --git a/components/api/api-modules-python/src/main/resources/META-INF/dirigible/python-modules/dirigible/core/globals.py b/components/api/api-modules-python/src/main/resources/META-INF/dirigible/python-modules/dirigible/core/globals.py new file mode 100644 index 00000000000..b200c068891 --- /dev/null +++ b/components/api/api-modules-python/src/main/resources/META-INF/dirigible/python-modules/dirigible/core/globals.py @@ -0,0 +1,25 @@ +# Copyright (c) 2023 SAP SE or an SAP affiliate company and Eclipse Dirigible contributors +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Eclipse Public License v2.0 +# which accompanies this distribution, and is available at +# http://www.eclipse.org/legal/epl-v20.html +# SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and Eclipse Dirigible contributors +# SPDX-License-Identifier: EPL-2.0 + + +import java +GlobalsFacade = java.type('org.eclipse.dirigible.components.api.core') + + +class Globals: + @staticmethod + def get(name): + return GlobalsFacade.get(name) + + @staticmethod + def set(name, value): + GlobalsFacade.set(name, value) + + @staticmethod + def list(): + return GlobalsFacade.list()