From 4c5915e854406833299a9e0ea1a1a7d809905c08 Mon Sep 17 00:00:00 2001 From: LtWorf Date: Sat, 8 Oct 2011 17:04:07 +0000 Subject: [PATCH] - Minor changes to comments git-svn-id: http://galileo.dmi.unict.it/svn/relational/trunk@313 014f5005-505e-4b48-8d0a-63407b615a7c --- relational/maintenance.py | 4 +++- relational/optimizer.py | 3 +-- relational/parser.py | 2 +- relational/relation.py | 2 +- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/relational/maintenance.py b/relational/maintenance.py index dc6ed20..f55fae4 100644 --- a/relational/maintenance.py +++ b/relational/maintenance.py @@ -29,7 +29,7 @@ def send_survey(data): post='' for i in data.keys(): post+='%s: %s\n' %(i,data[i]) - + #sends the string params = urllib.urlencode({'survey':post}) headers = {"Content-type": "application/x-www-form-urlencoded","Accept": "text/plain"} @@ -48,6 +48,8 @@ def check_latest_version(): #html s=r.read() + if len(s)==0: + return None l= s[s.find('')].split('\n') l.sort() diff --git a/relational/optimizer.py b/relational/optimizer.py index c96ff17..7d5a7bf 100644 --- a/relational/optimizer.py +++ b/relational/optimizer.py @@ -50,8 +50,7 @@ def optimize_all(expression,rels,specific=True,general=True,debug=None): general: True if it has to perform general optimizations debug: if a list is provided here, after the end of the function, it will contain the query repeated many times to show the performed - steps. Of course don't call optimize_all(... ,debug=[]) because it - would make no sense + steps. Return value: this will return an optimized version of the expression''' if isinstance(expression,str): diff --git a/relational/parser.py b/relational/parser.py index 97f4735..854e0ea 100644 --- a/relational/parser.py +++ b/relational/parser.py @@ -85,7 +85,7 @@ class node (object): '''Expression from right to left, searching for binary operators this means that binary operators have lesser priority than unary operators. - It find the operator with lesser priority, uses it as root of this + It finds the operator with lesser priority, uses it as root of this (sub)tree using everything on its left as left parameter (so building a left subtree with the part of the list located on left) and doing the same on right. diff --git a/relational/relation.py b/relational/relation.py index 11b075a..ed7a870 100644 --- a/relational/relation.py +++ b/relational/relation.py @@ -129,7 +129,7 @@ class relation (object): def product (self,other): '''Cartesian product, attributes must be different to avoid collisions Doing this operation on relations with colliding attributes will - cause the return of a None value. + cause an exception. It is possible to use rename on attributes and then use the product''' if (self.__class__!=other.__class__)or(self.header.sharedAttributes(other.header)!=0):