#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
#    Copyright (c) 2008 ADITAM project (contact@aditam.org)
#    License: GNU GPLv3
#
#    This file is part of the ADITAM project.
#    
#    This program is free software: you can redistribute it and/or modify
#    it under the terms of the GNU General Public License as published by
#    the Free Software Foundation, either version 3 of the License, or
#    (at your option) any later version.  See the GNU General Public License 
#    for more details.
#

___author__ = '$LastChangedBy: jschneider $'
__date__ = '$LastChangedDate: 2008-05-20 13:51:02 +0200 (Tue, 20 May 2008) $'
__version__ = '$Rev: 171 $'

from aditam.server.manager import Manager
from optparse import OptionParser
from aditam.core.watcher import Watcher
import platform

parser = OptionParser()

parser.add_option("-d", "--daemon",
        action="store_true", dest="daemon")

(options, args) = parser.parse_args()


def main():
    # TODO : remove this hack and don't use the fork in the watcher
    if platform.system().lower() != "windows" and not options.daemon:
        Watcher()
    manager = Manager()
    manager.start()

if __name__ == "__main__":
    main()
       
