def test_tilde_unexpansion(self): home_dir = "/my/home/town" self.patch_env_var("HOME", home_dir) self.assertEquals(shell.unexpanduser("/my/home/town/village/idiot"), "~/village/idiot") self.assertEquals(shell.unexpanduser("/shelbyville"), "/shelbyville")
def main(): sqldb = shell.History().sqldb cursor = sqldb.execute( "SELECT command, time, cwd_path FROM history ORDER BY time") for command, time, cwd in cursor: cwd = shell.unexpanduser(cwd) print "%s [%s]: %s" % (time, cwd, command)
def main(): for command, time, cwd in shell.History(): cwd = shell.unexpanduser(cwd) print "%s [%s]: %s" % (time, cwd, command)