Changeset 59

Show
Ignore:
Timestamp:
02/23/12 04:03:39
Author:
cbc
Message:

Attempt to fix timing/process issue with copying backup goto list.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • points/trunk/points.py

    r48 r59  
    6767import math 
    6868import shutil 
     69import time 
    6970from datetime import datetime 
    7071 
     
    216217    command_line = "%s %s" % (sys.executable, 
    217218                              " ".join(sys.argv)) 
    218     handle = open(backup_path, "w") 
     219    if copy: 
     220        dest = goto_path 
     221        dupe = backup_path 
     222    else: 
     223        dest = backup_path 
     224        dupe = None 
     225 
     226    handle = open(dest, "w") 
    219227    handle.write(first_template % (goto_name, 
    220228                                   now_string, 
     
    225233    handle.close() 
    226234 
    227     if copy: 
    228         shutil.copy2(backup_path, goto_path) 
     235    if dupe: 
     236        shutil.copy2(dest, dupe) 
     237        print "\nCopied from %s to %s." % (dest, dupe), 
     238        sys.stdout.flush() 
     239 
     240    time.sleep(1) 
    229241    return points 
    230242