parameters: (self)
docstring: Write changed .pth file back to disk
docstring_summary: Write changed .pth file back to disk
docstring_tokens: Write changed . pth file back to disk
function: def save(self):
          """Write changed .pth file back to disk"""
          if not self.dirty:
              return
  
          rel_paths = list(map(self.make_relative, self.paths))
          if rel_paths:
              log.debug("Saving %s", self.filename)
              lines = self._wrap_lines(rel_paths)
              data = '\n'.join(lines) + '\n'
  
              if os.path.islink(self.filename):
                  os.unlink(self.filename)
              with open(self.filename, 'wt') as f:
                  f.write(data)
  
          elif os.path.exists(self.filename):
              log.debug("Deleting empty %s", self.filename)
              os.unlink(self.filename)
  
          self.dirty = False
function_tokens: def save ( self ) : if not self . dirty : return rel_paths = list ( map ( self . make_relative , self . paths ) ) if rel_paths : log . debug ( "Saving %s" , self . filename ) lines = self . _wrap_lines ( rel_paths ) data = '\n' . join ( lines ) + '\n' if os . path . islink ( self . filename ) : os . unlink ( self . filename ) with open ( self . filename , 'wt' ) as f : f . write ( data ) elif os . path . exists ( self . filename ) : log . debug ( "Deleting empty %s" , self . filename ) os . unlink ( self . filename ) self . dirty = False