Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 22f0dd7

Browse files
authored
Merge pull request #37 from WeatherGod/super_friendly
Don't reference class attributes as class attributes within methods.
2 parents 9c458f2 + d66c4bf commit 22f0dd7

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

metar/Metar.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -361,11 +361,11 @@ def __init__( self, metarcode, month=None, year=None, utcdelta=None):
361361

362362
code = self.code+" " # (the regexps all expect trailing spaces...)
363363
try:
364-
ngroup = len(Metar.handlers)
364+
ngroup = len(self.handlers)
365365
igroup = 0
366366
ifailed = -1
367367
while igroup < ngroup and code:
368-
pattern, handler, repeatable = Metar.handlers[igroup]
368+
pattern, handler, repeatable = self.handlers[igroup]
369369
if debug: print(handler.__name__,":",code)
370370
m = pattern.match(code)
371371
while m:
@@ -395,7 +395,7 @@ def __init__( self, metarcode, month=None, year=None, utcdelta=None):
395395
# groups, we'll try parsing this group as a remark
396396
if pattern == REMARK_RE or self.press:
397397
while code:
398-
for pattern, handler in Metar.remark_handlers:
398+
for pattern, handler in self.remark_handlers:
399399
if debug: print(handler.__name__,":",code)
400400
m = pattern.match(code)
401401
if m:
@@ -412,7 +412,7 @@ def __init__( self, metarcode, month=None, year=None, utcdelta=None):
412412
raise ParserError("Unparsed groups in body '"+code+"' while processing '"+metarcode+"'")
413413

414414
def _do_trend_handlers(self, code):
415-
for pattern, handler, repeatable in Metar.trend_handlers:
415+
for pattern, handler, repeatable in self.trend_handlers:
416416
if debug: print(handler.__name__,":",code)
417417
m = pattern.match(code)
418418
while m:

0 commit comments

Comments
 (0)