Advertisement
brainode

parser function

Jun 4th, 2014
233
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.11 KB | None | 0 0
  1. def parser(self,command):
  2.         errorHandler=True;
  3.         commandA=command.split(' ');
  4.         parse = argparse.ArgumentParser(description='Argument parser');
  5.         while switch(commandA[0]):
  6.             if case('scan'):
  7.                 parse.add_argument('--qvw',  action='append_const', const=str, help='path to qlikview file with name');
  8.                 parse.add_argument('--xlsx', action='append_const', const=str, help='path to xlsx file with name');
  9.                 args=parse.parse_args();
  10.                 break;
  11.             if case('example'):
  12.                 parse.add_argument('--name', type=str, help='file name');
  13.                 args=parse.parse_args();
  14.                 break;
  15.             if case('change'):
  16.                 parse.add_argument('--qvw', type=str, help='path to qlikview file with name');
  17.                 parse.add_argument('--xlsx', type=str, help='path to xlsx file with name');
  18.                 args=parse.parse_args();
  19.                 break;
  20.             errorHandler=False;
  21.             break;
  22.         if(errorHandler!=False):
  23.             return args;
  24.         else:
  25.             return errorHandler;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement