[mythtv-users] How to check if a tuner is in use

Hika van den Hoven hikavdh at gmail.com
Wed Oct 15 22:42:25 UTC 2014


Hoi Mike,

Thursday, October 16, 2014, 12:04:11 AM, you wrote:

> On 15/10/14 21:53, Bill Meek wrote:
>> On 10/15/2014 03:10 PM, Hika van den Hoven wrote:
>>>> ...
>>>>> parser.add_argument('--host', type=str, required=False, metavar='<hostname>',
>>>>>       help='backend hostname,  default <local hostname>')
>>>
>>>> You could just add: default='localhost' to the above. Or,
>>>> leave required=True and on the command line type --host=localhost
>>>> or whatever you choose.
>>>
>>> Ah, but I need the 'local hostname' not 'localhost'! That's what
>>> Mythtv uses. Unless you only have one combined machine.
>>
>> We must be talking about different things. The --host argument
>> is used to form the URL and should be the name of the host, as
>> in, the name in /etc/hosts. Which *may* be the same as the MythTV
>> hostname in its DB (used as a profile name.)
>>
>>
> You need to be careful using the local hostname. This may be just a host name or
> a fully-qualified domain name (including the host), neither of which may be how
> the mythtv front or back end is identified in the database!

> You have to look at config.xml and make decisions based on the contents of that
> as well. I have overrides on all my mythtv hosts, since OS upgrades gave
> inconsistent results to hostname().

Yes, I understand, but I only work with Gentoo and set it up myself,
instead of depending on a distribution. Also I have a full bind/named
dns running I keep up-to-date and /etc/hosts only contains 'localhost'
as backup and the local hostname is set as I have defined it on every
boot. In mythtv I have never set it explicitly so I can't query
config.xml. In bash I always look at the $HOSTNAME variable, which I
guess is what that function queries or at least they come from the
same source. The difference between calling hostname -s or hostname -f
at the prompt. hostname assumes hostname -s

If somehow it fails I can always add the --host argument, but I like
to always set defaults, it's friendlier than an error and ones I learn
more about python I'll add checks on domain part to remove it, if
present. But it should never be in the local hostname. It means the
system is setup incorrectly. 

Tot mails,
  Hika                            mailto:hikavdh at gmail.com

"Zonder hoop kun je niet leven
Zonder leven is er geen hoop
Het eeuwige dilemma
Zeker als je hoop moet vernietigen om te kunnen overleven!"

De lerende Mens



More information about the mythtv-users mailing list