Ejemplo n.º 1
0
 def get_prop_stack(self):
     stack = self.prop_stack
     if not self.style.IsEmpty():
         stack.load_AddStyle(self.style)
     stack.condense()
     if self.base_style is not None:
         self.prop_stack = PropertyStack(base=self.base_style.Duplicate())
     else:
         self.prop_stack = PropertyStack()
     self.style = Style()
     return stack
Ejemplo n.º 2
0
 def __init__(self, file, filename, match):
     LoaderWithComposites.__init__(self)
     self.file = file
     self.filename = filename
     self.match = match
     self.style = Style()
     if self.base_style is not None:
         self.prop_stack = PropertyStack(base=self.base_style.Duplicate())
     else:
         self.prop_stack = PropertyStack()
     self.messages = {}
Ejemplo n.º 3
0
    def do_load(self):
        self.model = None
        self.fileptr.readline()
        self.style = Style()
        while True:
            self.line = self.fileptr.readline()
            if not self.line: break
            self.line = self.line.rstrip('\r\n')

            self.check_loading()

            if self.line:
                try:
                    code = compile('self.' + self.line, '<string>', 'exec')
                    exec code
                except:
                    print 'error>>', self.line
                    errtype, value, traceback = sys.exc_info()
                    print errtype, value, traceback
Ejemplo n.º 4
0
	def do_load(self):
		self.file.readline()
		self.style = Style()
		while True:
			self.line = self.file.readline()
			if not self.line: break
			self.line = self.line.rstrip('\r\n')
			position = float(self.file.tell()) / float(self.file_size) * 0.95
			if position - self.position > 0.01:
				self.position = position
				msg = _('Parsing in process...')
				events.emit(events.FILTER_INFO, msg, position)
			if self.line:
				try:
					code = compile('self.' + self.line, '<string>', 'exec')
					exec code
				except:
					print 'error>>', self.line
					errtype, value, traceback = sys.exc_info()
					print errtype, value, traceback
Ejemplo n.º 5
0
    def do_load(self):
        self.model = None
        self.paths = []
        self.options = {}
        self.parent_stack = []
        self.obj_style = []
        self.style_dict = {}
        self.fileptr.readline()
        self.style_obj = Style()
        while True:
            self.line = self.fileptr.readline()
            if not self.line:
                break
            self.line = self.line.rstrip('\r\n')

            self.check_loading()

            if self.line:
                try:
                    code = compile('self.' + self.line, '<string>', 'exec')
                    exec code
                except Exception as e:
                    LOG.warn('Parsing error in "%s"', self.line)
                    LOG.warn('Error traceback: %s', e)
Ejemplo n.º 6
0
 def get_style(self):
     if self.style is None: self.style = Style()
     style = self.style
     self.style = Style()
     return style
Ejemplo n.º 7
0
 def set_style(self, style=None):
     if style is None: self.style = Style()
     self.style = style
Ejemplo n.º 8
0
 def set_style(self, obj):
     obj.properties = self.style_obj
     self.style_obj = Style()
Ejemplo n.º 9
0
 def dstyle(self, name=''):
     if name:
         self.style_obj.name = name
         self.model.styles[name] = self.style_obj
         self.style_obj = Style()
Ejemplo n.º 10
0
	def set_style(self, obj):
		obj.properties = self.style
		self.style = Style()
Ejemplo n.º 11
0
	def dstyle(self, name=''):
		if name:
			self.style.name = name
			self.model.styles[name] = self.style
			self.style = Style()
Ejemplo n.º 12
0
	def __init__(self):
		self.curstyle = Style()
		self.verbosity = 0
		self.gdiobjects = []
		self.dcstack = []
		self.curpoint = Point(0, 0)