Example #1
0
 def do_load_csv(self, line):
     '''[*] load_csv <path> <include-survey>
         |-[path]   - path where csv files exist or a path to a csv file
      '''
     try:
         csv_load.run(self.cnx, line)
     except Exception as e:
         print "Error occurred {}".format(e)
     return
Example #2
0
 def do_load_csv(self, line):
     '''[*] load_csv <path> <include-survey>
         |-[path]   - path where csv files exist or a path to a csv file
      '''
     try:
         csv_load.run(self.cnx, line)
     except Exception as e:
         print "Error occurred {}".format(e)
     return
Example #3
0
    def do_load_csv(self, path, survey):
        '''[*] load_csv <path> <include-survey>
            |-[path]   - path where csv files exist or a path to a csv file
            |-[survey] - either set as \"yes\" or \"no\" if you want to include the survey''' 
        if survey in ( "yes", "Yes", "YES", "1" ) :
            choice = True
        elif survey in ( "no", "No", "NO", "0" ) :
            choice = False
        else:
            print "Error: Please specify \"yes\" or \"no\" if you want a survey"
            return

        csv_load.run(self.cnx, path, choice)
Example #4
0
    def do_load_csv(self, line):
        '''[*] load_csv <path> <include-survey>
            |-[path]   - path where csv files exist or a path to a csv file
            |-[survey] - either set as \"yes\" or \"no\" if you want to include the survey'''
        try:
            line = line.strip().split()
            path = line[0]
            survey = line[1]
            choice = False

            if survey in ( "y", "Y", "yes", "Yes", "YES", "1" ) :
                choice = True
            elif survey in ( "n", "N", "no", "No", "NO", "0" ) :
                choice = False
            else:
                print "Error: Please specify \"yes\" or \"no\" if you want a survey"
                return

            csv_load.run(self.cnx, path, choice)
        except:
            print "Error: Please specify a path and whether or not to include the survey"
        return