-
Notifications
You must be signed in to change notification settings - Fork 11
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ | |
# spaces for the tools to work correctly | ||
|
||
import os, sys, platform, subprocess, pprint, shutil | ||
from argparse import ArgumentParser | ||
from optparse import OptionParser | ||
|
||
class Device: | ||
''' TODO Mac: Look at how qde works with sim for this class ''' | ||
|
@@ -344,19 +344,21 @@ def __runUnitTests(ipAddress = None): | |
|
||
|
||
if __name__ == "__main__": | ||
parser = ArgumentParser(description = 'Prints the NDK directory and version') | ||
parser.add_argument('ndk_path', help = 'path to the blackberry ndk', nargs='?') | ||
parser.add_argument('-t', '--test', help = 'run unit tests', action = 'store_true') | ||
parser.add_argument('--ip_address', help='simulator IP address for unit tests') | ||
args = parser.parse_args() | ||
|
||
# Setup script usage using optparse | ||
parser = OptionParser(usage='[ndk_path] [-t] [--ip_address IP ADDRESS]', description='Prints the NDK directory and version') | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same question as above regarding default usage.. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The default is "blackberryndk.py [options]", which probably not what we want. |
||
|
||
parser.add_option('-t', '--test', help='run unit tests', action='store_true', dest='test') | ||
parser.add_option('--ip_address', help='simulator IP address for unit tests', dest='ip_address') | ||
(options, args) = parser.parse_args() | ||
|
||
try: | ||
ndk = BlackberryNDK(args.ndk_path) | ||
ndk = BlackberryNDK(args[0].decode('utf-8') if len(args) != 0 else None) | ||
print "BLACKBERRY_NDK=%s" % ndk.getBlackberryNdk() | ||
print "BLACKBERRY_NDK_VERSION=%s" % ndk.getVersion() | ||
except Exception, e: | ||
print >>sys.stderr, e | ||
sys.exit(1) | ||
|
||
if args.test: | ||
__runUnitTests(args.ip_address.decode('utf-8') if args.ip_address != None else None) | ||
if options.test: | ||
__runUnitTests(options.ip_address.decode('utf-8') if options.ip_address != None else None) |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -111,7 +111,7 @@ def main(): | |
|
||
if blackberry: | ||
blackberry_gen = os.path.join(template_dir,'blackberry','blackberry.py') | ||
run([sys.executable, blackberry_gen, name, appid, directory, blackberry_ndk]) | ||
run([sys.executable, blackberry_gen, '--name', name, '--id', appid, '--dir', directory, '--ndk', blackberry_ndk]) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think this should have been changed, to keep it close to what is done for other platforms. But it probably doesn't matter. |
||
|
||
# copy LICENSE and README | ||
for file in ['LICENSE','README']: | ||
|
There was a problem hiding this comment.
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.