"Fossies" - the Fresh Open Source Software Archive

Member "svnchecker-0.3/checks/Log.py" (12 Mar 2008, 1370 Bytes) of package /linux/privat/old/svnchecker-0.3.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Python source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. For more information about "Log.py" see the Fossies "Dox" file reference documentation.

    1 # pylint: disable-msg=W0704
    2 
    3 # Copyright 2008 German Aerospace Center (DLR)
    4 #
    5 # Licensed under the Apache License, Version 2.0 (the "License");
    6 # you may not use this file except in compliance with the License.
    7 # You may obtain a copy of the License at
    8 #
    9 #     http://www.apache.org/licenses/LICENSE-2.0
   10 #
   11 # Unless required by applicable law or agreed to in writing, software
   12 # distributed under the License is distributed on an "AS IS" BASIS,
   13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   14 # See the License for the specific language governing permissions and
   15 # limitations under the License.
   16 
   17 """ Create a log message. """
   18 
   19 import datetime
   20 
   21 def run(transaction, config):
   22 
   23     files = transaction.getFiles()
   24 
   25     msg = "Date: " + datetime.datetime.now().strftime("%H:%M - %d.%m.%Y") + "\n"
   26     msg += "Author: " + transaction.getUserID() + "\n"
   27     msg += "Revision: " + transaction.getRevision() + "\n\n"
   28 
   29     viewVcUrl = config.getString("Log.ViewVcUrl", "")
   30     if viewVcUrl:
   31         viewVcUrl += "&view=rev&revision=" + transaction.getRevision()
   32         msg += viewVcUrl + "\n\n"
   33 
   34     msg += "Modified Files:\n"
   35     for filename, attribute in files.iteritems():
   36         msg += "%s\t%s\n" % (attribute, filename)
   37 
   38     msg += "\n"
   39 
   40     msg += "Log Message:\n"
   41     msg += transaction.getCommitMsg()
   42     msg += "\n"
   43 
   44     return (msg, 0)
   45