/stdhome

To get this branch, use:
bzr branch http://bzr.ed.am/stdhome

« back to all changes in this revision

Viewing changes to lib/stdhome/walker/copy_out.py

  • Committer: Tim Marston
  • Date: 2014-04-18 14:42:00 UTC
  • Revision ID: tim@ed.am-20140418144200-ksbr3l58p2v3jhy2
fixed bugs in command.expand_files, where results could be not unique, nor
sorted, and make sure the last component of the files is not resolved if it is a
symlink

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
 
21
21
 
22
22
import re
23
 
from .copy_base import CopyBaseWalker
 
23
from copy_base import CopyBaseWalker
24
24
import stdhome.the as the
25
25
from stdhome.file_matcher import FileMatcher
26
26
 
36
36
        Walker destination:  home dir
37
37
        Walker traversing:   repo (or a provided file list, which may include stuff
38
38
                                                        that no longer exists in the repo
 
39
 
39
40
        """
40
41
 
41
 
        def __init__( self, walk_files = None, report = True ):
42
 
                CopyBaseWalker.__init__( self )
 
42
        def __init__( self, walk_files = None ):
43
43
                self.src_dir = the.repo.full_dir
44
44
                self.dst_dir = the.full_home_dir
45
45
                self.walk_list = walk_files if walk_files is not None else \
46
46
                                                 self.generate_walk_list( the.repo.full_dir )
47
 
                self.check_dst_symlinks = True
48
 
                self.check_dst_ignores = True
49
 
                self.report = report
50
 
 
51
 
 
52
 
        def print_op( self, rel_file, src, op, dst ):
53
 
 
54
 
                CopyBaseWalker.print_op( self, rel_file, src, op, dst )
55
 
 
56
 
                # verbose reporting
57
 
                if the.verbose >= 2:
58
 
                        if op == '*': op = '<'
59
 
                        print("  %s%s%s %s" % ( src, op, dst, rel_file ))
 
47
 
 
48
                self.accept_list = FileMatcher( the.config_file, 'symlink' )
 
49
 
 
50
 
 
51
        def print_op( self, rel_file, operation ):
 
52
                operation = re.sub( r'(.)(.)(.)', r'\3\2\1', operation )
 
53
                operation = re.sub( r'\>', r'<', operation )
 
54
                print "  %s %s" % ( operation, rel_file )