Skip to content

Commit

Permalink
code added to get theme
Browse files Browse the repository at this point in the history
  • Loading branch information
marianoguerra committed Nov 11, 2009
1 parent 24081b2 commit ff39dca
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions Themes.py
@@ -1,5 +1,6 @@
'''a module to handle themes'''
import os
import glob

import Theme

Expand Down Expand Up @@ -56,12 +57,24 @@ def add_themes_path(self, path):
def list(self):
'''return a list of all the available themes
'''
pass
themes = []

def get(self, theme):
for path in self.paths:
themes += glob.glob(os.path.join(path, "*.AdiumMessageStyle")

return themes

def get(self, theme_path):
'''return a Theme object instance
returs True, theme_instance if the validation was ok
False, reason if some validation failed
'''
pass
status, message = self.validate(self, theme_path)

if not status:
return status, message

return True, Theme.Theme(theme_path)

def validate(self, theme_path):
'''validate a Theme directory structure
Expand Down

0 comments on commit ff39dca

Please sign in to comment.