darthsandmann c9f3117da1 Sammlung
2016-10-16 21:53:15 +02:00

31 lines
654 B
Python

# coding: utf-8
import os
import os.path
import codecs
import json
class stream_cl(object):
exposed = True
def __init__(self):
pass
def loadCharge(self, id):
filename = str(id)
filename += '.json'
file = codecs.open(os.path.join('data', filename), 'r', 'utf-8')
charge = file.read()
file.close()
return charge
def anzChargen(self):
files = os.listdir('data')
fileCounter = 0
for file in files:
if file.endswith('.json'):
fileCounter += 1
return fileCounter