Repository navigation
Expand file tree
/
Copy pathmain.py
More file actions
137 lines (111 loc) · 4.21 KB
/
Copy pathmain.py
File metadata and controls
137 lines (111 loc) · 4.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
import os
import ssl
# SSL certificate paths to try (in order)
_CERT_PATHS = [
"/etc/ssl/certs/ca-certificates.crt", # Debian/Ubuntu
"/etc/pki/tls/certs/ca-bundle.crt", # RHEL/CentOS
"/etc/ssl/ca-bundle.pem", # OpenSUSE
"/etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem", # Fedora
]
def _find_cert_file():
"""Find working SSL certificate file."""
# Try certifi first (works in most PyInstaller bundles)
try:
import certifi
cert_path = certifi.where()
if os.path.exists(cert_path):
# Test if it actually works
ctx = ssl.create_default_context()
ctx.load_verify_locations(cert_path)
return cert_path
except Exception:
pass
# Fallback to system certificates
for path in _CERT_PATHS:
if os.path.exists(path):
return path
return None
_cert_file = _find_cert_file()
if _cert_file:
os.environ.setdefault("SSL_CERT_FILE", _cert_file)
os.environ.setdefault("SSL_CERT_DIR", os.path.dirname(_cert_file))
def _create_ssl_context():
ctx = ssl.create_default_context()
ctx.load_verify_locations(_cert_file)
return ctx
ssl._create_default_https_context = _create_ssl_context
from textual.app import App
from tui import ProjectBoardTree
class PlankaApp(App):
# Inline CSS — PyInstaller breaks CSS_PATH resolution in onefile mode
CSS = """
Screen { background: #0d1117; }
Header { background: #161b22; color: #58a6ff; text-style: bold; }
Footer { background: #161b22; color: #6e7681; }
#dashboard_container {
width: 100%; height: 100%; align: center middle;
background: #0d1117;
}
.dashboard_logo {
width: 64; text-align: center;
color: #58a6ff; text-style: bold; padding: 1 0;
}
#project_tree {
width: 64; height: auto; max-height: 80%;
background: #161b22; border: round #30363d; padding: 1 2; margin: 0;
}
Tree > .tree--cursor { background: #1f6feb 60%; color: #e6edf3; text-style: bold; }
#board {
height: 1fr; width: 100%;
overflow-x: auto; background: #0d1117; padding: 0 1;
}
#loading { width: 100%; height: 1fr; color: #388bfd; }
.list_col {
width: 1fr; min-width: 20;
height: 100%; margin: 0 1 0 0; padding: 0;
background: #161b22; border: tall #21262d;
scrollbar-size: 1 1; scrollbar-color: #21262d;
scrollbar-color-hover: #388bfd;
}
.list_col:focus-within { border: tall #388bfd; }
.list_header {
width: 100%; height: 1; padding: 0 1;
background: #21262d; color: #c9d1d9;
text-style: bold; overflow: hidden;
}
.list_col:focus-within .list_header { background: #1f3a6e; color: #79c0ff; }
.card {
width: 100%; height: 1; min-height: 1; max-height: 1;
padding: 0 2; color: #8b949e;
background: transparent; overflow: hidden hidden;
}
.card:hover { color: #c9d1d9; background: #1c2128; }
.card:focus { color: #e6edf3; background: #1a2744; text-style: bold; }
ModalScreen { align: center middle; background: #010409 80%; }
.modal_box {
width: 60; max-width: 85%; height: auto;
padding: 1 2 2 2; background: #161b22; border: round #388bfd;
}
.detail_box { width: 76; max-height: 70%; }
.modal_title {
width: 100%; text-align: center; color: #e6edf3; text-style: bold;
padding: 0 0 1 0; border-bottom: solid #21262d; margin-bottom: 1;
}
.modal_body {
width: 100%; height: auto; max-height: 24;
overflow-y: auto; color: #8b949e; padding: 0 0 1 0;
}
.modal_input { margin: 1 0; border: round #30363d; background: #0d1117; }
.modal_input:focus { border: round #388bfd; }
.modal_row { width: 100%; height: auto; align: center middle; margin-top: 1; }
.modal_row Button { margin: 0 1; min-width: 12; }
Input { border: round #30363d; background: #0d1117; margin: 1 0; }
Input:focus { border: round #388bfd; }
LoadingIndicator { color: #388bfd; background: #0d1117; }
"""
BINDINGS = [("q", "quit", "Quit")]
def on_mount(self) -> None:
self.push_screen(ProjectBoardTree())
if __name__ == "__main__":
app = PlankaApp()
app.run()