Sammlung
This commit is contained in:
33
Sammlung/Praktikum/3/ias_p2_a0.21/app/chargen.py
Normal file
33
Sammlung/Praktikum/3/ias_p2_a0.21/app/chargen.py
Normal file
@ -0,0 +1,33 @@
|
||||
# coding: utf-8
|
||||
|
||||
import time
|
||||
import codecs
|
||||
import json
|
||||
|
||||
from app import stream
|
||||
|
||||
class chargen_cl(object):
|
||||
exposed = True
|
||||
|
||||
chargenCounter = 1
|
||||
|
||||
def __init__(self):
|
||||
self.stream = stream.stream_cl()
|
||||
|
||||
def NEXT(self):
|
||||
if(self.chargenCounter > self.stream.anzChargen()):
|
||||
self.chargenCounter = 1
|
||||
|
||||
# timeout = 0
|
||||
# while(self.chargenCounter > self.stream.anzChargen()):
|
||||
# print(self.stream.anzChargen())
|
||||
# time.sleep(1)
|
||||
# timeout += 1
|
||||
# if(timeout > 3600):
|
||||
# return -1
|
||||
|
||||
newCharge = self.stream.loadCharge(self.chargenCounter)
|
||||
self.chargenCounter += 1
|
||||
|
||||
return json.dumps(newCharge)
|
||||
|
Reference in New Issue
Block a user