def _del_repo_from_file(alias, filepath):
 with open(filepath) as fhandle:
  output = []
  regex = re.compile(REPO_REGEXP)
  for line in fhandle:
   if regex.search(line):
    if line.startswith('#'):
     line = line[1:]
    cols = line.strip().split()
    if (alias != cols[1]):
     output.append(line)
 with open(filepath, 'w') as fhandle:
  fhandle.writelines(output)

def _del_repo_from_file ( alias , filepath ) : with open ( filepath ) as fhandle : output = [ ] regex = re . compile ( REPO_REGEXP ) for line in fhandle : if regex . search ( line ) : if line . startswith ( '#' ) : line = line [ 1 : ] cols = line . strip ( ) . split ( ) if ( alias != cols [ 1 ] ) : output . append ( line ) with open ( filepath , 'w' ) as fhandle : fhandle . writelines ( output )
remove a repo from filepath .