Merge "Issue #2729 Fixed error handling in loadPreferences method of loadConfig.py" into development
Former-commit-id:fc56df2cf5
[formerlydd532a6edb
] [formerlybbecf3d2da
] [formerlybbecf3d2da
[formerlyb67c36c08b
]] [formerlyfc56df2cf5
[formerlydd532a6edb
] [formerlybbecf3d2da
] [formerlybbecf3d2da
[formerlyb67c36c08b
]] [formerly822acbb32b
[formerlybbecf3d2da
[formerlyb67c36c08b
] [formerly822acbb32b
[formerly dc953f5285a2fb5c56148b78c5db31c4ccdda3a7]]]]] Former-commit-id:822acbb32b
Former-commit-id:08f78efb21
[formerly2a0c06c814
] [formerlyb5680ce7f3
] [formerly 1082e3913871087818e08fedf2e2a68fe7a99c8c [formerly 2376fd5832ad8d1cfd61ec7ab3b9ba1df3cefd08] [formerlyb5680ce7f3
[formerlyf7910616ca
]]] Former-commit-id: 07fe0d89ae18473c6d92abb410cb21bc9482d977 [formerly 637dd659dc9349e6f757c7d9cc06d52e050fd572] [formerly792a88f134
[formerly4309f32433
]] Former-commit-id:792a88f134
Former-commit-id:27d225d4a5
This commit is contained in:
commit
09550b91ec
1 changed files with 14 additions and 12 deletions
|
@ -58,6 +58,7 @@ import com.raytheon.uf.common.util.FileUtil;
|
|||
* Sep 05, 2013 #2307 dgilling Use better PythonScript constructor.
|
||||
* Sep 11, 2013 #2033 dgilling Don't load loadConfig.py from
|
||||
* localization store.
|
||||
* Apr 02, 2014 #2729 randerso Added commonPython to path for LogStream
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -89,6 +90,7 @@ public class PythonPreferenceStore implements IPreferenceStore,
|
|||
|
||||
@SuppressWarnings("unchecked")
|
||||
public void loadConfiguration(String configName) {
|
||||
String commonPythonPath = GfePyIncludeUtil.getCommonPythonIncludePath();
|
||||
String configPath = GfePyIncludeUtil.getConfigIncludePath();
|
||||
String vtecPath = GfePyIncludeUtil.getVtecIncludePath();
|
||||
|
||||
|
@ -100,8 +102,8 @@ public class PythonPreferenceStore implements IPreferenceStore,
|
|||
new Path(FileUtil.join("python", "utility",
|
||||
"loadConfig.py")), null)).getPath());
|
||||
py = new PythonScript(scriptFile.getPath(),
|
||||
PyUtil.buildJepIncludePath(configPath, vtecPath), this
|
||||
.getClass().getClassLoader());
|
||||
PyUtil.buildJepIncludePath(commonPythonPath, configPath,
|
||||
vtecPath), this.getClass().getClassLoader());
|
||||
} catch (JepException e) {
|
||||
statusHandler.handle(Priority.CRITICAL,
|
||||
"Unable to load GFE config", e);
|
||||
|
@ -188,7 +190,7 @@ public class PythonPreferenceStore implements IPreferenceStore,
|
|||
public void firePropertyChangeEvent(String name, Object oldValue,
|
||||
Object newValue) {
|
||||
// The following criteria meets the Eclipse contract
|
||||
if (oldValue == null || oldValue.equals(newValue)) {
|
||||
if ((oldValue == null) || oldValue.equals(newValue)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -675,32 +677,32 @@ public class PythonPreferenceStore implements IPreferenceStore,
|
|||
|
||||
public boolean isBoolean(String name) {
|
||||
Object obj = selectedConfiguration.get(name);
|
||||
return (obj != null && obj instanceof Boolean);
|
||||
return ((obj != null) && (obj instanceof Boolean));
|
||||
}
|
||||
|
||||
public boolean isInt(String name) {
|
||||
Object obj = selectedConfiguration.get(name);
|
||||
return (obj != null && obj instanceof Integer);
|
||||
return ((obj != null) && (obj instanceof Integer));
|
||||
}
|
||||
|
||||
public boolean isFloat(String name) {
|
||||
Object obj = selectedConfiguration.get(name);
|
||||
return (obj != null && obj instanceof Float);
|
||||
return ((obj != null) && (obj instanceof Float));
|
||||
}
|
||||
|
||||
public boolean isDouble(String name) {
|
||||
Object obj = selectedConfiguration.get(name);
|
||||
return (obj != null && obj instanceof Double);
|
||||
return ((obj != null) && (obj instanceof Double));
|
||||
}
|
||||
|
||||
public boolean isLong(String name) {
|
||||
Object obj = selectedConfiguration.get(name);
|
||||
return (obj != null && obj instanceof Long);
|
||||
return ((obj != null) && (obj instanceof Long));
|
||||
}
|
||||
|
||||
public boolean isString(String name) {
|
||||
Object obj = selectedConfiguration.get(name);
|
||||
return (obj != null && obj instanceof String);
|
||||
return ((obj != null) && (obj instanceof String));
|
||||
}
|
||||
|
||||
public boolean isStringArray(String name) {
|
||||
|
@ -711,7 +713,7 @@ public class PythonPreferenceStore implements IPreferenceStore,
|
|||
result = true;
|
||||
} else if (obj instanceof List) {
|
||||
List<?> list = (List<?>) obj;
|
||||
if (list.size() == 0 || list.get(0) instanceof String) {
|
||||
if ((list.size() == 0) || (list.get(0) instanceof String)) {
|
||||
result = true;
|
||||
}
|
||||
}
|
||||
|
@ -728,7 +730,7 @@ public class PythonPreferenceStore implements IPreferenceStore,
|
|||
result = true;
|
||||
} else if (obj instanceof List) {
|
||||
List<?> list = (List<?>) obj;
|
||||
if (list.size() == 0 || list.get(0) instanceof Float) {
|
||||
if ((list.size() == 0) || (list.get(0) instanceof Float)) {
|
||||
result = true;
|
||||
}
|
||||
}
|
||||
|
@ -745,7 +747,7 @@ public class PythonPreferenceStore implements IPreferenceStore,
|
|||
result = true;
|
||||
} else if (obj instanceof List) {
|
||||
List<?> list = (List<?>) obj;
|
||||
if (list.size() == 0 || list.get(0) instanceof Integer) {
|
||||
if ((list.size() == 0) || (list.get(0) instanceof Integer)) {
|
||||
result = true;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue