aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrice Clement <monsieurp@gentoo.org>2017-06-23 15:46:02 +0200
committerPatrice Clement <monsieurp@gentoo.org>2017-06-23 15:46:02 +0200
commitb5984bcad05f2d935e78826af3b5b0e9b8f455a9 (patch)
tree154cf6d8dac75811a2bb48c16e62e61ba951ab01
parentremove another else condition (diff)
downloadjava-config-b5984bcad05f2d935e78826af3b5b0e9b8f455a9.tar.gz
java-config-b5984bcad05f2d935e78826af3b5b0e9b8f455a9.tar.bz2
java-config-b5984bcad05f2d935e78826af3b5b0e9b8f455a9.zip
define needed_vars array as a global variable
-rw-r--r--src/java_config_2/VM.py11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/java_config_2/VM.py b/src/java_config_2/VM.py
index abd6fb5..4709e37 100644
--- a/src/java_config_2/VM.py
+++ b/src/java_config_2/VM.py
@@ -9,17 +9,16 @@ from .Errors import *
import os
-class VM:
- # Dont accept env files without these variables
- needed_vars = [ "JAVA_HOME", "PROVIDES_TYPE", "PROVIDES_VERSION" ]
+# Dont accept env files without these variables
+NEEDED_VARS = [ "JAVA_HOME", "PROVIDES_TYPE", "PROVIDES_VERSION" ]
+class VM:
def __init__(self, file):
self.file = file
self.config = EnvFileParser(file).get_config()
-
- for var in self.needed_vars:
+ for var in NEEDED_VARS:
if var not in self.config:
- raise InvalidVMError("Missing: %s" %var)
+ raise InvalidVMError("Missing: %s" % var)
def __eq__(self, other):
return self.version() == other.version()