@command('set\\s+([-\\w]+)\\s*(.*)')
def setconfig(key, val):
 key = key.replace('-', '_')
 if ((key.upper() == 'ALL') and (val.upper() == 'DEFAULT')):
  for ci in config:
   config[ci].value = config[ci].default
  config.save()
  message = 'Default configuration reinstated'
 elif (not (key.upper() in config)):
  message = ('Unknown config item: %s%s%s' % (c.r, key, c.w))
 elif (val.upper() == 'DEFAULT'):
  att = config[key.upper()]
  att.value = att.default
  message = '%s%s%s set to %s%s%s (default)'
  dispval = (att.display or 'None')
  message = (message % (c.y, key, c.w, c.y, dispval, c.w))
  config.save()
 else:
  message = config[key.upper()].set(val)
 showconfig()
 g.message = message

@ command ( 'set\\s+([-\\w]+)\\s*(.*)' ) def setconfig ( key , val ) : key = key . replace ( '-' , '_' ) if ( ( key . upper ( ) == 'ALL' ) and ( val . upper ( ) == 'DEFAULT' ) ) : for ci in config : config [ ci ] . value = config [ ci ] . default config . save ( ) message = 'Default configuration reinstated' elif ( not ( key . upper ( ) in config ) ) : message = ( 'Unknown config item: %s%s%s' % ( c . r , key , c . w ) ) elif ( val . upper ( ) == 'DEFAULT' ) : att = config [ key . upper ( ) ] att . value = att . default message = '%s%s%s set to %s%s%s (default)' dispval = ( att . display or 'None' ) message = ( message % ( c . y , key , c . w , c . y , dispval , c . w ) ) config . save ( ) else : message = config [ key . upper ( ) ] . set ( val ) showconfig ( ) g . message = message
set configuration variable .