Sammlung
This commit is contained in:
35
Sammlung/Praktikum/3/ias_p2_a0.21/app/manager.py
Normal file
35
Sammlung/Praktikum/3/ias_p2_a0.21/app/manager.py
Normal file
@@ -0,0 +1,35 @@
|
||||
# coding: utf-8
|
||||
|
||||
import os
|
||||
import time
|
||||
import codecs
|
||||
import json
|
||||
|
||||
from app import stream
|
||||
|
||||
class manager_cl(object):
|
||||
exposed = True
|
||||
|
||||
def __init__(self):
|
||||
self.stream = stream.stream_cl()
|
||||
|
||||
def LIST(self):
|
||||
chargenliste = {'1': {}, '2': {}}
|
||||
filenames = os.listdir('data')
|
||||
for filename in filenames:
|
||||
if filename.endswith('.json'):
|
||||
charge = codecs.open(os.path.join('data', filename), 'r', 'utf-8')
|
||||
chargeData = eval(charge.read())
|
||||
charge.close()
|
||||
|
||||
charge_id = filename[:-5]
|
||||
chargenliste[charge_id]['chargeName'] = chargeData['info']['name']
|
||||
print(chargenliste)
|
||||
return json.dumps(chargenliste)
|
||||
|
||||
|
||||
def LOS(self, charge, los_nr):
|
||||
pass
|
||||
|
||||
def RECEIVE(self, charge):
|
||||
pass
|
Reference in New Issue
Block a user