MessageSender skeleton
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Kovács Bence János 2020-03-29 16:33:18 +02:00
parent bc079ac609
commit 3e1f331e03

View File

@ -1,6 +1,8 @@
#!/usr/bin/env python
#IDE JÖNNEK IMPORTOK
# IDE JÖNNEK IMPORTOK
import random
import string
"""
Main Flask RESTful API
@ -15,17 +17,37 @@ class MessageSender:
"""
Üzenetek küldéséért felelős komponens.
"""
id
def __init__(self):
"""
Inicializálja az osztályt.
"""
self.id = 0
pass
def cucc(self, szam: int, szoveg: str) -> str:
def randomString(self, stringLength):
"""Generate a random string of fixed length """
letters = string.ascii_lowercase
return ''.join(random.choice(letters) for i in range(stringLength))
def CreateMessage(self, p) -> str:
"""
Ez egy metodus
:param szam:
:param szoveg:
:return: str tipus
"""
self.id += random.randrange(10000)
data = self.randomString(p)
#print(str(self.id) + " " + str(data))
return str(self.id) + " " + str(data)
pass
if __name__ == "__main__":
temp = MessageSender()
print(temp.CreateMessage(20))