Kovács Bence
3e1f331e03
All checks were successful
continuous-integration/drone/push Build is passing
54 lines
1.1 KiB
Python
54 lines
1.1 KiB
Python
#!/usr/bin/env python
|
|
|
|
# IDE JÖNNEK IMPORTOK
|
|
import random
|
|
import string
|
|
|
|
"""
|
|
Main Flask RESTful API
|
|
"""
|
|
|
|
__author__ = "@tormakris"
|
|
__copyright__ = "Copyright 2020, GoldenPogácsa Team"
|
|
__module_name__ = "messagesender"
|
|
__version__text__ = "1"
|
|
|
|
class MessageSender:
|
|
"""
|
|
Üzenetek küldéséért felelős komponens.
|
|
"""
|
|
id
|
|
|
|
def __init__(self):
|
|
"""
|
|
Inicializálja az osztályt.
|
|
"""
|
|
self.id = 0
|
|
pass
|
|
|
|
|
|
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))
|