You are viewing a plain text version of this content. The canonical link for it is here.
Posted to general@gump.apache.org by ni...@apache.org on 2003/08/21 21:42:01 UTC

cvs commit: jakarta-gump/proposals/aj_python/ruper __init__.py cli.py

nickchalko    2003/08/21 12:42:01

  Added:       proposals/aj_python/ruper __init__.py cli.py
  Log:
  Adam Jack's  python proposal for gump
  
  Revision  Changes    Path
  1.1                  jakarta-gump/proposals/aj_python/ruper/__init__.py
  
  Index: __init__.py
  ===================================================================
  #!/usr/bin/python
  
  ## ====================================================================
  ##
  ## The Apache Software License, Version 1.1
  ##
  ## Copyright (c) 1999-2003 The Apache Software Foundation.  All rights
  ## reserved.
  ##
  ## Redistribution and use in source and binary forms, with or without
  ## modification, are permitted provided that the following conditions
  ## are met:
  ##
  ## 1. Redistributions of source code must retain the above copyright
  ##    notice, this list of conditions and the following disclaimer.
  ##
  ## 2. Redistributions in binary form must reproduce the above copyright
  ##    notice, this list of conditions and the following disclaimer in
  ##    the documentation and/or other materials provided with the
  ##    distribution.
  ##
  ## 3. The end-user documentation included with the redistribution, if
  ##    any, must include the following acknowlegement:
  ##       "This product includes software developed by the
  ##        Apache Software Foundation (http://www.apache.org/)."
  ##    Alternately, this acknowlegement may appear in the software itself,
  ##    if and wherever such third-party acknowlegements normally appear.
  ##
  ## 4. The names "The Jakarta Project", "Alexandria", and "Apache Software
  ##    Foundation" must not be used to endorse or promote products derived
  ##    from this software without prior written permission. For written
  ##    permission, please contact apache@apache.org.
  ##
  ## 5. Products derived from this software may not be called "Apache"
  ##    nor may "Apache" appear in their names without prior written
  ##    permission of the Apache Group.
  ##
  ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  ## OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  ## DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
  ## ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  ## SUCH DAMAGE.
  ## ====================================================================
  ##
  ## This software consists of voluntary contributions made by many
  ## individuals on behalf of the Apache Software Foundation.  For more
  ## information on the Apache Software Foundation, please see
  ## <http://www.apache.org/>.
  
  """
  
  Ruper package in Python
  Ruper == Resource UPdatER
  
  """
  
  __author__  = "Apache Software Foundation"
  __status__  = "$Header: /home/cvs/jakarta-gump/proposals/aj_python/ruper/__init__.py,v 1.1 2003/08/21 19:42:01 nickchalko Exp $"
  __version__ = "$Revision: 1.1 $"
  __date__    = "$Date: 2003/08/21 19:42:01 $"
  
  import os, os.path, sys, urllib, logging
  
  # init logging
  logging.basicConfig()
  log = logging.getLogger("Ruper")
  log.setLevel(logging.DEBUG) #set verbosity to show all messages of severity >= DEBUG
   
  # Repository
  class Repository(object):
    def __init__(self,url,type):
      self.url=url
      self.type=type
  
    def resolve(self, resource):
      # FIXME (nicolaken)
      # delegate the getting of a resource to an outside file
      # named after the repository type
      if self.type == 'maven':
        # not necessarily Maven uses our resource.standardName()
        if resource.type == 'jar':
          resolvedUrl = '%s/%s/jars/%s-%s.jar' % (self.url,resource.name,resource.name,resource.version)
        else:
          raise Error, 'Unknown Resource Type; type: '+type
      else:
        raise Error, 'Unknown Repository; type: '+type
  
      return resolvedUrl
  
    def download(self, resource, destinationDir):
      if not os.path.isdir(destinationDir):
        raise IOError, 'This method needs a directory, instead it got:'+destinationDir
  
      remoteurl = self.resolve(resource)
      urllib.urlretrieve(remoteurl, '%s/%s' % (destinationDir,resource.standardName()))
  
    def update(self, resource, destinationDir):
     #download the file if not present
     if os.path.exists('%s/%s' % (destinationDir,resource.standardName())):
       log.debug('using cached file')
     else:
       log.debug('caching file...')
       download((self, resource, destinationDir))
       log.debug('...done')
  
  # Resource
  class Resource(object):
    def __init__(self,name,version,type):
      self.name=name
      self.version=version
      self.type=type
  
    def standardName(self):
      if self.type == 'jar':
        return '%s-%s.jar' % (self.name,self.version)
      else:
        raise Error, 'Unknown Resource Type; type: '+type
  
  
  if __name__=='__main__':
    os.chdir(dir.base)
    resource = Resource('log4j','1.3.4','jar')
    print resource.standardName()
    repository = Repository('http://www.ibiblio.org/maven','maven')
    print repository.resolve(resource)
    repository.update(resource,dir.cache)
  
  
  
  
  
  
  1.1                  jakarta-gump/proposals/aj_python/ruper/cli.py
  
  Index: cli.py
  ===================================================================
  #!/usr/bin/python
  
  ## ====================================================================
  ##
  ## The Apache Software License, Version 1.1
  ##
  ## Copyright (c) 1999-2003 The Apache Software Foundation.  All rights
  ## reserved.
  ##
  ## Redistribution and use in source and binary forms, with or without
  ## modification, are permitted provided that the following conditions
  ## are met:
  ##
  ## 1. Redistributions of source code must retain the above copyright
  ##    notice, this list of conditions and the following disclaimer.
  ##
  ## 2. Redistributions in binary form must reproduce the above copyright
  ##    notice, this list of conditions and the following disclaimer in
  ##    the documentation and/or other materials provided with the
  ##    distribution.
  ##
  ## 3. The end-user documentation included with the redistribution, if
  ##    any, must include the following acknowlegement:
  ##       "This product includes software developed by the
  ##        Apache Software Foundation (http://www.apache.org/)."
  ##    Alternately, this acknowlegement may appear in the software itself,
  ##    if and wherever such third-party acknowlegements normally appear.
  ##
  ## 4. The names "The Jakarta Project", "Alexandria", and "Apache Software
  ##    Foundation" must not be used to endorse or promote products derived
  ##    from this software without prior written permission. For written
  ##    permission, please contact apache@apache.org.
  ##
  ## 5. Products derived from this software may not be called "Apache"
  ##    nor may "Apache" appear in their names without prior written
  ##    permission of the Apache Group.
  ##
  ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  ## OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  ## DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
  ## ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  ## SUCH DAMAGE.
  ## ====================================================================
  ##
  ## This software consists of voluntary contributions made by many
  ## individuals on behalf of the Apache Software Foundation.  For more
  ## information on the Apache Software Foundation, please see
  ## <http://www.apache.org/>.
  
  """
  
  Ruper CLI
  
  """
  
  
  import os, os.path, sys, urllib, logging, ruper
  
  if __name__=='__main__':
    os.chdir('..')
    resource = ruper.Resource('log4j','1.3.4','jar')
    print resource.standardName()
    repository = ruper.Repository('http://www.ibiblio.org/maven','maven')
    print repository.resolve(resource)
    repository.update(resource,'cache')
  
  
  
  
  
  

