convert Bazaar and class into methods

Bug #1046255 reported by Martin Mrazik
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
jenkins-launchpad-plugin
New
Undecided
Unassigned

Bug Description

See this for more context:
https://code.launchpad.net/~mrazik/jenkins-launchpad-plugin/dput-python/+merge/119578

112 +class Bazaar(object):
113 + def _call(self, args):
114 + try:
115 + subprocess.check_call(['bzr', ] + args)
116 + except subprocess.CalledProcessError:
117 + logger.error('Call for bzr ' + str(args) + ' failed')
118 + exit(1)
119 +
120 + def _call_output(self, args):
121 + try:
122 + output = subprocess.check_output(['bzr', ] + args,
123 + stderr=open('/dev/null', 'w'))
124 + return output
125 + except subprocess.CalledProcessError:
126 + logger.error('Call for bzr ' + str(args) + ' failed')
127 + exit(1)
128 +
129 + def whoami(self, who):
130 + self._call(['whoami', who, ])
131 +
132 + def branch(self, branch, target_dir):
133 + self._call(['branch', branch, target_dir])
134 +
135 + def revert(self, target_dir):
136 + self._call(['revert', target_dir])
137 +
138 + def merge(self, branch):
139 + self._call(['merge', branch])
140 +
141 + def build(self, recipe, target):
142 + self._call(['build', recipe, target])
143 +
144 + def revno(self, target):
145 + return int(self._call_output(['revno', target]).strip())

As thomi mentioned, this doesn't need to be a class. Comment only, hope you add it to your TODO :-)

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.