Permalink
Browse files

Added --version option to commands

- Version 5.6.0
  • Loading branch information...
1 parent 1aa6f8a commit 1c72574640e3ba996264da07b1d13a2071a316dc @dtmilano committed May 14, 2014
Showing with 19 additions and 5 deletions.
  1. +1 −1 AndroidViewClient/setup.py
  2. +9 −2 AndroidViewClient/tools/culebra
  3. +9 −2 AndroidViewClient/tools/dump
@@ -3,7 +3,7 @@
from setuptools import setup, find_packages
setup(name='androidviewclient',
- version='5.5.0',
+ version='5.6.0',
description='''AndroidViewClient is a 100% pure python tool that
simplifies test script creation providing higher level operations and the ability of
obtaining the tree of Views present at any given moment on the device or emulator screen.
@@ -19,7 +19,7 @@ ___________________/ /__/ /__/ /__/ /________________________________
'''
-__version__ = '5.5.0'
+__version__ = '5.6.0'
import re
import sys
@@ -41,6 +41,7 @@ from com.dtmilano.android.viewclient import ViewClient, View
HELP = 'help'
VERBOSE = 'verbose'
+VERSION = 'version'
IGNORE_SECURE_DEVICE = 'ignore-secure-device'
FORCE_VIEW_SERVER_USE = 'force-view-server-use'
DO_NOT_START_VIEW_SERVER = 'do-not-start-view-server'
@@ -65,7 +66,7 @@ SAVE_VIEW_SCREENSHOTS = 'save-view-screenshots'
USAGE = 'usage: %s [OPTION]... [serialno]'
SHORT_OPTS = 'HVIFSkw:i:t:d:rCUj:D:K:R:a:o:Aps:v:'
-LONG_OPTS = [HELP, VERBOSE, IGNORE_SECURE_DEVICE, FORCE_VIEW_SERVER_USE, DO_NOT_START_VIEW_SERVER,
+LONG_OPTS = [HELP, VERBOSE, VERSION, IGNORE_SECURE_DEVICE, FORCE_VIEW_SERVER_USE, DO_NOT_START_VIEW_SERVER,
DO_NOT_IGNORE_UIAUTOMATOR_KILLED,
WINDOW + '=',
FIND_VIEWS_BY_ID + '=', FIND_VIEWS_WITH_TEXT + '=', FIND_VIEWS_WITH_CONTENT_DESCRIPTION + '=',
@@ -167,6 +168,10 @@ def help():
print >> sys.stderr, o
sys.exit(0)
+def version():
+ print progname, __version__
+ sys.exit(0)
+
def autoRegexpsHelp():
print >> sys.stderr, "Available %s options:" % AUTO_REGEXPS
print >> sys.stderr, "\thelp: prints this help"
@@ -379,6 +384,8 @@ for o, a in optlist:
help()
elif o in ['V', VERBOSE]:
kwargs1[VERBOSE] = True
+ elif o in [VERSION]:
+ version()
elif o in ['I', IGNORE_SECURE_DEVICE]:
kwargs1['ignoresecuredevice'] = True
elif o in ['F', FORCE_VIEW_SERVER_USE]:
@@ -6,7 +6,7 @@ Created on Feb 3, 2012
@author: diego
'''
-__version__ = '5.5.0'
+__version__ = '5.6.0'
import sys
import os
@@ -21,6 +21,7 @@ from com.dtmilano.android.viewclient import ViewClient
HELP = 'help'
VERBOSE = 'verbose'
+VERSION = 'version'
IGNORE_SECURE_DEVICE = 'ignore-secure-device'
FORCE_VIEW_SERVER_USE = 'force-view-server-use'
DO_NOT_START_VIEW_SERVER = 'do-not-start-view-server'
@@ -38,7 +39,7 @@ MAP = {'i':ViewClient.TRAVERSE_CITUI, UNIQUE_ID:ViewClient.TRAVERSE_CITUI,
USAGE = 'usage: %s [OPTION]... [serialno]'
SHORT_OPTS = 'HVIFSkw:ixdc'
-LONG_OPTS = [HELP, VERBOSE, IGNORE_SECURE_DEVICE, FORCE_VIEW_SERVER_USE,
+LONG_OPTS = [HELP, VERBOSE, VERSION, IGNORE_SECURE_DEVICE, FORCE_VIEW_SERVER_USE,
DO_NOT_START_VIEW_SERVER, DO_NOT_IGNORE_UIAUTOMATOR_KILLED, WINDOW + '=',
UNIQUE_ID, POSITION, CONTENT_DESCRIPTION, CENTER]
LONG_OPTS_ARG = {WINDOW: 'WINDOW'}
@@ -91,6 +92,10 @@ def help():
print >> sys.stderr, o
sys.exit(0)
+def version():
+ print progname, __version__
+ sys.exit(0)
+
# __main__
progname = os.path.basename(sys.argv[0])
try:
@@ -110,6 +115,8 @@ for o, a in opts:
help()
elif o in ['V', VERBOSE]:
kwargs1[VERBOSE] = True
+ elif o in [VERSION]:
+ version()
elif o in ['I', IGNORE_SECURE_DEVICE]:
kwargs1['ignoresecuredevice'] = True
elif o in ['F', FORCE_VIEW_SERVER_USE]:

0 comments on commit 1c72574

Please sign in to comment.