hbatch_parsers

Post Reply
elecstorm
Posts: 8
Joined: Thu Oct 05, 2017 1:17 pm

hbatch_parsers

Post by elecstorm » Thu Nov 02, 2017 5:35 pm

Hi!
I don't understand logic of all hbatch_something parsers.
For example hbatch_mantra:

Code: Select all

from parsers import hbatch
from parsers import mantra

class hbatch_mantra(hbatch.hbatch, mantra.mantra):
	def __init__(self):
		hbatch.hbatch.__init__(self) # WE init str_error and str_warning from hbatch parser
		mantra.mantra.__init__(self) # NOW we re-initialize them, and we lost errors and warnings from hbatch!

	def do(self, data, mode):
		mantra.mantra.do(self, data, mode)
		hbatch.hbatch.do(self, data, mode)
I think, this combination of some parsers in one creates dangerous situations, when we lost all errors and warnings from parsers during initialization, except the last. I catch it, when I added critical error (for our network) to hbatch parser. But It doesn't work in hbatch_... parsers.

User avatar
timurhai
Site Admin
Posts: 338
Joined: Sun Jan 15, 2017 8:40 pm
Location: Russia, Korolev
Contact:

Re: hbatch_parsers

Post by timurhai » Thu Nov 02, 2017 6:30 pm

Yes. This is a bug.
We should append errors and warnings arrays in class constructors. Not reinitialize arrays.
Timur Hairulin
CGRU 2.2.3 Ubuntu 14.04LTS (gcc4.8.4)

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest