for row in reader:
            if row[0]==options.cvs:
                projectIdentifier = row[1]
                apiKey = row[2]

print "Evaluating", options.path

if not os.path.exists(options.path):
    print "Path not found: " + options.path
    sys.exit(1)

isDirectory = os.path.isdir(options.path)
isFile = os.path.isfile(options.path)

if isDirectory:
    pathToStringsXml = helper.locateFile("strings.xml", options.path)

    if not helper.isValidAndroidResourcePath(pathToStringsXml):
        print "Not a valid Android resources directory"
        sys.exit(1)

elif isFile:
    pathToStringsXml = options.path

    if not helper.isValidAndroidResourcePath(pathToStringsXml):
        print "Not a valid Android resource file"
        sys.exit(1)


if options.action == "update":
    if not helper.IsDefaultStringsXml(pathToStringsXml):
Example #2
0
 def test_locate_FileDoesntExist_ReturnsNone(self):
     l = helper.locateFile("asdfasdf", os.curdir)
     self.assertIsNone(l)
Example #3
0
    parser.parse_args(args)

apiKey = options.apikey
projectIdentifier = options.identifier

print "Evaluating", options.path

if not os.path.exists(options.path):
    print "Path not found: " + options.path
    sys.exit(1)

isDirectory = os.path.isdir(options.path)
isFile = os.path.isfile(options.path)

if isDirectory:
    pathToStringsXml = helper.locateFile("strings.xml", options.path)

    if not helper.isValidAndroidResourcePath(pathToStringsXml):
        print "Not a valid Android resources directory"
        sys.exit(1)

elif isFile:
    pathToStringsXml = options.path

    if not helper.isValidAndroidResourcePath(pathToStringsXml):
        print "Not a valid Android resource file"
        sys.exit(1)

if options.action == "update":
    if not helper.IsDefaultStringsXml(pathToStringsXml):
        print "Please only specify the default '/res/values/strings.xml' for upload"
Example #4
0
 def test_locate_ExistingFile_ReturnsPathToFile(self):
     l = helper.locateFile("python", "/usr/bin")
     self.assertEqual("/usr/bin/python", l)