Return-Path: Delivered-To: apmail-gump-commits-archive@www.apache.org Received: (qmail 8145 invoked from network); 9 Jul 2010 04:16:08 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 9 Jul 2010 04:16:08 -0000 Received: (qmail 58957 invoked by uid 500); 9 Jul 2010 04:16:07 -0000 Mailing-List: contact commits-help@gump.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: general@gump.apache.org Delivered-To: mailing list commits@gump.apache.org Received: (qmail 58881 invoked by uid 99); 9 Jul 2010 04:16:05 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 09 Jul 2010 04:16:05 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 09 Jul 2010 04:14:31 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id DD62D23889B3; Fri, 9 Jul 2010 04:13:06 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r962395 - in /gump/trunk/python/gump/core/language: csharp.py java.py Date: Fri, 09 Jul 2010 04:13:06 -0000 To: commits@gump.apache.org From: bodewig@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20100709041306.DD62D23889B3@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: bodewig Date: Fri Jul 9 04:13:06 2010 New Revision: 962395 URL: http://svn.apache.org/viewvc?rev=962395&view=rev Log: pylint Modified: gump/trunk/python/gump/core/language/csharp.py gump/trunk/python/gump/core/language/java.py Modified: gump/trunk/python/gump/core/language/csharp.py URL: http://svn.apache.org/viewvc/gump/trunk/python/gump/core/language/csharp.py?rev=962395&r1=962394&r2=962395&view=diff ============================================================================== --- gump/trunk/python/gump/core/language/csharp.py (original) +++ gump/trunk/python/gump/core/language/csharp.py Fri Jul 9 04:13:06 2010 @@ -11,14 +11,14 @@ # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, +# distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. """ - Generates paths for projects w/ dependencies + Generates paths for projects w/ dependencies """ @@ -31,36 +31,36 @@ import gump.util.process.command import gump.core.model.depend -import gump.core.language.path +from gump.core.language.path import AnnotatedPath, AssemblyPath ############################################################################### # Classes ############################################################################### class CSharpHelper(gump.core.run.gumprun.RunSpecific): - - def __init__(self,run): - gump.core.run.gumprun.RunSpecific.__init__(self,run) - + + def __init__(self, run): + gump.core.run.gumprun.RunSpecific.__init__(self, run) + # Caches for paths - self.paths={} - - def getAssemblyPath(self,project,debug=False): + self.paths = {} + + def getAssemblyPath(self, project, debug = False): """ Get boot and regular classpaths for a project. - + Return a path for this project """ # Calculate path - libpath = self.getAssemblyPathObject(project,debug) - + libpath = self.getAssemblyPathObject(project, debug) + # Return them simple/flattened return libpath.getFlattened() - def getAssemblyPathObject(self,project,debug=False): + def getAssemblyPathObject(self, project, debug = False): """ Get a TOTAL path for a project (including its dependencies) - + A path object for a project """ @@ -69,135 +69,156 @@ class CSharpHelper(gump.core.run.gumprun # doing it OO (each project context stores its own, but a step..) # if self.paths.has_key(project) : - if debug: print "Path previously resolved..." - return self.paths[project] - + if debug: + print "Path previously resolved..." + return self.paths[project] + # Start with the system classpath (later remove this) - libpath=gump.core.language.path.AssemblyPath('Assembly Path') + libpath = AssemblyPath('Assembly Path') # Add this project's work directories - workdir=project.getModule().getWorkingDirectory() for work in project.getWorks(): - path=work.getResolvedPath() + path = work.getResolvedPath() if path: - libpath.addPathPart(gump.core.language.path.AnnotatedPath('',path,project,None,'Work Entity')) + libpath.addPathPart(AnnotatedPath('', path, project, None, + 'Work Entity')) else: - log.error(" gump.core.model.depend.INHERIT_NONE): - subp = self._getDependOutputList(project,subdependency,visited,depth+1,debug) - if subp: libpath.importPath(subp) + if (inherit == gump.core.model.depend.INHERIT_ALL or \ + inherit == gump.core.model.depend.INHERIT_HARD) \ + or (inherit == gump.core.model.depend.INHERIT_RUNTIME \ + and subdependency.isRuntime()) \ + or (subdependency.inherit > \ + gump.core.model.depend.INHERIT_NONE): + subp = self._getDependOutputList(project, subdependency, + visited, depth + 1, debug) + if subp: + libpath.importPath(subp) elif debug: - print str(depth) + ') Skip : ' + str(subdependency) + ' in ' + project.name + print str(depth) + ') Skip : ' + str(subdependency) + ' in ' \ + + project.name return libpath - - + + Modified: gump/trunk/python/gump/core/language/java.py URL: http://svn.apache.org/viewvc/gump/trunk/python/gump/core/language/java.py?rev=962395&r1=962394&r2=962395&view=diff ============================================================================== --- gump/trunk/python/gump/core/language/java.py (original) +++ gump/trunk/python/gump/core/language/java.py Fri Jul 9 04:13:06 2010 @@ -11,14 +11,14 @@ # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, +# distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. """ - Generates Classpaths for projects w/ dependencies + Generates Classpaths for projects w/ dependencies """ @@ -32,68 +32,68 @@ import gump.util.process.command import gump.core.model.depend -import gump.core.language.path +from gump.core.language.path import AnnotatedPath, Classpath ############################################################################### # Classes ############################################################################### class JavaHelper(gump.core.run.gumprun.RunSpecific): - - def __init__(self,run): - gump.core.run.gumprun.RunSpecific.__init__(self,run) - + + def __init__(self, run): + gump.core.run.gumprun.RunSpecific.__init__(self, run) + # Caches for classpaths - self.classpaths={} - self.bootclasspaths={} - - def getJVMArgs(self,project): - + self.classpaths = {} + self.bootclasspaths = {} + + def getJVMArgs(self, project): + """ - + Get JVM arguments for a project - + """ args = project.jvmargs if os.environ.has_key('GUMP_JAVA_ARGS'): args = gump.util.process.command.Parameters() for p in os.environ['GUMP_JAVA_ARGS'].split(' '): - args.addParameter(p); + args.addParameter(p) for p in project.jvmargs.items() : - args.addParameterObject(p); + args.addParameterObject(p) return args - - def getClasspaths(self,project,debug=False): + + def getClasspaths(self, project, debug = False): """ Get boot and regular classpaths for a project. - + Return a (classpath, bootclaspath) tuple for this project """ # Calculate classpath and bootclasspath - (classpath, bootclasspath) = self.getClasspathObjects(project,debug) - + (classpath, bootclasspath) = self.getClasspathObjects(project, debug) + # Return them simple/flattened return ( classpath.getFlattened(), bootclasspath.getFlattened() ) - + def getBaseClasspath(self): """ - + The basic classpath needs to include a compiler... - + Return a system classpath (to include $JAVA_HOME/lib/tools.jar' for a compiler). """ - sysClasspath=gump.core.language.path.Classpath('System Classpath') - javaHome=self.run.getEnvironment().getJavaHome() - syscp=os.path.join(os.path.join(javaHome,'lib'),'tools.jar') + sysClasspath = Classpath('System Classpath') + javaHome = self.run.getEnvironment().getJavaHome() + syscp = os.path.join(os.path.join(javaHome, 'lib'), 'tools.jar') if os.path.exists(syscp): - sysClasspath.importFlattenedParts(syscp) + sysClasspath.importFlattenedParts(syscp) return sysClasspath - def getClasspathObjects(self,project,debug=False): + def getClasspathObjects(self, project, debug = False): """ Get a TOTAL classpath for a project (including its dependencies) - + A tuple of (CLASSPATH, BOOTCLASSPATH) for a project """ @@ -101,161 +101,193 @@ class JavaHelper(gump.core.run.gumprun.R # Do this once only... storing it on the context. Not as nice as # doing it OO (each project context stores its own, but a step..) # - if self.classpaths.has_key(project) and self.bootclasspaths.has_key(project) : - if debug: print "Classpath/Bootclasspath previously resolved..." - return ( self.classpaths[project], self.bootclasspaths[project] ) - + if self.classpaths.has_key(project) and \ + self.bootclasspaths.has_key(project) : + if debug: + print "Classpath/Bootclasspath previously resolved..." + return (self.classpaths[project], self.bootclasspaths[project]) + # Start with the system classpath (later remove this) - classpath=self.getBaseClasspath() - bootclasspath=gump.core.language.path.Classpath('Boot Classpath') + classpath = self.getBaseClasspath() + bootclasspath = Classpath('Boot Classpath') # Add this project's work directories (these go into # CLASSPATH, never BOOTCLASSPATH) - workdir=project.getModule().getWorkingDirectory() for work in project.getWorks(): - path=work.getResolvedPath() + path = work.getResolvedPath() if path: - classpath.addPathPart(gump.core.language.path.AnnotatedPath('',path,project,None,'Work Entity')) + classpath.addPathPart(AnnotatedPath('', path, project, None, + 'Work Entity')) else: - log.error("