Giter Club home page Giter Club logo

Comments (2)

pannal avatar pannal commented on May 5, 2024

... so defining a path for the config, better: even the ability to override the config would help :)

from python-plexapi.

pkkid avatar pkkid commented on May 5, 2024

The config file is just a convenient way to default a few settings. Everything the config file sets is easily accessible and able to be over-ridden in the plexapi.init file. For example, you can set the default timeout by just setting plexapi.TIMEOUT to some other value.

import plexapi
plexapi.TIMEOUT = 30
plexapi.X_PLEX_PLATFORM = 'my awesome app'
...continue...

PlexAPI is using the standard logging module. So you can easily set the log settings as you normally would in other Python projects even without the config file.

import logging
from logging.handlers import RotatingFileHandler
plexlog = logging.getLogger('plexapi')
loghandler = RotatingFileHandler('/tmp/plexlog.log', 'a', 512000, 3)
plexlog.addHandler(loghandler)
...continue...

I just committed a small change that allows you to call a convenience function to reset the BASE_HEADERS if you want to change some of the X_PLEX header information. So you do something like this.

import plexapi
plexapi.X_PLEX_DEVICE = 'My Awesome Windows Box'
plexapi.BASE_HEADERS = plexapi.reset_base_headers()
...continue...

commit c76c69c
Author: Michael Shepanski [email protected]
Date: Tue Mar 15 23:47:13 2016 -0400
Convenience function to reset_base_headers is overriding X_PLEX headers

from python-plexapi.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.