2022-03-05 16:20:37 +00:00
|
|
|
pkg/pip/setup_pip.py | 5 ++++-
|
|
|
|
web/setup.py | 14 ++++++++------
|
|
|
|
2 files changed, 12 insertions(+), 7 deletions(-)
|
|
|
|
|
|
|
|
diff --git a/pkg/pip/setup_pip.py b/pkg/pip/setup_pip.py
|
|
|
|
index 5592d1b04..131eaa1ed 100644
|
|
|
|
--- a/pkg/pip/setup_pip.py
|
|
|
|
+++ b/pkg/pip/setup_pip.py
|
|
|
|
@@ -95,7 +95,10 @@ setup(
|
|
|
|
},
|
|
|
|
|
|
|
|
entry_points={
|
|
|
|
- 'console_scripts': ['pgadmin4=pgadmin4.pgAdmin4:main'],
|
|
|
|
+ 'console_scripts': [
|
|
|
|
+ 'pgadmin4=pgadmin4.pgAdmin4:main',
|
|
|
|
+ 'pgadmin4-setup=pgadmin4.setup:main'
|
|
|
|
+ ],
|
|
|
|
},
|
|
|
|
|
|
|
|
)
|
|
|
|
diff --git a/web/setup.py b/web/setup.py
|
2022-08-12 12:06:08 +00:00
|
|
|
index 2204ffb..d5fda9f 100644
|
2022-03-05 16:20:37 +00:00
|
|
|
--- a/web/setup.py
|
|
|
|
+++ b/web/setup.py
|
2022-08-12 12:06:08 +00:00
|
|
|
@@ -14,7 +14,6 @@ import argparse
|
|
|
|
import os
|
|
|
|
import sys
|
|
|
|
import builtins
|
|
|
|
-import config
|
|
|
|
|
|
|
|
# Grab the SERVER_MODE if it's been set by the runtime
|
|
|
|
if 'SERVER_MODE' in globals():
|
|
|
|
@@ -91,6 +90,9 @@ def load_servers(args):
|
|
|
|
def setup_db(app):
|
|
|
|
"""Setup the configuration database."""
|
|
|
|
|
|
|
|
+ # here we need an additional import, since the call to setup_db changed
|
|
|
|
+ # https://redmine.postgresql.org/projects/pgadmin4/repository/2/revisions/3a69d50458f57d19948b867aec55c55d635a36e5/diff/web/setup.py
|
|
|
|
+ import config
|
|
|
|
create_app_data_directory(config)
|
|
|
|
|
|
|
|
print("pgAdmin 4 - Application Initialisation")
|
|
|
|
@@ -139,8 +141,9 @@ def clear_servers():
|
2022-03-05 16:20:37 +00:00
|
|
|
clear_database_servers(load_user, True)
|
2022-08-12 12:06:08 +00:00
|
|
|
|
|
|
|
|
2022-03-05 16:20:37 +00:00
|
|
|
-if __name__ == '__main__':
|
|
|
|
+def main():
|
2022-08-12 12:06:08 +00:00
|
|
|
# Configuration settings
|
|
|
|
+ import config
|
2022-03-05 16:20:37 +00:00
|
|
|
parser = argparse.ArgumentParser(description='Setup the pgAdmin config DB')
|
2022-08-12 12:06:08 +00:00
|
|
|
|
2022-03-05 16:20:37 +00:00
|
|
|
exp_group = parser.add_argument_group('Dump server config')
|
2022-08-12 12:06:08 +00:00
|
|
|
@@ -191,3 +194,6 @@ if __name__ == '__main__':
|
2022-03-05 16:20:37 +00:00
|
|
|
else:
|
2022-08-12 12:06:08 +00:00
|
|
|
app = create_app()
|
|
|
|
setup_db(app)
|
2022-03-05 16:20:37 +00:00
|
|
|
+
|
|
|
|
+if __name__ == '__main__':
|
|
|
|
+ main()
|