Example #1
0
 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")
Example #2
0
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)
Example #3
0
def main():
    for command, time, cwd in shell.History():
        cwd = shell.unexpanduser(cwd)
        print "%s [%s]: %s" % (time, cwd, command)