Exemplo n.º 1
0
def main():
    framework = Framework()
    try:
        framework.run(sys.argv[1:])
    except KeyboardInterrupt:
        framework.ctrlc()
    except Exception as e:
        exc_type, exc_value, exc_traceback = sys.exc_info()
        print "*** print_tb:"
        traceback.print_tb(exc_traceback, limit=1, file=sys.stdout)
        print
        print
        print "*** print_exception:"
        traceback.print_exception(exc_type, exc_value, exc_traceback,
                                  limit=2, file=sys.stdout)
        print
        print
        print "*** print_exc:"
        traceback.print_exc()
Exemplo n.º 2
0
def run():
    app = Framework()
    try:
        app.load_banner()
        app.cmdloop()
    except KeyboardInterrupt:
        print("Exception occur, use 'quit' command to quit")
Exemplo n.º 3
0
def main():
    framework = Framework()
    try:
        framework.run(sys.argv[1:])
    except KeyboardInterrupt:
        framework.ctrlc()
    except Exception as e:
        exc_type, exc_value, exc_traceback = sys.exc_info()
        print "*** print_tb:"
        traceback.print_tb(exc_traceback, limit=1, file=sys.stdout)
        print
        print
        print "*** print_exception:"
        traceback.print_exception(exc_type,
                                  exc_value,
                                  exc_traceback,
                                  limit=2,
                                  file=sys.stdout)
        print
        print
        print "*** print_exc:"
        traceback.print_exc()
Exemplo n.º 4
0
from pipelines.kcwi_pipeline import Kcwi_pipeline
from models.arguments import Arguments
import subprocess
import time

#
# Local functions
#

if __name__ == '__main__':

    if len(sys.argv) >= 1:
        #path = sys.argv[1]

        pipeline = Kcwi_pipeline()
        framework = Framework(pipeline, 'KCWI_config.cfg')
        framework.config.instrument = ConfigClass("instr.cfg")
        if framework.config.instrument.interactive >= 1:
            subprocess.Popen('bokeh serve', shell=True)
            time.sleep(2)

        framework.logger.info("Framework initialized")

        framework.start_http_server()
        framework.logger.info("HTTP server started")

        framework.start()
        framework.waitForEver()
    else:
        print("Usage {} dir_or_file".format(sys.argv[0]))
Exemplo n.º 5
0
Arquivo: spf.py Projeto: DarthRa/SPF
#!/usr/bin/env python
"""
Standard Launcher for the spf (Speed Phishing Framework)
"""

import sys, traceback

from core.framework import Framework

if __name__ == "__main__":
    framework = Framework()
    try:
        framework.run(sys.argv[1:])
    except KeyboardInterrupt:
        framework.ctrlc()
    except Exception as e:
        exc_type, exc_value, exc_traceback = sys.exc_info()
        print "*** print_tb:"
        traceback.print_tb(exc_traceback, limit=1, file=sys.stdout)
        print
        print
        print "*** print_exception:"
        traceback.print_exception(exc_type, exc_value, exc_traceback,
                              limit=2, file=sys.stdout)
        print
        print
        print "*** print_exc:"
        traceback.print_exc()
        #print
        #print
        #print "*** format_exc, first and last line:"
import glob

from core.framework import Framework

from pipelines.fits2png_pipeline_with_actions import Fits2png_pipeline_with_actions
from models.arguments import Arguments

import time

if __name__ == '__main__':

    if len(sys.argv) >= 2:
        path = sys.argv[1]

        pipeline = Fits2png_pipeline_with_actions()
        framework = Framework(pipeline, "config.cfg")

        framework.logger.info("Framework initialized")

        if os.path.isdir(path):
            flist = glob.glob(path + '/*.fits')
            for f in flist:
                args = Arguments(name=f)
                framework.append_event('next_file', args)

            out_dir = self.config.output_directory
            out_name = 'test_w_actions.html'
            framework.append_event(
                'contact_sheet',
                Arguments(dir_name=out_dir,
                          pattern='*.png',
Exemplo n.º 7
0
#!/usr/bin/env python3
"""
Standard Launcher for the spf (Speed Phishing Framework)
"""

import sys, traceback

from core.framework import Framework

if __name__ == "__main__":
    framework = Framework()
    try:
        framework.run(sys.argv[1:])
    except KeyboardInterrupt:
        framework.ctrlc()
    except Exception as e:
        exc_type, exc_value, exc_traceback = sys.exc_info()
        print("*** print_tb:")
        traceback.print_tb(exc_traceback, limit=1, file=sys.stdout)
        print()
        print()
        print("*** print_exception:")
        traceback.print_exception(exc_type, exc_value, exc_traceback,
                              limit=2, file=sys.stdout)
        print()
        print()
        print("*** print_exc:")
        traceback.print_exc()
        #print
        #print
        #print "*** format_exc, first and last line:"
Exemplo n.º 8
0
#!/usr/bin/env python
"""
Standard Launcher for the spf (Speed Phishing Framework)
"""

import sys

from core.framework import Framework

if __name__ == "__main__":
    framework = Framework()
    try:
        framework.run(sys.argv[1:])
    except KeyboardInterrupt:
        framework.cleanup()
Exemplo n.º 9
0
from config.framework_config import ConfigClass
from pipelines.ccd_basic_pipeline import ccd_basic_pipeline
from models.arguments import Arguments

#
# Local functions
#

if __name__ == '__main__':

    if len(sys.argv) >= 2:
        path = sys.argv[1]

        pipeline = ccd_basic_pipeline()
        framework = Framework(pipeline, "config.cfg")
        framework.config.instrument = ConfigClass("instr.cfg")
        framework.logger.info("Framework initialized")

        if os.path.isdir(path):
            flist = glob.glob(path + '/*.fits')
            for f in flist:
                args = Arguments(name=f)
                framework.append_event('next_file', args)

        else:
            framework.logger.info("Exepected directory")

        framework.start()
        framework.waitForEver()
    else:
'''
Created on Jul 8, 2019

@author: skwok
'''

from core.framework import Framework
from pipelines.test_pipeline import Test_pipeline
from models.arguments import Arguments

import time

if __name__ == '__main__':
    pipeline = Test_pipeline()
    framework = Framework(pipeline, "config.cfg")

    framework.logger.info("Framwork initialized")
    framework.start()

    framework.append_event('event1', Arguments())

    framework.waitForEver()

    framework.logger.warning("Terminating")
Exemplo n.º 11
0
#!/usr/bin/python
#Test framework

import sys
from core.framework import Framework

if __name__ == "__main__":
    framework = Framework()
    framework.run(sys.argv[1:])