~ubuntu-branches/ubuntu/natty/ntop/natty

« back to all changes in this revision

Viewing changes to python/rrdalarm/scripts/savelog.py

  • Committer: Bazaar Package Importer
  • Author(s): Ludovico Cavedon, Jordan Metzmeier, Ludovico Cavedon
  • Date: 2010-12-15 20:06:19 UTC
  • mfrom: (5.1.5 sid)
  • Revision ID: james.westby@ubuntu.com-20101215200619-0ojz3iak95ihibun
Tags: 3:4.0.3+dfsg1-1
[ Jordan Metzmeier ]
* New upstream release (Closes: #522042)
* Move data files to /usr/share/ntop (Closes: #595450).
* Package architecture independent data in a separate ntop-data package.
* Use debhelper 7.
* Update Standards-Version to 3.9.1.
* Depend on python-mako.
* Do not include ntop.txt in binary packages as it is a copy of the man
  page.
* Do not include NEWS, as it is outdated.
* Switch to package source version 3.0 (quilt).
* Add password creation to debconf
* Changed init script to fix localization problems (thanks to Alejandro
  Varas <alej0varas@gmail.com>, LP: #257466)
* Remove manual update-rc.d calls from postrm and postinst. debhelper adds
  this for us.
* Add pre-depends on adduser for postinst script.
* Fix errors in the manpages: fix-manpage-errors.patch.
* Added fixes for matching active interfaces.
* Added a watch file.

[ Ludovico Cavedon ]
* Remove direct changes to upstream tree, and move them into specific patch
  files:
  - fix-manpage-errors.patch: fix typos in ntop.8.
  - dot-path.patch: fix path of /usr/bin/dot executable
* Add patches:
  - reduce-autogen-purged-files.patch: prevent agutogen.sh from reamoving
  too many files during cleanup.
  - Add build-without-ntop-darwin.patch, to fix compilation without
  ntop_darwin.c.
* No longer add faq.html, as it is not distributed in the upstream tarball.
* Use ${source:Version} in control file. Have ntop-data recommend
  ntop.
* Rename dirs to ntop.dirs and keep only empty directories that need
  to be created.
* Remove var/lib from ntop.install file, as it is empty (keeping it in
  ntop.dirs).
* Update po files.
* Breaks and Replaces instead of Conflitcs for ntop-data.
* Use a longer package description.
* Remove useless configure options from debian/rules.
* Move private shared libraries libraries in /usr/lib/ntop.
* Add change-plugin-dir.patch for adjusting plugin directory.
* Remove development files.
* Use system library for MochiKit.js.
* Rewrite DEP5 copyright file.
* Repackage upstream tarball in order to remove non-DFSG-compliant code. Add
  get-orig-source.sh script and get-orig-source target in debian/rules.
* Add explanation to README.Debian why geolocation is no longer working.
* Add avoid-copy-maxmind-db.patch to prevent copying of Geo*.dat
  files.
* Remove old unused patches.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
'''
 
2
Created on 19/feb/2010
 
3
 
 
4
@author: Gianluca Medici
 
5
'''
 
6
import sys, time, os.path
 
7
#this parameter defines the directory in witch the log files will be placed
 
8
pathFile='tmp/'                #Remember to set this parameter to your liking
 
9
 
 
10
def begin():
 
11
    global pathFile
 
12
    if len(sys.argv)!=5 or sys.argv[1]!= '-p' or not sys.argv[2] or sys.argv[3]!= '-t' or not sys.argv[4]:
 
13
        print 'USAGE %s -p <parameter> -t <text>' % sys.argv[0]
 
14
    else:
 
15
        filename=sys.argv[2]
 
16
        text = sys.argv[4]
 
17
        
 
18
        gmt=time.localtime(time.time())
 
19
        fmt='%a, %d %b %Y %H:%M:%S'
 
20
        st=time.strftime(fmt, gmt)
 
21
        
 
22
        try:
 
23
            logFile= open(os.path.join(pathFile,filename), 'a')
 
24
            logFile.write("Last Update time: %s\n" % st)
 
25
            
 
26
            logFile.write(text)
 
27
            logFile.close()
 
28
        except IOError:
 
29
            print>>sys.stderr,  "IOEXCEPTION writing file "+os.path.join(pathFile,filename)
 
30
            return 1
 
31
        return 0
 
32
    
 
33
'''Scripts starts here'''
 
34
begin()
 
 
b'\\ No newline at end of file'