~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_plugins.py

  • Committer: Blake Winton
  • Date: 2007-10-16 16:02:01 UTC
  • mto: This revision was merged to the branch mainline in revision 2921.
  • Revision ID: bwinton@latte.ca-20071016160201-os2bci2ujf7in7an
Change 'print >> f,'s to 'f.write('s.

Show diffs side-by-side

added added

removed removed

Lines of Context:
73
73
 
74
74
        outfile = open(os.path.join('first', 'plugin.py'), 'w')
75
75
        try:
76
 
            print >> outfile, template % (tempattribute, 'first')
 
76
            outfile.write(template % (tempattribute, 'first'))
 
77
            outfile.write('\n')
77
78
        finally:
78
79
            outfile.close()
79
80
 
80
81
        outfile = open(os.path.join('second', 'plugin.py'), 'w')
81
82
        try:
82
 
            print >> outfile, template % (tempattribute, 'second')
 
83
            outfile.write(template % (tempattribute, 'second'))
 
84
            outfile.write('\n')
83
85
        finally:
84
86
            outfile.close()
85
87
 
119
121
 
120
122
        outfile = open(os.path.join('first', 'pluginone.py'), 'w')
121
123
        try:
122
 
            print >> outfile, template % (tempattribute, 'first')
 
124
            outfile.write(template % (tempattribute, 'first'))
 
125
            outfile.write('\n')
123
126
        finally:
124
127
            outfile.close()
125
128
 
126
129
        outfile = open(os.path.join('second', 'plugintwo.py'), 'w')
127
130
        try:
128
 
            print >> outfile, template % (tempattribute, 'second')
 
131
            outfile.write(template % (tempattribute, 'second'))
 
132
            outfile.write('\n')
129
133
        finally:
130
134
            outfile.close()
131
135
 
169
173
 
170
174
        outfile = open(os.path.join('plugin_test', 'ts_plugin.py'), 'w')
171
175
        try:
172
 
            print >> outfile, template % (tempattribute, 'plugin')
 
176
            outfile.write(template % (tempattribute, 'plugin'))
 
177
            ourfile.write('\n')
173
178
        finally:
174
179
            outfile.close()
175
180
 
191
196
        # check the plugin is not loaded already
192
197
        self.failIf(getattr(bzrlib.plugins, 'plugin', None))
193
198
        # write a plugin that _cannot_ fail to load.
194
 
        print >> file('plugin.py', 'w'), ""
 
199
        file('plugin.py', 'w').write("\n")
195
200
        try:
196
201
            bzrlib.plugin.load_from_path(['.'])
197
202
            all_plugins = self.applyDeprecated(zero_ninetyone,
215
220
        # check the plugin is not loaded already
216
221
        self.failIf(getattr(bzrlib.plugins, 'plugin', None))
217
222
        # write a plugin that _cannot_ fail to load.
218
 
        print >> file('plugin.py', 'w'), source
 
223
        file('plugin.py', 'w').write(source + '\n')
219
224
        self.addCleanup(self.teardown_plugin)
220
225
        bzrlib.plugin.load_from_path(['.'])
221
226