parameters: (self, name, data)
docstring: Write a preset into a file
docstring_summary: Write a preset into a file
docstring_tokens: Write a preset into a file
function: def _write(self, name, data):
          """Write a preset into a file
          """
          if not re.match(r"^[a-zA-Z0-9_.-]{4,20}$", name):
              raise PresetInvalidName
          try:
              with open(self._get_path(name), 'w') as output:
                  json.dump(data, output, indent=2, sort_keys=True)
          except:
              raise PresetError()
function_tokens: def _write ( self , name , data ) : if not re . match ( r"^[a-zA-Z0-9_.-]{4,20}$" , name ) : raise PresetInvalidName try : with open ( self . _get_path ( name ) , 'w' ) as output : json . dump ( data , output , indent = 2 , sort_keys = True ) except : raise PresetError ( )