11import argparse
22import datetime
3- import logging
43from pycamp_bot .models import Pycamp
54from pycamp_bot .models import Pycampista
65from pycamp_bot .models import PycampistaAtPycamp
76from pycamp_bot .models import models_db_connection
7+ from pycamp_bot .logger import logger
88
99
1010def parse_args ():
@@ -59,20 +59,20 @@ def parse_args():
5959
6060 if args .wich == 'pycampista' :
6161 if args .add :
62- logging .info ('Adding pycampista' )
62+ logger .info ('Adding pycampista' )
6363 pycampista = Pycampista .create (username = args .name )
6464
6565 if args .arrive :
6666 arrive_time = datetime .datetime .fromisoformat (args .arrive )
67- logging .info ('Changing arrive time to {}' .format (arrive_time ))
67+ logger .info ('Changing arrive time to {}' .format (arrive_time ))
6868 pycampista = Pycampista .select ().where (
6969 Pycampista .username == args .name )[0 ]
7070 pycampista .arrive = arrive_time
7171 pycampista .save ()
7272
7373 if args .departure :
7474 departure_time = datetime .datetime .fromisoformat (args .departure )
75- logging .info ('Changing departure time to {}' .format (departure_time ))
75+ logger .info ('Changing departure time to {}' .format (departure_time ))
7676 pycampista = Pycampista .select ().where (
7777 Pycampista .username == args .name )[0 ]
7878 pycampista .leave = departure_time
@@ -83,20 +83,20 @@ def parse_args():
8383 print (pycampista )
8484 elif args .wich == 'pycamp' :
8585 if args .add :
86- logging .info ('Adding pycamp' )
86+ logger .info ('Adding pycamp' )
8787 pycamp = Pycamp .create (headquarters = args .name )
8888
8989 if args .init :
9090 init_time = datetime .datetime .fromisoformat (args .init )
91- logging .info ('Changing init time to {}' .format (init_time ))
91+ logger .info ('Changing init time to {}' .format (init_time ))
9292 pycamp = Pycamp .select ().where (
9393 Pycamp .headquarters == args .name )[0 ]
9494 pycamp .init = init_time
9595 pycamp .save ()
9696
9797 if args .end :
9898 end_time = datetime .datetime .fromisoformat (args .end )
99- logging .info ('Changing end time to {}' .format (end_time ))
99+ logger .info ('Changing end time to {}' .format (end_time ))
100100 pycamp = Pycamp .select ().where (
101101 Pycamp .headquarters == args .name )[0 ]
102102 pycamp .end = end_time
0 commit comments