Python Gump run ... sync sink ;-)

Posted by "Adam R. B. Jack" <aj...@trysybase.com>.
Last night I left Python Gump running on a small sized workspace, and today
it was still running. It was doing "cp -Rf" as it was yesterday. Looking at
the code it the 'sync' seems to do a module cp -Rf (inefficient in itself)
for each project, not each module, DOH!  I've fixed that now.

Anybody know why cp -Rf was used, when rsync is used for traditional gump?
Portability? [Clearly cp -Rf is a lot of work compared to an update that
might do very little.]

I'd like to add an option to cvs checkout/update directly into the build
directories and not require any sync. For folks who only maintain automated
nightly builders this seems practical.

I'll kick of another run once fixed. I can't publish my forrest output (I
had to close port 80 when I started gumping more Sybase internal software)
but when Nick's DSL link comes back to life after the lightening I'll
install/run there and show folks the skinless output.

regards

Adam


Re: cvs commit: jakarta-gump/proposals/aj_python/ruper __init__.py cli.py

Posted by "Adam R. B. Jack" <aj...@trysybase.com>.
Hmm, I copied the files from PC to Linux to test before taring up and
sending to Nick. I don't believe I allowed an dos2unix conversions on the
unzip when I sent them (unless it is default) so perhaps that it the
problem.

