Exemplo n.º 1
0
def main():
    """Main entry point for script."""

    # Declarations of Option Parser : https://docs.python.org/2/library/optparse.html
    parser = OptionParser(version="1.0")
    parser.add_option("-l", "--list", help="the plugin list", action="store_true", dest="list", default=False)
    parser.add_option("-a", "--action", help="the action you want to execute", dest="action", default="status")
    parser.add_option("--verbose", help="show executed commands", action="store_true", dest="debug", default=False)
    (options, args) = parser.parse_args()

    # Show the plugin list
    if options.list:
        app.show_plugins()
        return True

    # Enable the debugging
    if options.debug:
        app.enable_debug()

    # Calling the main function
    app.main(options, args)
Exemplo n.º 2
0
def main():
    """Main entry point for script."""

    # Declarations of Option Parser : https://docs.python.org/2/library/optparse.html
    parser = OptionParser(version="1.0")
    group = OptionGroup(parser, "Specific Options", "Your application parameters")
    group.add_option("-v", "--view", help="Show this software version", action="store_true", dest="view", default=False)
    group.add_option("-n", "--name", dest="name", help="Set a name")
    parser.add_option_group(group)
    (options, args) = parser.parse_args()

    # You're actions
    if options.view:
        print "What a great view"
        return True

    # You're actions
    if options.name:
        app.set_name(options.name)

    # Calling the main function
    app.main(args)
Exemplo n.º 3
0
from src.app import main

if __name__ == "__main__":
    main()
Exemplo n.º 4
0
from src import app

app.main()
Exemplo n.º 5
0
from flask_lambda import FlaskLambda
from src.app import main

http_server = main(FlaskLambda)
Exemplo n.º 6
0
#!/usr/bin/env python

import wx
import sys
from src import app
import inspect

if __name__ == "__main__":
	app.main(sys.argv)
	#test(sys.argv)
Exemplo n.º 7
0
import sys
from src.app import main


if __name__ == '__main__':
    sys.exit(main())

Exemplo n.º 8
0
import curses
import os
import src.app as app


if __name__ == "__main__":

    """ Set the curses screen and working path """

    working_path = os.path.dirname(os.path.abspath(__file__))
    myscreen = curses.initscr()
    curses.start_color()
    myscreen.nodelay(1)
    try:
        curses.noecho()
        curses.curs_set(0)

        exc = app.main(myscreen, working_path)
    finally:
        curses.echo()
        curses.endwin()

    if exc is not None:
        print(exc)
Exemplo n.º 9
0
def test_app():
    with open("replied.txt", "w+"), open("subscribed.txt", "w+"):
        pass

    app.main(False, test)
Exemplo n.º 10
0
import os
import sys

from src import app


# https://stackoverflow.com/questions/7674790/bundling-data-files-with-pyinstaller-onefile
def resource_path(relative_path):
    """ Get absolute path to resource, works for dev and for PyInstaller """
    try:
        # PyInstaller creates a temp folder and stores path in _MEIPASS
        base_path = sys._MEIPASS
    except Exception:
        base_path = os.path.abspath(".")

    return os.path.join(base_path, relative_path)


if __name__ == "__main__":

    app.main(icon=resource_path("./icon.ico"))
Exemplo n.º 11
0
def test_app():
    with open("replied.txt", "w+"), open("subscribed.txt", "w+"):
        pass

    app.main(True, test, "memeadviser.log")
Exemplo n.º 12
0
Arquivo: start.py Projeto: HZS-Api/Api
from flask import Flask
from src.app import main

http_server = main(Flask)
Exemplo n.º 13
0
from src.app import parse_argument, main

if __name__ == '__main__':
    args = parse_argument()
    main(args)