Update app.py
Browse files
app.py
CHANGED
|
@@ -104,14 +104,21 @@ def update_category_dd(standard, version):
|
|
| 104 |
for t in tables:
|
| 105 |
if t == main_t:
|
| 106 |
continue
|
| 107 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 108 |
choices.append(f"{short_name}")
|
| 109 |
|
| 110 |
conn.close()
|
| 111 |
|
| 112 |
except Exception as e:
|
| 113 |
-
# ์๋ฌ ๋ฐ์ ์ ์ฝ์์ ์ถ๋ ฅํ์ฌ ๋๋ฒ๊น
๊ฐ๋ฅํ๊ฒ ์์
|
| 114 |
print(f"[Error in update_category_dd] standard: {standard}, version: {version}")
|
|
|
|
| 115 |
traceback.print_exc()
|
| 116 |
|
| 117 |
return gr.Dropdown(choices=choices)
|
|
|
|
| 104 |
for t in tables:
|
| 105 |
if t == main_t:
|
| 106 |
continue
|
| 107 |
+
|
| 108 |
+
# ๐ ์์ ๋ ๋ถ๋ถ: ์ ๊ท์์ ์ฌ์ฉํด ๋์๋ฌธ์, ์ธ๋๋ฐ(_), ๊ณต๋ฐฑ ๋ฌด์ํ๊ณ ์ ๋์ฌ ๊น๋ํ๊ฒ ์ ๊ฑฐ
|
| 109 |
+
prefix_pattern = f"^{standard}[_\\s-]*{version}[_\\s-]*"
|
| 110 |
+
short_name = re.sub(prefix_pattern, "", t, flags=re.IGNORECASE)
|
| 111 |
+
|
| 112 |
+
# ๋ง์ฝ ํ
์ด๋ธ ์ด๋ฆ์ ๋จ์ ํน์๋ฌธ์๋ ๊ณต๋ฐฑ์ด ๋ณด๊ธฐ ์ซ๋ค๋ฉด ํ ๋ฒ ๋ ์ ๋ฆฌ
|
| 113 |
+
short_name = short_name.strip()
|
| 114 |
+
|
| 115 |
choices.append(f"{short_name}")
|
| 116 |
|
| 117 |
conn.close()
|
| 118 |
|
| 119 |
except Exception as e:
|
|
|
|
| 120 |
print(f"[Error in update_category_dd] standard: {standard}, version: {version}")
|
| 121 |
+
import traceback
|
| 122 |
traceback.print_exc()
|
| 123 |
|
| 124 |
return gr.Dropdown(choices=choices)
|