Ejemplo n.º 1
0
def run():
    app = Framework()
    try:
        app.load_banner()
        app.cmdloop()
    except KeyboardInterrupt:
        print("Exception occur, use 'quit' command to quit")
Ejemplo n.º 2
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()
Ejemplo n.º 3
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]))
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',
Ejemplo n.º 5
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:"
Ejemplo n.º 6
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]

        subprocess.Popen('bokeh serve', shell=True)
        time.sleep(2)

        pipeline = Kcwi_pipeline()
        framework = Framework(pipeline, 'config.cfg')
        framework.config.instrument = ConfigClass("instr.cfg")
        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]))