From 372f394818632d49e642e66aea239a8d2e057a7b Mon Sep 17 00:00:00 2001 From: "Kiran.Shrestha" Date: Thu, 28 Aug 2014 10:05:41 -0400 Subject: [PATCH] ASM #539 Multiple flag functionality for textdb is not working properly Change-Id: Iaae81cace051d97db464e6610d6fa94f86086fb8 Former-commit-id: 64e37ed9b4e98bfaca68c357bf70400137f4292a [formerly e38e3af172d081943ad0a337aaa6cf57431cbbaa] [formerly f11699edddc313d75fadf14d3fddb1397eaecb2c] [formerly 571f6fb8ea3329d87109f43e0876abc4b299dc3a [formerly f11699edddc313d75fadf14d3fddb1397eaecb2c [formerly 0220801fc1747c7659e3db7cf734538fdda270ef]]] Former-commit-id: 571f6fb8ea3329d87109f43e0876abc4b299dc3a Former-commit-id: 542d1ea1d434f6161906bcf74d59d7d599c261c7 [formerly 27f157349ed566b487ddebb43f826e77bdd591b0] Former-commit-id: 07018d455873641a326809647e4e772330744866 --- .../impl/src/textdb/TextDB.py | 45 +++++++++---------- 1 file changed, 20 insertions(+), 25 deletions(-) diff --git a/edexOsgi/com.raytheon.uf.tools.cli/impl/src/textdb/TextDB.py b/edexOsgi/com.raytheon.uf.tools.cli/impl/src/textdb/TextDB.py index 85d272987a..8185b40777 100644 --- a/edexOsgi/com.raytheon.uf.tools.cli/impl/src/textdb/TextDB.py +++ b/edexOsgi/com.raytheon.uf.tools.cli/impl/src/textdb/TextDB.py @@ -1,19 +1,19 @@ ## # This software was developed and / or modified by Raytheon Company, -# pursuant to Contract DG133W-05-CQ-1067 with the US Government. -# -# U.S. EXPORT CONTROLLED TECHNICAL DATA +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA # This software product contains export-restricted data whose # export/transfer/disclosure is restricted by U.S. law. Dissemination # to non-U.S. persons whether in the United States or abroad requires # an export license or other authorization. # -# Contractor Name: Raytheon Company -# Contractor Address: 6825 Pine Street, Suite 340 -# Mail Stop B8 -# Omaha, NE 68106 -# 402.291.0100 -# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# # See the AWIPS II Master Rights File ("Master Rights File.pdf") for # further licensing information. ## @@ -59,6 +59,7 @@ import conf.TDBConfig as config # 12/07/10 7656 cjeanbap Retrieve environment variable. # 04/07/11 8686 cjeanbap Fixed $ACTION has -i associated # 05/12/14 16954 kshrestha Added Multiple flag functionality for textdb +# 08/15/14 2926 bclement Fixed hasSubOperations() ############################################################################## class TextDB: @@ -470,27 +471,21 @@ class TextDB: sm.execute() # Determine if command line has sub operations + # Returns true if any flags in self.commands[CL.DEFAULT_KEY] + # are in config.mayJoin # - # raise: - # propagates any exception received def __hasSubOperations(self): - for key in self.commands.keys(): + for key in self.commands.keys(): if key is CL.DEFAULT_KEY: - subJoins = self.commands.get(key) - length = len(self.commands.get(key)) + flags = self.commands.get(key) #specifically looking for config.flags of subJoins - if length <= 6: - for pos in range(0, length, 2): - value = config.flags.get(subJoins[pos])[0] - try: - config.mayJoin.index(value) - except: - raise CL.ArgError("Invalid command count - JOIN command includes invalid option(s)") + for flag in flags: + configFlag = config.flags.get(flag) + # some flags aren't in configs.flags + if configFlag and configFlag[0] in config.mayJoin: return True - else: - return False - else: - return False + return False + # Correct the sub operational command line . # #