]> hydra-www.ietfng.org Git - dyna2/commitdiff
hide ugly filenames from users.
authorTim Vieira <tim.f.vieira@gmail.com>
Mon, 1 Jul 2013 05:20:59 +0000 (01:20 -0400)
committerTim Vieira <tim.f.vieira@gmail.com>
Mon, 1 Jul 2013 05:20:59 +0000 (01:20 -0400)
src/Dyna/Backend/Python/errors.py
src/Dyna/Backend/Python/utils.py
test/repl/aggregator-conflict.expect

index aed9e25e4636af70e8b3a8287db1427f3b3b731f..7d31fb46266e66a856d495763349e3f574f26bcd 100644 (file)
@@ -11,6 +11,7 @@ class DynaCompilerError(Exception):
 class AggregatorError(Exception):
     pass
 
+
 class DynaInitializerException(Exception):
     def __init__(self, exception, init):
         rule = parse_attrs(init)['rule']
index 9e96aaceb32088bf750281e3f7d9e3a63480f0f7..75e07dc3646ed9b040fea22b6c4969fb6483154d 100644 (file)
@@ -72,10 +72,12 @@ def dynac(f, out, anf=None, compiler_args=()):
     stdout, stderr = p.communicate()
     if p.returncode:
         assert not stdout.strip(), [stdout, stderr]
+        # hide our temporary file's ugly sha1 file names from users.
+        ugly_file_name = dotdynadir + '[a-z0-9/.]+\.dyna\S*'
+        stderr = re.sub(ugly_file_name, '', stderr)
         raise DynaCompilerError(stderr)
 
 
-
 def lexer(term):
     return re.findall('"[^"]*"'               # string
                       '|[a-z][a-zA-Z_0-9]*'   # functor
index a20ae70694bb2a37f19c4293c8105fadcaf87a52..6b34765b21e3e818856646c03eb5560fe5d90869 100644 (file)
@@ -2,7 +2,7 @@
 a => 1.
 > DynaCompilerError:
 Encountered error in input program:
- Conflicting aggregators; rule /home/timv/.dyna/tmp/27792/966093dc38b755a6f17b02774b5c656931163a3a.dyna:5:1-/home/timv/.dyna/tmp/27792/966093dc38b755a6f17b02774b5c656931163a3a.dyna:5:3
+ Conflicting aggregators; rule 
  uses '|=' for a/0 but I had been lead to expect '+='.
 Everything was syntactically valid, but we could not
 see it through.