
    'g                     b    S SK Jr  S SKJrJr  S SKr\R                  " \5      r " S S\5      r	g)    )BaseCommand)fetch_fpl_datasave_fpl_dataNc                       \ rS rSrSrS rSrg)Command   zFetches and updates FPL datac                    U R                   R                  U R                  R                  S5      5        [        R                  S5        [        5       nU(       aU  [        U5        U R                   R                  U R                  R                  S5      5        [        R                  S5        gU R                   R                  U R                  R                  S5      5        [        R                  S5        g)z2
Fetches FPL data, saves it, and logs the result.
zFetching FPL data...zFPL data updated successfully.zFailed to fetch FPL data.N)
stdoutwritestyleSUCCESSloggerinfor   r   ERRORerror)selfargsoptionsdatas       XG:\Python Projects\Fantasy API\fantasy_data\management\commands\run_fantasy_scheduler.pyhandleCommand.handle   s     	$**,,-CDE*+$KKdjj001QRSKK89KKdjj../JKLLL45     N)__name__
__module____qualname____firstlineno__helpr   __static_attributes__r   r   r   r   r      s    )D6r   r   )
django.core.management.baser   fantasy_data.tasksr   r   logging	getLoggerr   r   r   r   r   r   <module>r%      s*    3 < 			8	$6k 6r   