Skip to content

Commit

Permalink
Resolves issue #461: Deprecated module optparse is used
Browse files Browse the repository at this point in the history
  • Loading branch information
jriyyya authored and quozl committed Mar 10, 2023
1 parent 8c21577 commit ab3ffc2
Showing 1 changed file with 19 additions and 18 deletions.
37 changes: 19 additions & 18 deletions src/sugar3/activity/activityinstance.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
sys.setdefaultencoding('utf-8')

import gettext
from optparse import OptionParser
from argparse import ArgumentParser

import dbus
import dbus.service
Expand Down Expand Up @@ -92,23 +92,24 @@ def main():
'a directory containing a Sugar Activity [activity dir], a '\
'[python_class], or both.'

parser = OptionParser(usage=usage, epilog=epilog)
parser.add_option('-b', '--bundle-id', dest='bundle_id',
help='identifier of the activity bundle')
parser.add_option('-a', '--activity-id', dest='activity_id',
help='identifier of the activity instance')
parser.add_option('-o', '--object-id', dest='object_id',
help='identifier of the associated datastore object')
parser.add_option('-u', '--uri', dest='uri',
help='URI to load')
parser.add_option('-s', '--single-process', dest='single_process',
action='store_true',
help='start all the instances in the same process')
parser.add_option('-i', '--invited', dest='invited',
action='store_true', default=False,
help='the activity is being launched for handling an '
'invite from the network')
(options, args) = parser.parse_args()
parser = ArgumentParser(usage=usage, epilog=epilog)
parser.add_argument('-b', '--bundle-id', dest='bundle_id',
help='identifier of the activity bundle')
parser.add_argument('-a', '--activity-id', dest='activity_id',
help='identifier of the activity instance')
parser.add_argument('-o', '--object-id', dest='object_id',
help='identifier of the associated datastore object')
parser.add_argument('-u', '--uri', dest='uri',
help='URI to load')
parser.add_argument('-s', '--single-process', dest='single_process',
action='store_true',
help='start all the instances in the same process')
parser.add_argument('-i', '--invited', dest='invited',
action='store_true', default=False,
help='the activity is being launched for handling an '
'invite from the network')

options = parser.parse_args()

logger.start()

Expand Down

0 comments on commit ab3ffc2

Please sign in to comment.