# -*- coding: utf-8 -*-


class Theme(object):
	def __init__(self, ext, theme):
		pass

@@ -18,16 +18,34 @@
 -8 -*-%0A%0A
+import importlib%0A%0A
 %0Aclass T
@@ -97,9 +97,1293 @@
 :%0A%09%09
-pas
+self.segments = %5B%5D%0A%0A%09%09for side in %5B'left', 'right'%5D:%0A%09%09%09for segment in theme%5B'segments'%5D.get(side, %5B%5D):%0A%09%09%09%09contents = None%0A%09%09%09%09segment_type = segment.get('type', 'function')%0A%0A%09%09%09%09if segment_type == 'function':%0A%09%09%09%09%09# Import segment function and assign it to the contents%0A%09%09%09%09%09function_module = 'powerline.ext.%7B0%7D.segments'.format(ext)%0A%09%09%09%09%09function_name = segment%5B'name'%5D%0A%09%09%09%09%09contents = getattr(importlib.import_module(function_module), function_name)%0A%09%09%09%09elif segment_type == 'string':%0A%09%09%09%09%09contents = segment.get('contents')%0A%09%09%09%09elif segment_type == 'filler':%0A%09%09%09%09%09pass%0A%09%09%09%09else:%0A%09%09%09%09%09raise TypeError('Unknown segment type: %7B0%7D'.format(segment_type))%0A%0A%09%09%09%09self.segments.append(%7B%0A%09%09%09%09%09'type': segment_type,%0A%09%09%09%09%09'highlight': segment.get('highlight', segment.get('name')),%0A%09%09%09%09%09'before': segment.get('before'),%0A%09%09%09%09%09'after': segment.get('after'),%0A%09%09%09%09%09'contents': contents,%0A%09%09%09%09%09'args': segment.get('args', %7B%7D),%0A%09%09%09%09%09'ljust': segment.get('ljust', False),%0A%09%09%09%09%09'rjust': segment.get('rjust', False),%0A%09%09%09%09%09'priority': segment.get('priority', -1),%0A%09%09%09%09%09'draw_divider': segment.get('draw_divider', True),%0A%09%09%09%09%09'side': side,%0A%09%09%09%09%09'exclude_modes': segment.get('exclude_modes', %5B%5D),%0A%09%09%09%09%09'include_modes': segment.get('include_modes', %5B%5D),%0A%09%09%09%09%7D)%0A%0A%09def get_segments(self):%0A%09%09return self.segment
 s%0A

Create theme loading class