I am making greater progress, the struggle for me has been to find a way to
run/debug it. When I run it on the full gump profile it runs, but I don't
have bandwidth (over modem) or disk (on remote box) to do a full build. So
I've been trying some cut-down profiles and trying to patch the myriad of
Project.list[x] KeyErrors ... and making progress.

I have two questions for folk:

1) I've tried recreating Sam's RSS feed by walking down the context tree,
but I am not sure what ought be in it --- all projects? failed? succeeded?
Any thoughts would be appreciated.

2) I seem to be getting "missing prerequisite JAXP" on projects that
traditional gump can process. Is this somehow special cased ('cos it is in
JDK1.4?) Thoughts appreciated.

For anybody willing to try it out, a recent copy it is at:

   http://www.neukadye.com/aj_python.zip

I still put things in aj_python parallel to python (under jakarta-gump),
then set the PYTHONPATH and do things like:

    python gump/integrate.py -w ../tsbuild1.xml krysalis-*

and such.

regards

Adam
----- Original Message ----- 
From: "Christopher Lenz" <cm...@gmx.de>
To: "Gump code and data" <gu...@jakarta.apache.org>
Cc: <ni...@chalko.com>
Sent: Friday, August 22, 2003 3:07 AM
Subject: Re: cvs commit: jakarta-gump/proposals/aj_python/ruper __init__.py
cli.py


