Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TIMOB-9309: BlackBerry: Convert argparse to optparse part2 #74

Merged

Conversation

alexandergalstyan
Copy link

Reviewers: DavidL, JP

ChangeLog:

  • Convert to optparse for blackberry.py blackberryndk.py scripts

Test Cases:

  • Create sample project using project.py.
  • Make sure project successfully created.
  • Make sure blackberry and blackberryndk scripts correctly run the unit testa with -t option.
  • Make sure created project can be successfully built and run.

Reviewers: DavidL, JP

ChangeLog:
- Convert to optparse for blackberry.py blackberryndk.py scripts

Test Cases:
- Create sample project using project.py.
- Make sure project successfully created.
- Make sure blackberry and blackberryndk scripts correctly run the unit testa with -t option.
- Make sure created project can be successfully built and run.
parser.add_option('--id', help='Blackberry project id', dest='id')
parser.add_option('--dir', help='Blackberry project directory', dest='dir')
parser.add_option('--ndk', help='Blackberry NDK path', dest='ndk')
parser.add_option('-t', '--test', help='run unit tests', metavar='ndk_location', action='store_const', const=True, dest='test')

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know this isn't part of your patch, but is there a reason there's metavar='ndk_location' for --test?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The reason was to format the usage saying that could be provided ndk_location with -t option. Don't know do we need that really.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But -t doesn't have a value and we provide the ndk location with --ndk

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Its for unit testing only. you can provide -t or -t with ndk path.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but I don't think that's what metavar is for. I could be wrong. Either way it doesn't seem to affect the functionality but I wanted to bring it up.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why wouldn't the ndk path just be specified using --ndk even when -t is specified? Seems like that would be more consistent. Having [--ndk ndk] [-t [ndk_location]] in the usage is confusing

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the confusion comes from having two params that take ndk.

-t shouldn't take any param and --ndk value should be used for the ndk path in all cases (normal use and unit tests).

I see no reason for specifying the ndk with the -t option

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

UPdated.

@dlifshitz-maca
Copy link

Approved

@@ -165,30 +164,30 @@ def __runUnitTests():
print '\nFinished Running Unit Tests'
UnitTest.printDetails()


Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the future please refrain from making changes to the empty lines format, it will never end if people start adding and removing empty lines back and forth to suit their personal preference.

Don't need to revert this.

@jpl-mac
Copy link

jpl-mac commented Jun 11, 2012

Maybe not for this patch, but project.py is actually the most important file that needs to be changed to use optparse, and devicemanagement.py also will need to be modified to use optparse

@jpl-mac
Copy link

jpl-mac commented Jun 11, 2012

Reviewed

@alexandergalstyan
Copy link
Author

The project.py & devicemanagement.py will be updated as a part of next patch.

Reviewers: DavidL, JP

ChangeLog:
- Convert to optparse for blackberry.py blackberryndk.py scripts

Test Cases:
- Create sample project using project.py.
- Make sure project successfully created.
- Make sure blackberry and blackberryndk scripts correctly run the unit testa with -t option.
- Make sure created project can be successfully built and run.
@alexandergalstyan
Copy link
Author

Updated

@dlifshitz-maca
Copy link

@jpl-mac for project.py we need to change it as part of merging from appcelerator to avoid conflict. I'm in the best position to do it this week. For devicemanagement.py I'm changing it as part of TIMOB-9279

@jpl-mac
Copy link

jpl-mac commented Jun 12, 2012

@dlifshitz-maca Thanks for the info, let's keep the communication flowing so the effort is not duplicated (Y)

@@ -148,8 +148,7 @@ def __unitTestTraceback():

def __runUnitTests():
from tiunittest import UnitTest

ndk = None if args.test == True else args.test
ndk = options.test
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use options.ndk instead

should also be decoded

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Reviewers: DavidL, JP

ChangeLog:
- Convert to optparse for blackberry.py blackberryndk.py scripts

Test Cases:
- Create sample project using project.py.
- Make sure project successfully created.
- Make sure blackberry and blackberryndk scripts correctly run the unit testa with -t option.
- Make sure created project can be successfully built and run.
@alexandergalstyan
Copy link
Author

Updated

@jpl-mac
Copy link

jpl-mac commented Jun 12, 2012

Approved

@dlifshitz-maca
Copy link

Re-approved

alexandergalstyan added a commit that referenced this pull request Jun 12, 2012
TIMOB-9309: BlackBerry: Convert argparse to optparse part2
@alexandergalstyan alexandergalstyan merged commit 430fab3 into Macadamian:blackberry Jun 12, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants