cleanup: minor fixes in comboparse and soup_parser
This commit is contained in:
@@ -35,8 +35,10 @@ class ComboParser(object):
|
|||||||
if self.loaded: return
|
if self.loaded: return
|
||||||
self.loaded = True
|
self.loaded = True
|
||||||
|
|
||||||
try: self.cparser.read(self.ini)
|
try:
|
||||||
except: pass
|
self.cparser.read(self.ini)
|
||||||
|
except Exception:
|
||||||
|
pass # config file missing or unreadable, use defaults
|
||||||
args = self.aparser.parse_args()
|
args = self.aparser.parse_args()
|
||||||
for item in self.items:
|
for item in self.items:
|
||||||
try:
|
try:
|
||||||
@@ -61,7 +63,8 @@ class ComboParser(object):
|
|||||||
if arg is not None:
|
if arg is not None:
|
||||||
inner = arg
|
inner = arg
|
||||||
item['found'] = True
|
item['found'] = True
|
||||||
except: pass
|
except AttributeError:
|
||||||
|
pass # arg not provided on command line
|
||||||
if not item['found']:
|
if not item['found']:
|
||||||
if item['required']:
|
if item['required']:
|
||||||
sys.stderr.write('error: required config item "%s" not found in section "%s" of "%s"!\n'%(item['name'], item['section'], self.ini))
|
sys.stderr.write('error: required config item "%s" not found in section "%s" of "%s"!\n'%(item['name'], item['section'], self.ini))
|
||||||
|
|||||||
@@ -61,8 +61,8 @@ def _parse_stdlib(html):
|
|||||||
parser = LinkExtractor()
|
parser = LinkExtractor()
|
||||||
try:
|
try:
|
||||||
parser.feed(html)
|
parser.feed(html)
|
||||||
except:
|
except Exception:
|
||||||
pass
|
pass # malformed HTML, return partial results
|
||||||
return SoupResult(parser.tags)
|
return SoupResult(parser.tags)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user