> Nick,
>
> looks like you committed all these files without line-ending conversion
> (notice all the excessive new lines?). You probably used cvs -kb instead
> of cvs -kkv or some other appropriate setting.
>
> (I think to remember you're an Eclipse user: you'll have to add the
> extensions to Preferences/Team/File Types, and set them to ASCII)
>
> nickchalko@apache.org wrote:
> > nickchalko    2003/08/21 12:42:01
> >
> >   Added:       proposals/aj_python/ruper __init__.py cli.py
> >   Log:
> >   Adam Jack's  python proposal for gump
> >
> >   Revision  Changes    Path
> >   1.1
jakarta-gump/proposals/aj_python/ruper/__init__.py
> >
> >   Index: __init__.py
> >   ===================================================================
> >   #!/usr/bin/python
> >
> >
> >
> >   ##
====================================================================
> >
> >   ##
> >
> >   ## The Apache Software License, Version 1.1
> >
> >   ##
> >
> >   ## Copyright (c) 1999-2003 The Apache Software Foundation.  All rights
> >
> >   ## reserved.
> >
> >   ##
> >
> >   ## Redistribution and use in source and binary forms, with or without
> >
> >   ## modification, are permitted provided that the following conditions
> >
> >   ## are met:
> >
> >   ##
> >
> >   ## 1. Redistributions of source code must retain the above copyright
> >
> >   ##    notice, this list of conditions and the following disclaimer.
> >
> >   ##
> >
> >   ## 2. Redistributions in binary form must reproduce the above
copyright
> >
> >   ##    notice, this list of conditions and the following disclaimer in
> >
> >   ##    the documentation and/or other materials provided with the
> >
> >   ##    distribution.
> >
> >   ##
> >
> >   ## 3. The end-user documentation included with the redistribution, if
> >
> >   ##    any, must include the following acknowlegement:
> >
> >   ##       "This product includes software developed by the
> >
> >   ##        Apache Software Foundation (http://www.apache.org/)."
> >
> >   ##    Alternately, this acknowlegement may appear in the software
itself,
> >
> >   ##    if and wherever such third-party acknowlegements normally
appear.
> >
> >   ##
> >
> >   ## 4. The names "The Jakarta Project", "Alexandria", and "Apache
Software
> >
> >   ##    Foundation" must not be used to endorse or promote products
derived
> >
> >   ##    from this software without prior written permission. For written
> >
> >   ##    permission, please contact apache@apache.org.
> >
> >   ##
> >
> >   ## 5. Products derived from this software may not be called "Apache"
> >
> >   ##    nor may "Apache" appear in their names without prior written
> >
> >   ##    permission of the Apache Group.
> >
> >   ##
> >
> >   ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
> >
> >   ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
> >
> >   ## OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
> >
> >   ## DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
> >
> >   ## ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
> >
> >   ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
> >
> >   ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
> >
> >   ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
> >
> >   ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
> >
> >   ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
> >
> >   ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
> >
> >   ## SUCH DAMAGE.
> >
> >   ##
====================================================================
> >
> >   ##
> >
> >   ## This software consists of voluntary contributions made by many
> >
> >   ## individuals on behalf of the Apache Software Foundation.  For more
> >
> >   ## information on the Apache Software Foundation, please see
> >
> >   ## <http://www.apache.org/>.
> >
> >
> >
> >   """
> >
> >
> >
> >   Ruper package in Python
> >
> >   Ruper == Resource UPdatER
> >
> >
> >
> >   """
> >
> >
> >
> >   __author__  = "Apache Software Foundation"
> >
> >   __status__  = "$Header:
/home/cvs/jakarta-gump/proposals/aj_python/ruper/__init__.py,v 1.1
2003/08/21 19:42:01 nickchalko Exp $"
> >
> >   __version__ = "$Revision: 1.1 $"
> >
> >   __date__    = "$Date: 2003/08/21 19:42:01 $"
> >
> >
> >
> >   import os, os.path, sys, urllib, logging
> >
> >
> >
> >   # init logging
> >
> >   logging.basicConfig()
> >
> >   log = logging.getLogger("Ruper")
> >
> >   log.setLevel(logging.DEBUG) #set verbosity to show all messages of
severity >= DEBUG
> >
> >
> >
> >   # Repository
> >
> >   class Repository(object):
> >
> >     def __init__(self,url,type):
> >
> >       self.url=url
> >
> >       self.type=type
> >
> >
> >
> >     def resolve(self, resource):
> >
> >       # FIXME (nicolaken)
> >
> >       # delegate the getting of a resource to an outside file
> >
> >       # named after the repository type
> >
> >       if self.type == 'maven':
> >
> >         # not necessarily Maven uses our resource.standardName()
> >
> >         if resource.type == 'jar':
> >
> >           resolvedUrl = '%s/%s/jars/%s-%s.jar' %
(self.url,resource.name,resource.name,resource.version)
> >
> >         else:
> >
> >           raise Error, 'Unknown Resource Type; type: '+type
> >
> >       else:
> >
> >         raise Error, 'Unknown Repository; type: '+type
> >
> >
> >
> >       return resolvedUrl
> >
> >
> >
> >     def download(self, resource, destinationDir):
> >
> >       if not os.path.isdir(destinationDir):
> >
> >         raise IOError, 'This method needs a directory, instead it
got:'+destinationDir
> >
> >
> >
> >       remoteurl = self.resolve(resource)
> >
> >       urllib.urlretrieve(remoteurl, '%s/%s' %
(destinationDir,resource.standardName()))
> >
> >
> >
> >     def update(self, resource, destinationDir):
> >
> >      #download the file if not present
> >
> >      if os.path.exists('%s/%s' %
(destinationDir,resource.standardName())):
> >
> >        log.debug('using cached file')
> >
> >      else:
> >
> >        log.debug('caching file...')
> >
> >        download((self, resource, destinationDir))
> >
> >        log.debug('...done')
> >
> >
> >
> >   # Resource
> >
> >   class Resource(object):
> >
> >     def __init__(self,name,version,type):
> >
> >       self.name=name
> >
> >       self.version=version
> >
> >       self.type=type
> >
> >
> >
> >     def standardName(self):
> >
> >       if self.type == 'jar':
> >
> >         return '%s-%s.jar' % (self.name,self.version)
> >
> >       else:
> >
> >         raise Error, 'Unknown Resource Type; type: '+type
> >
> >
> >
> >
> >
> >   if __name__=='__main__':
> >
> >     os.chdir(dir.base)
> >
> >     resource = Resource('log4j','1.3.4','jar')
> >
> >     print resource.standardName()
> >
> >     repository = Repository('http://www.ibiblio.org/maven','maven')
> >
> >     print repository.resolve(resource)
> >
> >     repository.update(resource,dir.cache)
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >   1.1                  jakarta-gump/proposals/aj_python/ruper/cli.py
> >
> >   Index: cli.py
> >   ===================================================================
> >   #!/usr/bin/python
> >
> >
> >
> >   ##
====================================================================
> >
> >   ##
> >
> >   ## The Apache Software License, Version 1.1
> >
> >   ##
> >
> >   ## Copyright (c) 1999-2003 The Apache Software Foundation.  All rights
> >
> >   ## reserved.
> >
> >   ##
> >
> >   ## Redistribution and use in source and binary forms, with or without
> >
> >   ## modification, are permitted provided that the following conditions
> >
> >   ## are met:
> >
> >   ##
> >
> >   ## 1. Redistributions of source code must retain the above copyright
> >
> >   ##    notice, this list of conditions and the following disclaimer.
> >
> >   ##
> >
> >   ## 2. Redistributions in binary form must reproduce the above
copyright
> >
> >   ##    notice, this list of conditions and the following disclaimer in
> >
> >   ##    the documentation and/or other materials provided with the
> >
> >   ##    distribution.
> >
> >   ##
> >
> >   ## 3. The end-user documentation included with the redistribution, if
> >
> >   ##    any, must include the following acknowlegement:
> >
> >   ##       "This product includes software developed by the
> >
> >   ##        Apache Software Foundation (http://www.apache.org/)."
> >
> >   ##    Alternately, this acknowlegement may appear in the software
itself,
> >
> >   ##    if and wherever such third-party acknowlegements normally
appear.
> >
> >   ##
> >
> >   ## 4. The names "The Jakarta Project", "Alexandria", and "Apache
Software
> >
> >   ##    Foundation" must not be used to endorse or promote products
derived
> >
> >   ##    from this software without prior written permission. For written
> >
> >   ##    permission, please contact apache@apache.org.
> >
> >   ##
> >
> >   ## 5. Products derived from this software may not be called "Apache"
> >
> >   ##    nor may "Apache" appear in their names without prior written
> >
> >   ##    permission of the Apache Group.
> >
> >   ##
> >
> >   ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
> >
> >   ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
> >
> >   ## OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
> >
> >   ## DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
> >
> >   ## ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
> >
> >   ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
> >
> >   ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
> >
> >   ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
> >
> >   ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
> >
> >   ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
> >
> >   ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
> >
> >   ## SUCH DAMAGE.
> >
> >   ##
====================================================================
> >
> >   ##
> >
> >   ## This software consists of voluntary contributions made by many
> >
> >   ## individuals on behalf of the Apache Software Foundation.  For more
> >
> >   ## information on the Apache Software Foundation, please see
> >
> >   ## <http://www.apache.org/>.
> >
> >
> >
> >   """
> >
> >
> >
> >   Ruper CLI
> >
> >
> >
> >   """
> >
> >
> >
> >
> >
> >   import os, os.path, sys, urllib, logging, ruper
> >
> >
> >
> >   if __name__=='__main__':
> >
> >     os.chdir('..')
> >
> >     resource = ruper.Resource('log4j','1.3.4','jar')
> >
> >     print resource.standardName()
> >
> >     repository =
ruper.Repository('http://www.ibiblio.org/maven','maven')
> >
> >     print repository.resolve(resource)
> >
> >     repository.update(resource,'cache')
>
>
> -- 
> Christopher Lenz
> /=/ cmlenz at gmx.de
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: gump-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: gump-help@jakarta.apache.org
>


