From: <mat...@us...> - 2007-02-28 15:15:05
|
Revision: 2732 http://svn.sourceforge.net/kamaelia/?rev=2732&view=rev Author: matth_rd Date: 2007-02-28 07:15:00 -0800 (Wed, 28 Feb 2007) Log Message: ----------- Modified to pick up __kamaelia_compoents__ declarations split over multiple lines. Matt Modified Paths: -------------- trunk/Code/Python/Kamaelia/Kamaelia/Support/Data/Repository.py Modified: trunk/Code/Python/Kamaelia/Kamaelia/Support/Data/Repository.py =================================================================== --- trunk/Code/Python/Kamaelia/Kamaelia/Support/Data/Repository.py 2007-02-28 14:56:59 UTC (rev 2731) +++ trunk/Code/Python/Kamaelia/Kamaelia/Support/Data/Repository.py 2007-02-28 15:15:00 UTC (rev 2732) @@ -39,12 +39,32 @@ F = open(File) contents = F.readlines() F.close() - meta = [ X for X in contents if "__kamaelia_components__" in X and X.strip()[0] != "#"] - if meta != []: - if len(meta)>1: - print "WARNING: 2 component lines(!)" - return [] - meta = parseComponentLine(meta[0]) + # find line beginning with __kamaelia_components__ + found = "" + while len(contents)>0: + line = contents.pop(0) + line = line.strip() + if "__kamaelia_components__" in line and line[0] != "#": + if found != "": + print "WARNING: 2 or more separate component lines(!)" + break + else: + found+=line.replace("\n"," ") + while ")" not in found: + if len(contents)==0: + print "WARNING: component line doesn't finish with a close bracket" + else: + line = contents.pop(0) + line = line.strip() + if line[0] != "#": + found += line + + found = found.strip() + if found: + meta = parseComponentLine(found) + else: + meta = [] + return meta def SearchComponents(baseDirectory, Base): This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |