Module Import alias Import alias Import alias Import alias Import alias Import alias Import alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias FunctionDef arguments args defaults body Expr Str Assign NameStore Dict Str Str Str Str Call AttributeLoad AttributeLoad NameLoad attr attr Str Str Call AttributeLoad AttributeLoad NameLoad attr attr Call AttributeLoad AttributeLoad NameLoad attr attr Str Str Str Str Return SubscriptLoad NameLoad Index Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str While NameLoad body Expr Call AttributeLoad NameLoad attr Str Assign NameStore Call NameLoad NameLoad If CompareGt Call AttributeLoad NameLoad attr Num body Expr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Num decorator_list FunctionDef arguments args NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr Str Assign NameStore Call AttributeLoad NameLoad attr keyword NameLoad keyword TupleLoad NameLoad Assign AttributeStore NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr keyword NameLoad keyword TupleLoad NameLoad Assign AttributeStore NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Num decorator_list If CompareEq NameLoad Str body Assign NameStore Call NameLoad Expr Call AttributeLoad NameLoad attr Str Str keyword Str keyword Str keyword Str Expr Call AttributeLoad NameLoad attr Str Str keyword Str keyword Str keyword NameLoad keyword Str Expr Call AttributeLoad NameLoad attr Str Str keyword Str keyword Str keyword NameLoad keyword Str Expr Call AttributeLoad NameLoad attr keyword Call AttributeLoad AttributeLoad NameLoad attr attr Str Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr If UnaryOpNot Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr body Print Call AttributeLoad Str attr AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Num Assign NameStore Call AttributeLoad NameLoad attr keyword Dict Str Str Str Str Str AttributeLoad NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr Str Str Call NameLoad Str TryExcept body Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr handlers ExceptHandler type AttributeLoad NameLoad attr body Print Call AttributeLoad Str attr keyword AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Num Assign NameStore Str Expr Call AttributeLoad NameLoad attr keyword Call AttributeLoad NameLoad attr Str Str keyword NameLoad keyword AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr Str For NameStore Call AttributeLoad NameLoad attr Str body Expr Call AttributeLoad NameLoad attr Call AttributeLoad Str attr SubscriptLoad NameLoad Index Num SubscriptLoad NameLoad Index Num If AttributeLoad NameLoad attr body Assign NameStore Call NameLoad NameLoad Expr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Num If BoolOpOr UnaryOpNot Call AttributeLoad AttributeLoad NameLoad attr attr Call AttributeLoad NameLoad attr Str Str AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr Str Assign NameStore Call NameLoad NameLoad Expr Call AttributeLoad NameLoad attr Print Str Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Num Expr Call AttributeLoad NameLoad attr Call AttributeLoad Str attr keyword Call AttributeLoad NameLoad attr Str Str keyword Call AttributeLoad NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr Call AttributeLoad NameLoad attr Str Str Assign NameStore Call NameLoad NameLoad
N/A N/A os N/A sys N/A platform N/A logging N/A time N/A threading N/A ConfigParser optparse OptionParser plex_scrobble.lastfm LastFm plex_scrobble.plex_monitor monitor_log plex_scrobble.scrobble_cache ScrobbleCache plex_scrobble.pre_check PLSSanity platform_log_directory N/A N/A N/A N/A N/A 
    Retrieves the default platform specific default log location.
    This is called if the user does not specify a log location in
    the configuration file.
    github issue https://github.com/jesseward/plex-lastfm-scrobbler/issues/5
     N/A LOG_DEFAULTS N/A Darwin Linux Windows FreeBSD N/A N/A N/A os path expanduser ~/Library/Logs/Plex Media Server.log /var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Logs/Plex Media Server.log N/A N/A N/A os path join N/A N/A N/A os environ get LOCALAPPDATA c: Plex Media Server/Logs/Plex Media Server.log /usr/local/plexdata/Plex Media Server/Logs/Plex Media Server.log N/A N/A LOG_DEFAULTS N/A N/A N/A platform system N/A cache_retry N/A N/A config N/A N/A N/A 
    Thread timer for the cache retry logic.

    :param config: config (ConfigParser obj)
     N/A True N/A N/A N/A N/A logger info starting cache_retry thread. N/A cache N/A ScrobbleCache config N/A N/A N/A N/A cache length 0 N/A N/A N/A N/A cache retry_queue N/A N/A N/A cache close N/A N/A N/A time sleep 3600 N/A main N/A N/A config N/A N/A N/A 
    The main thread loop

    :param config: config (ConfigParser obj)
     N/A N/A N/A logger info starting log monitor thread. N/A log_watch N/A N/A threading Thread target monitor_log args N/A config N/A N/A log_watch daemon True N/A N/A N/A log_watch start N/A cache_thread N/A N/A threading Thread target cache_retry args N/A config N/A N/A cache_thread daemon True N/A N/A N/A cache_thread start N/A N/A N/A log_watch join N/A N/A N/A cache_thread join N/A N/A N/A sys exit 1 N/A N/A N/A __name__ __main__ N/A N/A p N/A OptionParser N/A N/A N/A p add_option -c --config action store dest config_file help The location to the configuration file. N/A N/A N/A p add_option -p --precheck action store_true dest precheck default False help Run a pre-check to ensure a correctly configured system. N/A N/A N/A p add_option -a --authenticate action store_true dest authenticate default False help Generate a new last.fm session key. N/A N/A N/A p set_defaults config_file N/A N/A N/A os path expanduser ~/.config/plex-lastfm-scrobbler/plex_scrobble.conf N/A N/A options args N/A N/A p parse_args N/A N/A N/A N/A N/A os path exists N/A options config_file N/A N/A N/A N/A Exiting, unable to locate config file {0}. use -c to specify config target format N/A options config_file N/A N/A N/A sys exit 1 N/A config N/A N/A ConfigParser ConfigParser defaults N/A config file location session mediaserver_url mediaserver_log_location log_file N/A options config_file N/A N/A N/A os path expanduser ~/.config/plex-lastfm-scrobbler/session_key http://localhost:32400 N/A platform_log_directory /tmp/plex_scrobble.log N/A N/A N/A N/A N/A config read N/A options config_file N/A N/A N/A N/A ConfigParser Error N/A N/A N/A N/A ERROR: unable to parse config file "{file}". Syntax error? format file N/A options config_file N/A N/A N/A sys exit 1 N/A FORMAT %(asctime)-15s [%(process)d] [%(name)s %(funcName)s] [%(levelname)s] %(message)s N/A N/A N/A logging basicConfig filename N/A N/A config get plex-scrobble log_file format FORMAT level N/A logging DEBUG N/A logger N/A N/A logging getLogger main N/A key N/A N/A config items plex-scrobble N/A N/A N/A N/A logger debug N/A N/A config : {0} -> {1} format N/A key N/A 0 N/A key N/A 1 N/A N/A options precheck N/A N/A pc N/A PLSSanity config N/A N/A N/A pc run N/A N/A N/A logger warn Precheck completed. Exiting. N/A N/A N/A sys exit 0 N/A N/A N/A N/A N/A N/A os path exists N/A N/A config get plex-scrobble session N/A options authenticate N/A N/A N/A N/A logger info Prompting to authenticate to Last.fm. N/A last_fm N/A LastFm config N/A N/A N/A last_fm last_fm_auth N/A Please relaunch plex-scrobble service. N/A N/A N/A logger warn Exiting application. N/A N/A N/A sys exit 0 N/A N/A N/A logger debug N/A N/A using last.fm session key={key} , st_mtime={mtime} format key N/A N/A config get plex-scrobble session mtime N/A N/A time ctime N/A N/A N/A os path getmtime N/A N/A config get plex-scrobble session N/A m N/A main config