MCPcopy Create free account
hub / github.com/ActiveState/code / undo

Function undo

recipes/Python/576443_Renamer/recipe-576443.py:168–174  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

166 rename(os.path.join(newpath,name),oldpath,0)
167
168def undo():
169 log = open('.Renamer.log','r')
170 for line in log:
171 oldpath, newpath = line.split('\n')[0].split(' Converted To ')
172 os.rename(os.path.join(os.path.dirname(oldpath),os.path.basename(newpath)),oldpath)
173 log.close()
174 raise SystemExit
175
176choiceDialog()
177undolog = open('.Renamer.log','w')

Callers 1

choiceDialogFunction · 0.70

Calls 5

openFunction · 0.50
splitMethod · 0.45
renameMethod · 0.45
joinMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected