Beispiel #1
0
 def run(self):
     # Options were parsed in main
     value = getattr(self.options, self.paramname)
     if empty(value):
         self.debug(
             "Expected parameter '%s' is missing from command-line, use default."
             % self.paramname)
         value = self.default.value
     self.info(_("CLI Parameter '%s'='%s'") % (self.paramname, value))
     self.value.value = value
Beispiel #2
0
 def run(self):
     # Read file content and pass to output interface
     if empty(self.filepath.value):
         raise FlowError(_("Filepath empty, cannot read file."))
     self.info(_("Read content of file '%s'") % self.filepath.value)
     f = open(self.filepath.value, 'rb')
     for line in f:
         self.output.write(line)
     self.output.flush()
     f.close()
Beispiel #3
0
 def run(self):
     # Read file content and pass to output interface
     if empty(self.filepath.value):
         raise FlowError(_("Filepath empty, cannot read file."))
     self.info(_("Read content of file '%s'") % self.filepath.value)
     f = open(self.filepath.value, 'rb')
     for line in f:
         self.output.write(line)
     self.output.flush()
     f.close()
Beispiel #4
0
 def paramname(self):
     name = self.name.value
     if empty(name):
         raise FlowError(_("Error in getting name of CLI Parameter"))
     return name