Re: cvs commit: jakarta-gump/proposals/aj_python/ruper __init__.py cli.py

Posted by Christopher Lenz <cm...@gmx.de>.
Nick,

looks like you committed all these files without line-ending conversion 
(notice all the excessive new lines?). You probably used cvs -kb instead 
of cvs -kkv or some other appropriate setting.

(I think to remember you're an Eclipse user: you'll have to add the 
extensions to Preferences/Team/File Types, and set them to ASCII)

nickchalko@apache.org wrote:
> nickchalko    2003/08/21 12:42:01
> 
>   Added:       proposals/aj_python/ruper __init__.py cli.py
>   Log:
>   Adam Jack's  python proposal for gump
>   
>   Revision  Changes    Path
>   1.1                  jakarta-gump/proposals/aj_python/ruper/__init__.py
>   
>   Index: __init__.py
>   ===================================================================
>   #!/usr/bin/python
> 
>   
> 
>   ## ====================================================================
> 
>   ##
> 
>   ## The Apache Software License, Version 1.1
> 
>   ##
> 
>   ## Copyright (c) 1999-2003 The Apache Software Foundation.  All rights
> 
>   ## reserved.
> 
>   ##
> 
>   ## Redistribution and use in source and binary forms, with or without
> 
>   ## modification, are permitted provided that the following conditions
> 
>   ## are met:
> 
>   ##
> 
>   ## 1. Redistributions of source code must retain the above copyright
> 
>   ##    notice, this list of conditions and the following disclaimer.
> 
>   ##
> 
>   ## 2. Redistributions in binary form must reproduce the above copyright
> 
>   ##    notice, this list of conditions and the following disclaimer in
> 
>   ##    the documentation and/or other materials provided with the
> 
>   ##    distribution.
> 
>   ##
> 
>   ## 3. The end-user documentation included with the redistribution, if
> 
>   ##    any, must include the following acknowlegement:
> 
>   ##       "This product includes software developed by the
> 
>   ##        Apache Software Foundation (http://www.apache.org/)."
> 
>   ##    Alternately, this acknowlegement may appear in the software itself,
> 
>   ##    if and wherever such third-party acknowlegements normally appear.
> 
>   ##
> 
>   ## 4. The names "The Jakarta Project", "Alexandria", and "Apache Software
> 
>   ##    Foundation" must not be used to endorse or promote products derived
> 
>   ##    from this software without prior written permission. For written
> 
>   ##    permission, please contact apache@apache.org.
> 
>   ##
> 
>   ## 5. Products derived from this software may not be called "Apache"
> 
>   ##    nor may "Apache" appear in their names without prior written
> 
>   ##    permission of the Apache Group.
> 
>   ##
> 
>   ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
> 
>   ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
> 
>   ## OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
> 
>   ## DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
> 
>   ## ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
> 
>   ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
> 
>   ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
> 
>   ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
> 
>   ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
> 
>   ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
> 
>   ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
> 
>   ## SUCH DAMAGE.
> 
>   ## ====================================================================
> 
>   ##
> 
>   ## This software consists of voluntary contributions made by many
> 
>   ## individuals on behalf of the Apache Software Foundation.  For more
> 
>   ## information on the Apache Software Foundation, please see
> 
>   ## <http://www.apache.org/>.
> 
>   
> 
>   """
> 
>   
> 
>   Ruper package in Python
> 
>   Ruper == Resource UPdatER
> 
>   
> 
>   """
> 
>   
> 
>   __author__  = "Apache Software Foundation"
> 
>   __status__  = "$Header: /home/cvs/jakarta-gump/proposals/aj_python/ruper/__init__.py,v 1.1 2003/08/21 19:42:01 nickchalko Exp $"
> 
>   __version__ = "$Revision: 1.1 $"
> 
>   __date__    = "$Date: 2003/08/21 19:42:01 $"
> 
>   
> 
>   import os, os.path, sys, urllib, logging
> 
>   
> 
>   # init logging
> 
>   logging.basicConfig()
> 
>   log = logging.getLogger("Ruper")
> 
>   log.setLevel(logging.DEBUG) #set verbosity to show all messages of severity >= DEBUG
> 
>    
> 
>   # Repository
> 
>   class Repository(object):
> 
>     def __init__(self,url,type):
> 
>       self.url=url
> 
>       self.type=type
> 
>   
> 
>     def resolve(self, resource):
> 
>       # FIXME (nicolaken)
> 
>       # delegate the getting of a resource to an outside file
> 
>       # named after the repository type
> 
>       if self.type == 'maven':
> 
>         # not necessarily Maven uses our resource.standardName()
> 
>         if resource.type == 'jar':
> 
>           resolvedUrl = '%s/%s/jars/%s-%s.jar' % (self.url,resource.name,resource.name,resource.version)
> 
>         else:
> 
>           raise Error, 'Unknown Resource Type; type: '+type
> 
>       else:
> 
>         raise Error, 'Unknown Repository; type: '+type
> 
>   
> 
>       return resolvedUrl
> 
>   
> 
>     def download(self, resource, destinationDir):
> 
>       if not os.path.isdir(destinationDir):
> 
>         raise IOError, 'This method needs a directory, instead it got:'+destinationDir
> 
>   
> 
>       remoteurl = self.resolve(resource)
> 
>       urllib.urlretrieve(remoteurl, '%s/%s' % (destinationDir,resource.standardName()))
> 
>   
> 
>     def update(self, resource, destinationDir):
> 
>      #download the file if not present
> 
>      if os.path.exists('%s/%s' % (destinationDir,resource.standardName())):
> 
>        log.debug('using cached file')
> 
>      else:
> 
>        log.debug('caching file...')
> 
>        download((self, resource, destinationDir))
> 
>        log.debug('...done')
> 
>   
> 
>   # Resource
> 
>   class Resource(object):
> 
>     def __init__(self,name,version,type):
> 
>       self.name=name
> 
>       self.version=version
> 
>       self.type=type
> 
>   
> 
>     def standardName(self):
> 
>       if self.type == 'jar':
> 
>         return '%s-%s.jar' % (self.name,self.version)
> 
>       else:
> 
>         raise Error, 'Unknown Resource Type; type: '+type
> 
>   
> 
>   
> 
>   if __name__=='__main__':
> 
>     os.chdir(dir.base)
> 
>     resource = Resource('log4j','1.3.4','jar')
> 
>     print resource.standardName()
> 
>     repository = Repository('http://www.ibiblio.org/maven','maven')
> 
>     print repository.resolve(resource)
> 
>     repository.update(resource,dir.cache)
> 
>   
> 
>   
> 
>   
> 
>   
>   
>   
>   1.1                  jakarta-gump/proposals/aj_python/ruper/cli.py
>   
>   Index: cli.py
>   ===================================================================
>   #!/usr/bin/python
> 
>   
> 
>   ## ====================================================================
> 
>   ##
> 
>   ## The Apache Software License, Version 1.1
> 
>   ##
> 
>   ## Copyright (c) 1999-2003 The Apache Software Foundation.  All rights
> 
>   ## reserved.
> 
>   ##
> 
>   ## Redistribution and use in source and binary forms, with or without
> 
>   ## modification, are permitted provided that the following conditions
> 
>   ## are met:
> 
>   ##
> 
>   ## 1. Redistributions of source code must retain the above copyright
> 
>   ##    notice, this list of conditions and the following disclaimer.
> 
>   ##
> 
>   ## 2. Redistributions in binary form must reproduce the above copyright
> 
>   ##    notice, this list of conditions and the following disclaimer in
> 
>   ##    the documentation and/or other materials provided with the
> 
>   ##    distribution.
> 
>   ##
> 
>   ## 3. The end-user documentation included with the redistribution, if
> 
>   ##    any, must include the following acknowlegement:
> 
>   ##       "This product includes software developed by the
> 
>   ##        Apache Software Foundation (http://www.apache.org/)."
> 
>   ##    Alternately, this acknowlegement may appear in the software itself,
> 
>   ##    if and wherever such third-party acknowlegements normally appear.
> 
>   ##
> 
>   ## 4. The names "The Jakarta Project", "Alexandria", and "Apache Software
> 
>   ##    Foundation" must not be used to endorse or promote products derived
> 
>   ##    from this software without prior written permission. For written
> 
>   ##    permission, please contact apache@apache.org.
> 
>   ##
> 
>   ## 5. Products derived from this software may not be called "Apache"
> 
>   ##    nor may "Apache" appear in their names without prior written
> 
>   ##    permission of the Apache Group.
> 
>   ##
> 
>   ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
> 
>   ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
> 
>   ## OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
> 
>   ## DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
> 
>   ## ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
> 
>   ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
> 
>   ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
> 
>   ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
> 
>   ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
> 
>   ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
> 
>   ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
> 
>   ## SUCH DAMAGE.
> 
>   ## ====================================================================
> 
>   ##
> 
>   ## This software consists of voluntary contributions made by many
> 
>   ## individuals on behalf of the Apache Software Foundation.  For more
> 
>   ## information on the Apache Software Foundation, please see
> 
>   ## <http://www.apache.org/>.
> 
>   
> 
>   """
> 
>   
> 
>   Ruper CLI
> 
>   
> 
>   """
> 
>   
> 
>   
> 
>   import os, os.path, sys, urllib, logging, ruper
> 
>   
> 
>   if __name__=='__main__':
> 
>     os.chdir('..')
> 
>     resource = ruper.Resource('log4j','1.3.4','jar')
> 
>     print resource.standardName()
> 
>     repository = ruper.Repository('http://www.ibiblio.org/maven','maven')
> 
>     print repository.resolve(resource)
> 
>     repository.update(resource,'cache')


-- 
Christopher Lenz
/=/ cmlenz at gmx.de