mirror of
https://gitlab.com/0xDEAD10CC/pycoindroid
synced 2025-08-19 11:49:18 -07:00
Initial commit
This commit is contained in:
commit
310b1ae5e4
6 changed files with 346 additions and 0 deletions
30
src/main.py
Normal file
30
src/main.py
Normal file
|
@ -0,0 +1,30 @@
|
|||
# pycoindroid v0.1
|
||||
# © 2017 DEAD10CC <0x@DEAD10.CC>
|
||||
# a dumb hack on Coindroids
|
||||
|
||||
import gevent, logging
|
||||
from gevent.event import Event
|
||||
from Currency import CurrencyTask
|
||||
from Event import EventTask
|
||||
|
||||
formatter = logging.Formatter('%(asctime)s - %(name)s %(funcName)s():%(lineno)d - %(levelname)s - %(message)s')
|
||||
logger = logging.getLogger()
|
||||
logger.setLevel(logging.DEBUG)
|
||||
ch = logging.StreamHandler()
|
||||
ch.setLevel(logging.DEBUG)
|
||||
ch.setFormatter(formatter)
|
||||
logger.addHandler(ch)
|
||||
|
||||
|
||||
def main():
|
||||
logger = logging.getLogger(__name__)
|
||||
while True:
|
||||
logger.info("Starting main loop...")
|
||||
eventsEvent = Event()
|
||||
currencyTask = CurrencyTask.spawn(eventsEvent=eventsEvent)
|
||||
eventTask = EventTask.spawn(eventsEvent=eventsEvent)
|
||||
gevent.joinall([currencyTask, eventsEvent])
|
||||
logger.error("Main loop ended... This shouldn't happen?")
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
Loading…
Add table
Add a link
Reference in a new issue