-
Notifications
You must be signed in to change notification settings - Fork 0
/
lab.py
47 lines (37 loc) · 1.2 KB
/
lab.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#########################################
# This project is a lab assignment #
# for the Essential Skills Module. #
# University of Amsterdam #
# MSc in System and Network Engineering #
# Nick Trintafyllidis. #
# Use it as you wish :) #
#########################################
import workstation
class Lab(object):
def __init__(self):
self.name = "B1.23 Lab"
self.workstations = []
self.connections = []
def add_workstation(self,name,connection,owner):
temp = workstation.Workstation()
temp.name_it(name)
temp.connect(connection)
temp.assign(owner)
self.workstations.append(temp)
def connect(self, connection):
self.connections.append(connection)
def printinfo(self):
print "*****"
print self.name
print "Machines:"
for i in self.workstations:
print i.name + " " + i.owner + " " + i.connection
print "Connected to:"
for i in self.connections:
print i
print "*****"
def printall(self):
self.printinfo()
print "\t"
for i in self.workstations:
i.printall()