mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Added capability to deploy PostgreSQL servers on Amazon RDS. Fixes #7177
This commit is contained in:
committed by
Akshay Joshi
parent
b89e306df0
commit
e61a1045f5
38
web/pgacloud/utils/io.py
Normal file
38
web/pgacloud/utils/io.py
Normal file
@@ -0,0 +1,38 @@
|
||||
##########################################################################
|
||||
#
|
||||
# pgAdmin 4 - PostgreSQL Tools
|
||||
#
|
||||
# Copyright (C) 2013 - 2022, The pgAdmin Development Team
|
||||
# This software is released under the PostgreSQL Licence
|
||||
#
|
||||
##########################################################################
|
||||
|
||||
import datetime
|
||||
import json
|
||||
import sys
|
||||
import time
|
||||
|
||||
|
||||
def debug(args, message):
|
||||
""" Print a debug message """
|
||||
if not args.debug:
|
||||
return
|
||||
|
||||
now = datetime.datetime.now()
|
||||
|
||||
print('[{}]: {}'.format(now.strftime("%H:%M:%S"), message),
|
||||
file=sys.stderr, flush=True)
|
||||
|
||||
|
||||
def error(args, message):
|
||||
""" Print an error message and exit """
|
||||
debug(args, message)
|
||||
|
||||
output({'error': message})
|
||||
|
||||
sys.exit(1)
|
||||
|
||||
|
||||
def output(data):
|
||||
""" Dump JSON output from a dict """
|
||||
print(json.dumps(data), flush=True)
|
||||
Reference in New Issue
Block a user