Commits

Israel Saeta Pérez committed 40e41b3

Add sysargs checker.

Comments (0)

Files changed (1)

web/hgbook/converter.py

 sel = CSSSelector('p, pre, h1, table.equation')
 body = CSSSelector('body')
 
-filename = args[0]
+try:
+    filename = args[0]
+except IndexError:
+    raise IndexError("Usage: %s <path-to-html-file>" % __file__)
+
 tree = etree.parse(filename, html.HTMLParser())
 root = tree.getroot()
 
-
 body(root)[0].set('id', doc_id)
 
 for element in sel(root):