source: trunk/Monitoring/Watch/watch @ 841

Last change on this file since 841 was 841, checked in by jripsl, 11 years ago
  • add static class initialisation function.
  • Property svn:executable set to *
File size: 1.2 KB
Line 
1#!/usr/bin/python -u
2# -*- coding: ISO-8859-1 -*-
3
4##################################
5#  @program        smon
6#  @description    simulation monitor
7#  @copyright      Copyright “(c)2009 Centre National de la Recherche Scientifique CNRS.
8#                             All Rights Reserved”
9#  @svn_file       $Id: watcher 2545 2013-02-01 09:58:10Z jripsl $
10#  @version        $Rev: 2545 $
11#  @lastrevision   $Date: 2013-02-01 10:58:10 +0100 (Fri, 01 Feb 2013) $
12#  @license        CeCILL (http://dods.ipsl.jussieu.fr/jripsl/smon/LICENSE)
13##################################
14
15from smon import dao
16
17class Watcher():
18
19        @classmethod
20        def get_fake_progress_messages(cls):
21                pass
22
23        @classmethod
24        def start(cls):
25                dao.insert_progress_messages(cls.get_fake_progress_messages())
26
27        @classmethod
28        def stop(cls):
29                pass
30 
31def main():
32
33        # parse args
34        parser = argparse.ArgumentParser(prog='watcher')
35        parser.add_argument('-v', dest='verbose',required=False,action='store_true')
36        args = parser.parse_args()
37
38        # check
39        if not os.path.exists(SMON.smon_home):
40                sys.exit(1)
41
42        SMON.init_singleton()
43
44
45
46        SMON.free_singleton()
47
48if __name__ == '__main__':
49        try:
50                main()
51
52                sys.exit(0)
53
54        except Exception, e:
55
56                #traceback.print_exc()
57
58                sys.exit(1)
Note: See TracBrowser for help on using the repository browser.