2 # -*- encoding: utf-8 -*-
4 import sys
, os
, shutil
, glob
10 print "Usage: %s <template_path> <tracker_path>" % sys
.argv
[0]
11 print " template_path: Path to the roundup template used by the tracker"
12 print " tracker_path: Path to the tracker you want to update"
14 if __name__
== "__main__":
15 if len (sys
.argv
) == 3:
16 paths
= {'template': os
.path
.abspath(sys
.argv
[1]),
17 'tracker': os
.path
.abspath(sys
.argv
[2])}
20 print "Template:", paths
['template']
21 print "Tracker:", paths
['tracker']
24 targets
= ['html', 'detectors', 'extensions']
26 for directory
in targets
:
27 print "updating", directory
28 source
= os
.path
.join(paths
['template'], directory
)
29 dest
= os
.path
.join(paths
['tracker'], directory
)
31 if os
.path
.exists(source
) and os
.path
.exists(dest
):
32 for file in glob
.glob(os
.path
.join(source
, "*")):
33 shutil
.copy(file, dest
)
35 print directory
, "not found, skipping"