Pierre Carbonnelle avatar Pierre Carbonnelle committed d828a71

small fixes before final release

Comments (0)

Files changed (3)

pyDatalog/examples/test.py

     try:
         pyDatalog.create_atoms('A.qsetrwxcfv')
     except Exception as e:
-        if e.message != "type object 'A' has no attribute 'qsetrwxcfv'":
-            print(e.message) 
+        e_message = e.message if hasattr(e, 'message') else e.args[0]
+        if e_message != "type object 'A' has no attribute 'qsetrwxcfv'":
+            print(e_message) 
         _error = True
     assert _error
     

pyDatalog/pyEngine.py

     class0 = literal0.pred._class()
     terms = literal0.terms
     
-    if class0 and terms[0].is_constant and terms[0].id is None: return
+    if class0 and terms[1].is_constant and terms[1].id is None: return
     if hasattr(literal0.pred, 'base_pred'): # this is a negated literal
         if Logging: logging.debug("pyDatalog will search negation of %s" % literal0)
         base_literal = Literal(literal0.pred.base_pred, terms)

pyDatalog/pyParser.py

 
 def clear():
     Thread_storage.ProgramMode = False
-
+    Thread_storage.variables = set([])
+    
 """                             Parser classes                                                   """
 
 class LazyList(UserList.UserList):
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.