示例#1
0
    def __init__(self, show_dialog = True):
        '''
        @input show_dialog: boolean. Do we need to ask the user what he/she wants to do?
        
        '''
        if show_dialog:
            directions = [
                '      - Type start to board a new vehicle',
                '      - type list existing boarding services'
                ]
            showDirections(directions)
            reply = get_input('What do you want to do? ').strip()

            if reply == 'start':
                self.start()
            
            elif reply == 'list':
                self.showBoardings()
示例#2
0
    def __init__(self, show_dialog = True):
        '''
        @input show_dialog: boolean. Do we need to ask the user what he/she wants to do?
        
        '''
        if show_dialog:
            directions = [
                '      - Type list to list vehicle types',
                '      - type add to add new vehicle type'
                ]
            showDirections(directions)
            reply = get_input('What do you want to do? ').strip()

            if reply == 'list':
                self.showVehicleTypes()
            
            elif reply == 'add':
                self.addVehicleType()
示例#3
0
    def __init__(self, show_dialog = True):
        '''
        Wants something to do with ferries management
        @input show_dialog : boolean. Do we need to show directions dialog?
        '''
        if show_dialog:
            directions = [
                '      - Type list to list ferries',
                '      - type add to add new ferry'
                ]
            showDirections(directions)
            reply = get_input('What do you want to do? ').strip()

            if reply == 'list':
                
                self.showFerries()
            
            elif reply == 'add':
                self.addFerry()
示例#4
0
    def __init__(self, show_dialog = True):
        '''
        
        @input show_dialog : boolean. Do we need to show directions dialog?
        '''
        if show_dialog:
            directions = [
                '      - Type list to list existing employes',
                '      - type add to add new employee randomly'
                ]
            showDirections(directions, test_mode)
            reply = get_input('What do you want to do? ').strip()

            if reply == 'list':
                
                self.showEmployees(show_dialog)
            
            elif reply == 'add':
                self.addEmployee()
示例#5
0
    def __init__(self, show_dialog = True):
        '''
        Wants something to do with routes management
        @input show_dialog : boolean. Do we need to show directions dialog?
        '''
        if show_dialog:
            directions = [
                '      - Type list to list existing routes',
                '      - type add to add new route'
                ]
            showDirections(directions, test_mode)
            reply = get_input('What do you want to do? ').strip()


            if reply == 'list':
                self.showRoutes()
            
            elif reply == 'add':
                self.addRoute()
示例#6
0
        Routes()
    
    elif command == 'nv':
        VehicleType()
    
    elif command == 'service':
        boarding_service = BoardingService(True)
    
    elif command == 'employee':
        Employee()

    else:
        #wants help
        directions = [
            '   - type create to create the database for first time',
            '   - type nv to manage vechile type',
            '   - type init to initialize the database with sample data (you will lose existing data)',
            '   - type routes to manage routes vehicles take from arrival to boarding',
            '   - type ferry to manage your ferries',
            '   - type employee to manage employees',
            '   - type service to start a new boarding service',

        ]
        showDirections(directions)