/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-05 22:29:08 UTC
  • Revision ID: tim@ed.am-20140405222908-3onggkfp5akpz21t
got symlink accept lists working; fixed some walker bugs

Show diffs side-by-side

added added

removed removed

22
22
import re
23
23
from copy_base import CopyBaseWalker
24
24
import stdhome.the as the
 
25
from stdhome.file_matcher import FileMatcher
25
26
 
26
27
 
27
28
class CopyOutWalker( CopyBaseWalker ):
28
29
        """The copy-out walker traverses the repo, copying its content to the home
29
 
        directory.  It is run *after* checking for conflicts that might occur during
30
 
        copy-out, so any conflicts that exist can be assumed to be unimportant and
31
 
        disposable.  In other words, this will happily overwrite stuff in the home
32
 
        directory, without regard to its content.
 
30
        directory.  During an update, it is run *after* checking for conflicts that
 
31
        might occur during copy-out, so any conflicts that exist can be assumed to
 
32
        be unimportant and disposable.  In other words, this will happily overwrite
 
33
        stuff in the home directory, without regard to its content.
33
34
 
34
35
        Walker source:       repo
35
36
        Walker destination:  home dir
36
37
        Walker traversing:   repo (or a provided file list, which may include stuff
37
38
                                                        that no longer exists in the repo
 
39
 
38
40
        """
39
41
 
40
 
        def __init__( self, updated_files = None ):
 
42
        def __init__( self, walk_files = None ):
41
43
                self.src_dir = the.repo.full_dir
42
44
                self.dst_dir = the.full_home_dir
43
 
                self.walk_list = updated_files if updated_files is not None else \
 
45
                self.walk_list = walk_files if walk_files is not None else \
44
46
                                                 self.generate_walk_list( the.repo.full_dir )
45
47
 
 
48
                self.accept_list = FileMatcher( the.config_file, 'symlink' )
 
49
 
46
50
 
47
51
        def print_op( self, rel_file, operation ):
48
52
                operation = re.sub( r'(.)(.)(.)', r'\3\2\1', operation )