Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes14kdownloads
constants.py143 linesDownload Raw Back to utils
1##########################################################################2#3# pgAdmin 4 - PostgreSQL Tools4#5# Copyright (C) 2013 - 2024, The pgAdmin Development Team6# This software is released under the PostgreSQL Licence7#8##########################################################################9 10"""Application wide constants."""11from flask_babel import gettext12 13# Mimetypes14MIMETYPE_APP_HTML = 'text/html'15MIMETYPE_APP_JS = 'application/javascript'16MIMETYPE_APP_JSON = 'application/json'17 18# Preference labels19PREF_LABEL_KEYBOARD_SHORTCUTS = gettext('Keyboard shortcuts')20PREF_LABEL_DISPLAY = gettext('Display')21PREF_LABEL_BREADCRUMBS = gettext('Object Breadcrumbs')22PREF_LABEL_OPTIONS = gettext('Options')23PREF_LABEL_EXPLAIN = gettext('Explain')24PREF_LABEL_EDITOR = gettext('Editor')25PREF_LABEL_CSV_TXT = gettext('CSV/TXT Output')26PREF_LABEL_RESULTS_GRID = gettext('Results grid')27PREF_LABEL_SQL_FORMATTING = gettext('SQL formatting')28PREF_LABEL_TABS_SETTINGS = gettext('Tab settings')29PREF_LABEL_REFRESH_RATES = gettext('Refresh rates')30PREF_LABEL_GRAPH_VISUALISER = gettext('Graph Visualiser')31 32PGADMIN_STRING_SEPARATOR = '_$PGADMIN$_'33PGADMIN_NODE = 'pgadmin.node.%s'34UNAUTH_REQ = "Unauthorized request."35SERVER_CONNECTION_CLOSED = gettext(36    'Not connected to server or connection with the server has been closed.')37 38# Query tool placeholder39QT_DEFAULT_PLACEHOLDER = '%DATABASE%/%USERNAME%@%SERVER%'40VW_EDT_DEFAULT_PLACEHOLDER = '%SCHEMA%.%TABLE%/%DATABASE%/%USERNAME%@%SERVER%'41 42# Data Types43DATATYPE_TIME_WITH_TIMEZONE = 'time with time zone'44DATATYPE_TIME_WITHOUT_TIMEZONE = 'time without time zone'45 46DATATYPE_TIMESTAMP_WITH_TIMEZONE = 'timestamp with time zone'47DATATYPE_TIMESTAMP_WITHOUT_TIMEZONE = 'timestamp without time zone'48 49# Error Messages50ERROR_MSG_TRANS_ID_NOT_FOUND = gettext(51    'Transaction ID not found in the session.')52 53ERROR_MSG_FAIL_TO_PROMOTE_QT = gettext('FAIL TO PROMOTE VIEW/EDIT DATA '54                                       'TO QUERY TOOL')55 56# Role module constant57ERROR_FETCHING_ROLE_INFORMATION = gettext(58    'Error fetching role information from the database server.')59 60ERROR_FETCHING_DATA = gettext('Unable to fetch data.')61 62# Authentication Sources63INTERNAL = 'internal'64LDAP = 'ldap'65KERBEROS = 'kerberos'66OAUTH2 = 'oauth2'67WEBSERVER = 'webserver'68 69SUPPORTED_AUTH_SOURCES = [INTERNAL,70                          LDAP,71                          KERBEROS,72                          OAUTH2,73                          WEBSERVER]74 75BINARY_PATHS = {76    "as_bin_paths": [77        {"version": "120000", "next_major_version": "130000",78         "serverType": gettext("EDB Advanced Server 12"), "binaryPath": None,79         "isDefault": False},80        {"version": "130000", "next_major_version": "140000",81         "serverType": gettext("EDB Advanced Server 13"), "binaryPath": None,82         "isDefault": False},83        {"version": "140000", "next_major_version": "150000",84         "serverType": gettext("EDB Advanced Server 14"), "binaryPath": None,85         "isDefault": False},86        {"version": "150000", "next_major_version": "160000",87         "serverType": gettext("EDB Advanced Server 15"), "binaryPath": None,88         "isDefault": False},89        {"version": "160000", "next_major_version": "170000",90         "serverType": gettext("EDB Advanced Server 16"), "binaryPath": None,91         "isDefault": False}92    ],93    "pg_bin_paths": [94        {"version": "120000", "next_major_version": "130000",95         "serverType": gettext("PostgreSQL 12"), "binaryPath": None,96         "isDefault": False},97        {"version": "130000", "next_major_version": "140000",98         "serverType": gettext("PostgreSQL 13"), "binaryPath": None,99         "isDefault": False},100        {"version": "140000", "next_major_version": "150000",101         "serverType": gettext("PostgreSQL 14"), "binaryPath": None,102         "isDefault": False},103        {"version": "150000", "next_major_version": "160000",104         "serverType": gettext("PostgreSQL 15"), "binaryPath": None,105         "isDefault": False},106        {"version": "160000", "next_major_version": "170000",107         "serverType": gettext("PostgreSQL 16"), "binaryPath": None,108         "isDefault": False}109    ]110}111 112UTILITIES_ARRAY = ['pg_dump', 'pg_dumpall', 'pg_restore', 'psql']113 114ENTER_EMAIL_ADDRESS = "Email address: "115USER_NOT_FOUND = gettext("The specified user ID (%s) could not be found.")116DATABASE_LAST_SYSTEM_OID = 16383117 118# Drivers119PSYCOPG3 = 'psycopg3'120 121# Shared storage122MY_STORAGE = 'my_storage'123ACCESS_DENIED_MESSAGE = gettext(124    "Access denied: You’re having limited access. You’re not allowed to "125    "Rename, Delete or Create any files/folders")126 127 128KEY_RING_SERVICE_NAME = 'pgAdmin4'129KEY_RING_USERNAME_FORMAT = KEY_RING_SERVICE_NAME + '-{0}-{1}'130KEY_RING_TUNNEL_FORMAT = KEY_RING_SERVICE_NAME + '-tunnel-{0}-{1}'131KEY_RING_DESKTOP_USER = KEY_RING_SERVICE_NAME + '-desktop-user-{0}'132 133 134class MessageType:135    SUCCESS = 'Success',136    ERROR = 'Error',137    INFO = 'Info',138    CLOSE = 'Close',139    WARNING = 'Warning'140 141 142DBMS_JOB_SCHEDULER_ID = 999999143 
codekingpro/portable-devtools · Team Ai