Add environment configuration, some fixes in main.py (size).

This commit is contained in:
2026-03-10 01:03:29 +03:00
parent 5505a521ff
commit 096efb7929
4 changed files with 85 additions and 20 deletions
+20 -11
View File
@@ -111,7 +111,7 @@ class MainWindow(QMainWindow):
# You must call the super class method
QMainWindow.__init__(self)
self.setMinimumSize(QSize(480, 80)) # Set sizes
self.setMinimumSize(QSize(640, 480)) # Set sizes
self.setWindowTitle("postgre") # Set the window title
central_widget = QWidget(self) # Create a central widget
self.setCentralWidget(central_widget) # Install the central widget
@@ -202,7 +202,14 @@ class NeoWindow(QWidget):
if __name__ == "__main__":
import sys
conn = psycopg2.connect("user=postgres password=456 host=localhost port=5432")
conn = psycopg2.connect(
"user={0} password={1} host={2} port={3}".format(
POSTGRES_USER,
POSTGRES_PASS,
POSTGRES_HOST,
POSTGRES_PORT,
)
)
createuUiversityDB(conn)
@@ -222,15 +229,17 @@ if __name__ == "__main__":
mw.load_data(users)
mw.show()
URI = NEO_HOST
AUTH = (NEO_USER, NEO_PASS)
if os.getenv('NEO_ACTIVE') == 'true':
URI = NEO_HOST
AUTH = (NEO_USER, NEO_PASS)
with GraphDatabase.driver(URI, auth=AUTH) as driver:
records, summary, keys = driver.execute_query(
"MATCH (nineties:Movie) WHERE nineties.released >= 1990 AND nineties.released < 2000 RETURN nineties"
)
with GraphDatabase.driver(URI, auth=AUTH) as driver:
records, summary, keys = driver.execute_query(
"MATCH (nineties:Movie) WHERE nineties.released >= 1990 AND nineties.released < 2000 RETURN nineties"
)
neo_window = NeoWindow(mw)
neo_window.load_data(records)
neo_window.show()
neo_window = NeoWindow(mw)
neo_window.load_data(records)
neo_window.show()
sys.exit(app.exec())