def get_param(self, name, prompt='', secret=False, ask=True, reuse=False):
    # First, check in this objects stored preferences.
    if name in self.prefs:
     return self.prefs[name]
    # Second, check for a command line parameter.
    value = None
    for i in xrange(len(sys.argv)):
      if sys.argv[i].startswith('--%s=' % name):
        value = sys.argv[i].split('=')[1]
      elif sys.argv[i] == '--%s' % name:
        value = sys.argv[i + 1]
    # Third, if it was not on the command line, ask the user to input the
    # value.
    if value is None and ask:
      prompt = '%s: ' % prompt
      if secret:
        value = getpass.getpass(prompt)
      else:
        value = raw_input(prompt)
    # If we want to save the preference for reuse in future requests, add it
    # to this object's prefs.
    if value is not None and reuse:
      self.prefs[name] = value
    return value
dataset/ETHPy150Open CollabQ/CollabQ/vendor/gdata/sample_util.py/SettingsUtil.get_param/original