Configure(3pm)

πŸ“¦
version 1.4.0 Β· 4 versions
, in debian trixie, ubuntu resolute, ubuntu stonking

✨ NAME ✨

okay so this is XMLTV::Configure πŸ’– β€” it's the configuration file handling bestie for XMLTV grabbers. she's the one who reads your config files and makes the whole "configure it from the command line" thing happen πŸŽ€


🌸 DESCRIPTION 🌸

it's a utility library, periodt. she helps grabbers do two iconic things:

  • read from configuration files πŸ“–
  • implement a configuration method that can be run straight from the command-line πŸ’…

πŸ¦‹ EXPORTED FUNCTIONS πŸ¦‹

heads up bestie: all these functions are exported on demand ✨

πŸ’œ LoadConfig

takes the name of the configuration file to load as a parameter. that's it, that's the vibe 🫢

returns a hashref with configuration fieldnames as keys. and ngl, the tea here is that the values of the hash are references to an array of values β€” not just plain values, okay? don't come for me 😭

Example:

{
  username => [ 'mattias' ],
  password => [ 'xxx' ],
  channel => [ 'svt1.svt.se', 'kanal5.se' ],
  no_channel => ['svt2.svt.se' ],
}

now listen, this part is lowkey important πŸ“’ β€” unselected options from a selectmany get collected in an entry named after the key with a prefix of no_. see the channel and no_channel entries in the example? those are the result of a selectmany with id=channel. iykyk πŸ’…

the configuration file must be in the format described in the file "ConfigurationFiles.txt". and fr fr β€” if the file does not exist, or if the format is wrong, LoadConfig returns undef. no config, no slay πŸ’€

πŸŽ€ SaveConfig

writes a configuration hash β€” in the format returned by LoadConfig β€” to a file that can be loaded back with LoadConfig. takes two parameters: a reference to a configuration hash, and a filename πŸ“

note bestie: a grabber should normally never have to call SaveConfig. this is done by the Configure-method. so like, don't do it manually, she's got it 🫢

πŸ‘‘ Configure

generates a configuration file for the grabber. main character energy tbh ✨

takes three parameters: stagesub, listsub, and the name of the configuration file.

stagesub shall be a coderef that takes a stage-name or undef and a configuration hashref as a parameter, and returns an xml-string that describes the configuration necessary for that stage. the xml-string shall follow the xmltv-configuration.dtd πŸ“œ

listsub shall be a coderef that takes a configuration hash as returned by LoadConfig as the first parameter and an option hash as returned by ParseOptions as the second parameter, and returns an xml-string containing a list of all the channels that the grabber can deliver data for using the supplied configuration. and this is the crucial bit, don't miss it πŸ‘€ β€” the listsub shall not use any channel-configuration from the hashref. none. zero. nada 🚫


Copyright (C) 2005 Mattias Holmlund.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.


and that's the whole page bestie, no notes πŸ’…βœ¨ this was pulled from perl v5.40.1, dated 2025-04-19, under the Configure(3pm) name β€” mwah, go configure something cute πŸŽ€πŸ’–

πŸ“¦ where this page comes from