Exemplo n.º 1
0
def main():
    filename = sys.argv[-1]  # Get the last agument passed to the file name
    if filename == "main.py":
        print("Error: No database passed to file")
        print("Exiting program...")
        sys.exit()
    path = "./" + filename
    db.connect(path)

    isQuit = False
    while not isQuit:
        start()
        mainMenu()
        clear_screen()
        db.cur_user = None  # User has logged out, set user to none
Exemplo n.º 2
0
        def run (self):
                global status
                while True:
                        if(GPIO.input(11) == True and status == 0):
                                print("switch ON and recorvva is off - starting ReCoRVVA")
                                status = 1
				startup.start()
                                comms.Comms().start()
                                Ping().start()
                                Temp().start()

                        if(GPIO.input(11) == False and status == 1):
                                print("switch OFF and recorvva on - killing ReCoRVVA")
				status = 0
				os.system("for x in `jobs -p`; do sudo kill -9 $x; done; sudo killall python")
                                sys.exit()
Exemplo n.º 3
0
import sys

if sys.modules.has_key("django"):
    from django.conf import settings
    import startup

    startup.start(settings)
Exemplo n.º 4
0
def install_assets():
    """ Installs all required assets to begin with """
    from startup import start
    start()
Exemplo n.º 5
0
        self.graph_schedule(self.best_classes)


class ClassRow():
    def __init__(self, parent_list=MainApp.class_rows, color=(.97, .97, .97, 1), **kwargs):
        self.parent_list = parent_list
        if 'class_name' in kwargs:
            self.class_name = kwargs['class_name'].upper()
        else:
            self.class_name = ''
        if 'widget' in kwargs:
            self.layout = BoxLayout(size_hint=(1, None), height=50)
            self.widget = kwargs['widget']
            self.label = MyLabel(text=self.class_name, halign='center', valign='center',
                                 size_hint=(.6, None), background_color=color,
                                 height=50)
            self.button = MyButton(text='Remove', size_hint=(.4, None), height=50)
            self.button.bind(on_press=self.destroy)
            self.layout.add_widget(self.label)
            self.layout.add_widget(self.button)
            kwargs['widget'].add_widget(self.layout)

    def destroy(self, value):
        self.widget.remove_widget(self.layout)
        self.parent_list.remove(self)


if __name__ == '__main__':
    startup.start()
    MainApp().run()