Last active
January 7, 2017 23:28
-
-
Save cofi89/2a9931c9e3ec630366f6a68a5577ec59 to your computer and use it in GitHub Desktop.
Git-Cola "icons_dir" prototype ( absolute + ~/.config/git-cola/icons check )
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
def icon_dir(theme=None): | |
"""Return the path to the style dir within the cola install tree.""" | |
if theme: | |
theme_final_dir = None | |
theme_absolute_dir = None | |
try: | |
theme_absolute_dir = os.path.expanduser(theme) | |
theme_final_dir = os.path.isdir(theme_absolute_dir) | |
except TypeError: | |
pass | |
if theme_final_dir: | |
return theme_final_dir | |
theme_home_dir = config_home('icons', theme) | |
theme_share_dir = share('icons', theme) | |
if os.path.isdir(theme_home_dir): | |
return theme_home_dir | |
elif os.path.isdir(theme_share_dir): | |
return theme_share_dir | |
else: | |
return share('icons') | |
else: | |
return share('icons') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment