PEPify testmodule.py

This commit is contained in:
Teo Mrnjavac 2014-07-29 13:52:55 +02:00
parent b988c3ad72
commit 637242776c

View File

@ -25,24 +25,25 @@ import yaml
try: try:
import libcalamares import libcalamares
except ImportError: except ImportError:
print( "Failed to import libcalamares. Make sure then PYTHONPATH environment variable includes the dir where libcalamares.so is installed." ) print("Failed to import libcalamares. Make sure then PYTHONPATH "
"environment variable includes the dir where libcalamares.so is "
"installed.")
print() print()
raise raise
class Job: class Job:
def __init__( self, workingPath, doc ):
def __init__(self, working_path, doc):
self.module_name = doc["name"] self.module_name = doc["name"]
self.pretty_name = "Testing job " + doc["name"] self.pretty_name = "Testing job " + doc["name"]
self.working_path = workingPath self.working_path = working_path
self.configuration = doc["configuration"] self.configuration = doc["configuration"]
def setprogress(self, progress): def setprogress(self, progress):
print("Job set progress to {}%.".format(progress * 100)) print("Job set progress to {}%.".format(progress * 100))
def main(): def main():
parser = argparse.ArgumentParser() parser = argparse.ArgumentParser()
parser.add_argument("moduledir", parser.add_argument("moduledir",