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

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


Hoi Hika,

Wednesday, October 15, 2014, 10:10:34 PM, you wrote:

> Hoi Bill,

> Wednesday, October 15, 2014, 9:45:50 PM, you wrote:

>> On 10/15/2014 02:11 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.

Changed the parser-code to:

parser.add_argument('--card', type=str, required=False, metavar='<device>', default='/dev/video0',
    help='tv capture device, default </dev/video0>')

parser.add_argument('--host', type=str, required=False, metavar='<hostname>', default=socket.gethostname(),
    help='backend hostname,  default <local hostname>')

args = parser.parse_args()
card = args.card
host = args.host

So I can use a function as the default!


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