Replace deprecated module optparse with argparse
This commit is contained in:
parent
9af14fc129
commit
8c903ebcab
|
@ -16,7 +16,7 @@
|
||||||
# You should have received a copy of the GNU General Public License along
|
# You should have received a copy of the GNU General Public License along
|
||||||
# with this program. If not, see <http://www.gnu.org/licenses/>.
|
# with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
import optparse
|
import argparse
|
||||||
import signal
|
import signal
|
||||||
|
|
||||||
from locale import gettext as _
|
from locale import gettext as _
|
||||||
|
@ -30,11 +30,11 @@ from mugshot_lib import set_up_logging, get_version, helpers
|
||||||
|
|
||||||
def parse_options():
|
def parse_options():
|
||||||
"""Support for command line options"""
|
"""Support for command line options"""
|
||||||
parser = optparse.OptionParser(version="%%prog %s" % get_version())
|
parser = argparse.ArgumentParser(description="Mugshot %s" % get_version())
|
||||||
parser.add_option(
|
parser.add_argument(
|
||||||
"-v", "--verbose", action="count", dest="verbose",
|
"-v", "--verbose", action="count", dest="verbose",
|
||||||
help=_("Show debug messages (-vv debugs mugshot_lib also)"))
|
help=_("Show debug messages (-vv debugs mugshot_lib also)"))
|
||||||
options = parser.parse_args()[0]
|
options = parser.parse_args()
|
||||||
|
|
||||||
set_up_logging(options)
|
set_up_logging(options)
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,7 @@ msgid ""
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: PACKAGE VERSION\n"
|
"Project-Id-Version: PACKAGE VERSION\n"
|
||||||
"Report-Msgid-Bugs-To: \n"
|
"Report-Msgid-Bugs-To: \n"
|
||||||
"POT-Creation-Date: 2018-08-07 06:57-0400\n"
|
"POT-Creation-Date: 2018-08-07 07:04-0400\n"
|
||||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||||
|
|
Loading…
Reference in New Issue