Skip to content

Commit

Permalink
reading sprite config with project level
Browse files Browse the repository at this point in the history
  • Loading branch information
adyliu committed Feb 24, 2014
1 parent 13357a8 commit c9e654d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
5 changes: 5 additions & 0 deletions glue/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ def clean(value):
return {}
return dict([[k, clean(config.get(section, k))] for k in keys])

class ProjectConfig(ConfigurableFromFile):
def __init__(self,config_path):
self.config_path = config_path
def items(self):
return self._get_config_from_file('sprite.conf','sprite')

class Image(ConfigurableFromFile):

Expand Down
4 changes: 3 additions & 1 deletion glue/managers/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from glue.exceptions import NoSpritesFoldersFoundError
from .base import BaseManager

from glue.core import ProjectConfig

class ProjectManager(BaseManager):
"""Process a path searching for folders that contain images.
Expand All @@ -12,6 +12,8 @@ class ProjectManager(BaseManager):

def find_sprites(self):

self.config.update( ProjectConfig(self.config['source']).items() )

for filename in sorted(os.listdir(self.config['source'])):

# Only process folders
Expand Down

0 comments on commit c9e654d

Please sign in to comment.