Ignore:
Timestamp:
Dec 10, 2010 9:00:16 AM (13 years ago)
Author:
Ted Faber <faber@…>
Branches:
axis_example, compt_changes, info-ops, master
Children:
913dc7a
Parents:
fbee30a
git-author:
Ted Faber <faber@…> (12/09/10 11:41:45)
git-committer:
Ted Faber <faber@…> (12/10/10 09:00:16)
Message:

allow command line progams to expand tildes. Added a class derived from OptionParser? to make that easily available.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • fedd/creddy_split.py

    rfbee30a r62f3dd9  
    55import os
    66
    7 from optparse import OptionParser
    8 from federation.util import abac_split_cert, abac_pem_type
     7from federation.util import abac_split_cert, abac_pem_type, file_expanding_opts
    98
    109# Options
    11 class Parser(OptionParser):
     10class Parser(file_expanding_opts):
    1211    def __init__(self):
    13         OptionParser.__init__(self, usage="%prog [options] file.pem")
     12        file_expanding_opts.__init__(self, usage="%prog [options] file.pem")
    1413        self.add_option('--cert', dest='cert', default='./cert.pem',
     14                action='callback', callback=self.expand_file, type='str',
    1515                help='File to extract certificate into, default: [%default]')
    1616        self.add_option('--key', dest='key', default='./key.pem',
     17                action='callback', callback=self.expand_file, type='str',
    1718                help='File to extract key into, default: [%default]')
    1819        self.add_option('--force', action='store_true', dest='force',
Note: See TracChangeset for help on using the changeset viewer.