def delete_article(article, dir, repo, extension):
    """ delete an article """
    a = add_fileextension(article, extension)
    a = os.path.join(dir, a)
    try:
        repo.git.rm(a)
        repo.git.commit(m="%s deleted" % article)
        print("%s deleted" % article)
    except:
        if os.path.isdir(a):
            try:
                os.rmdir(a)
                print("Removed directory %s which was not under version control" % a)
            except OSError:
                print(a % "Could not remove %s - its maybe not empty")
        else:
            try:
                os.remove(a)
                print("Removed file %s which was not under version control" % a)
            except OSError:
                print("File %s could not be removed" % a)
    return
dataset/ETHPy150Open noqqe/cmddocs/cmddocs/articles.py/delete_article/swapped operands of `%`