Opened 10 years ago

Last modified 8 years ago

#5059 in_progress enhancement

Switch to use argparse

Reported by: gandaro_ Owned by: berkerpeksag
Priority: minor Milestone:
Component: programming Keywords:
Cc: berkerpeksag, jakob.kramer@… Parent Tickets:

Description

Deprecated since version 2.7: The optparse module is deprecated and will not be developed further; development will continue with the argparse module.

So let’s use argparse instead.


git request-pull:

The following changes since commit fc3c8f21a08a97051a709cb1a41b4339c3748ab5:

  Patch from breton: fix #5053 (gmg addmedia broken in 0.8.0) (2015-03-05 17:45:54 -0600)

are available in the git repository at:

  https://bitbucket.org/peekpeak/mediagoblin.git optparse-deprecated

for you to fetch changes up to 9fb7ef927e23f2f186678418fc93c1fee57e9176:

  use argparse instead of optparse (2015-03-07 21:15:17 +0100)

----------------------------------------------------------------
Jakob Kramer (3):
      add a handler to logger
      VideoThumbnailMarkII was deleted, use capture_thumb
      use argparse instead of optparse

 mediagoblin/media_types/video/transcoders.py | 73 +++++++++++++---------------
 1 file changed, 33 insertions(+), 40 deletions(-)

Attachments (3)

0001-add-a-handler-to-logger.patch (759 bytes ) - added by gandaro_ 10 years ago.
0002-VideoThumbnailMarkII-was-deleted-use-capture_thumb.patch (868 bytes ) - added by gandaro_ 10 years ago.
0003-use-argparse-instead-of-optparse.patch (3.4 KB ) - added by gandaro_ 10 years ago.

Download all attachments as: .zip

Change History (8)

by gandaro_, 10 years ago

comment:1 by gandaro_, 10 years ago

Status: newreview

comment:2 by berkerpeksag, 10 years ago

Status: reviewaccepted

0003-use-argparse-instead-of-optparse.patch​ looks good. Thanks! A couple of comments:

  • help texts needs to be converted too
  • Use '-a', '--action' instead of '--action', '-a'
  • Just import "import argparse". I'm not a fan of "from ... import ..." imports :)

comment:3 by berkerpeksag, 9 years ago

Cc: berkerpeksag added
Owner: set to berkerpeksag
Status: acceptedin_progress
Summary: [PATCH] Do not use optparseSwitch to use argparse
Type: defectenhancement

comment:4 by Ben Sturmfels, 8 years ago

Priority: trivialminor

Hi Gandaro,

It looks like your patch here is very close to being able to be merged. Would you be willing to make Berker's suggested changes to finish it off?

Regards,
Ben

comment:5 by Ben Sturmfels, 8 years ago

Cc: jakob.kramer@… added

(Added Jacob to CC list)

Hi Jakob,

It looks like your patch here is very close to being able to be merged. Would you be willing to make Berker's suggested changes to finish it off?

Regards,
Ben

Note: See TracTickets for help on using tickets.