-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Get theme names from the file system
- Loading branch information
1 parent
4420328
commit f73bf8e
Showing
5 changed files
with
26 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import os | ||
import sys | ||
|
||
def GetResourcePath(relative_path): | ||
if hasattr(sys, "_MEIPASS"): | ||
return os.path.join(sys._MEIPASS, relative_path) | ||
return os.path.join(os.path.abspath("."), relative_path) | ||
|
||
def GetThemeNames(): | ||
themes = [] | ||
theme_path = GetResourcePath("theme") | ||
for file in os.listdir(theme_path): | ||
if file.endswith(".qss"): | ||
theme_name = os.path.splitext(file)[0] | ||
themes.append(theme_name) | ||
|
||
themes.sort() | ||
return themes | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters