/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/deployment.py

  • Committer: Tim Marston
  • Date: 2021-07-05 19:14:32 UTC
  • Revision ID: tim@ed.am-20210705191432-243ayb7s2nmussvi
python3ification

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
 
21
21
 
22
22
import os, re, shutil, filecmp, json
23
 
import the, util
24
 
from walker.copy_in import CopyInWalker
25
 
from walker.conflict import ConflictWalker
26
 
from walker.copy_out import CopyOutWalker
 
23
from . import the, util
 
24
from .walker.copy_in import CopyInWalker
 
25
from .walker.conflict import ConflictWalker
 
26
from .walker.copy_out import CopyOutWalker
27
27
 
28
28
 
29
29
class Deployment:
67
67
                        return
68
68
 
69
69
                # read the file list
70
 
                if the.verbose >= 1: print "deployment state found; loading"
 
70
                if the.verbose >= 1: print("deployment state found; loading")
71
71
                f = open( file, 'r' )
72
72
                state = json.loads( f.read() )
73
73
 
84
84
                """Save the current deployment state (so there will be a deployment ongoing).
85
85
                """
86
86
 
87
 
                if the.verbose >= 1: print "saving deployment state"
 
87
                if the.verbose >= 1: print("saving deployment state")
88
88
 
89
89
                # create metadata directory, as necessary
90
90
                if not os.path.isdir( the.full_mddir ):
112
112
                if( os.path.isfile( file ) ):
113
113
 
114
114
                        # delete it
115
 
                        if the.verbose >= 1: print "removing deployment state"
 
115
                        if the.verbose >= 1: print("removing deployment state")
116
116
                        os.unlink( file )
117
117
 
118
118
 
156
156
                        self.imported_files = list()
157
157
                else:
158
158
                        # copy in
159
 
                        if the.verbose >= 1: print "importing files..."
 
159
                        if the.verbose >= 1: print("importing files...")
160
160
                        walker = CopyInWalker()
161
161
                        walker.walk()
162
162
                        self.imported_files = walker.walk_list
205
205
                        raise RuntimeError('logic error: deployment conflicts unchecked' )
206
206
 
207
207
                # copy out
208
 
                if the.verbose >= 1: print "exporting files..."
 
208
                if the.verbose >= 1: print("exporting files...")
209
209
                walker = CopyOutWalker( self.affected_files, not quiet )
210
210
                walker.walk()
211
211