Compress Vertical Whitespace

This commit is contained in:
Stefano Rivera 2010-11-23 09:00:16 +02:00
parent afb27f1e1b
commit 43781fb79a

View File

@ -18,7 +18,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details. # GNU General Public License for more details.
# #
# See file /usr/share/common-licenses/GPL for more details. # See file /usr/share/common-licenses/GPL-2 for more details.
# #
# ################################################################## # ##################################################################
# #
@ -39,9 +39,7 @@ debian_distros = ['etch', 'lenny', 'squeeze', 'sid', 'stable', 'testing',
'unstable', 'experimental'] 'unstable', 'experimental']
class pbuilder_dist: class pbuilder_dist:
def __init__(self, builder): def __init__(self, builder):
# Base directory where pbuilder will put all the files it creates. # Base directory where pbuilder will put all the files it creates.
self.base = None self.base = None
@ -108,8 +106,6 @@ class pbuilder_dist:
self.target_distro = self.system_distro self.target_distro = self.system_distro
##############################################################
def set_target_distro(self, distro): def set_target_distro(self, distro):
""" pbuilder_dist.set_target_distro(distro) -> None """ pbuilder_dist.set_target_distro(distro) -> None
@ -117,9 +113,7 @@ class pbuilder_dist:
isn't know to the system ask the user for confirmation before isn't know to the system ask the user for confirmation before
proceeding, and finally either save the value into the appropiate proceeding, and finally either save the value into the appropiate
variable or finalize pbuilder-dist's execution. variable or finalize pbuilder-dist's execution.
""" """
if not distro.isalpha(): if not distro.isalpha():
print >> stderr, ('Error: "%s" is an invalid distribution codename.' print >> stderr, ('Error: "%s" is an invalid distribution codename.'
% distro) % distro)
@ -147,9 +141,7 @@ class pbuilder_dist:
Check if the given string is a valid pbuilder operation and Check if the given string is a valid pbuilder operation and
depending on this either save it into the appropiate variable depending on this either save it into the appropiate variable
or finalize pbuilder-dist's execution. or finalize pbuilder-dist's execution.
""" """
arguments = ('create', 'update', 'build', 'clean', 'login', 'execute') arguments = ('create', 'update', 'build', 'clean', 'login', 'execute')
if operation not in arguments: if operation not in arguments:
@ -176,9 +168,7 @@ class pbuilder_dist:
Generate the pbuilder command which matches the given configuration Generate the pbuilder command which matches the given configuration
and return it as a string. and return it as a string.
""" """
if not self.build_architecture: if not self.build_architecture:
self.chroot_string = self.target_distro self.chroot_string = self.target_distro
self.build_architecture = self.system_architecture self.build_architecture = self.system_architecture
@ -277,15 +267,14 @@ class pbuilder_dist:
self.builder, self.builder,
] + arguments ] + arguments
def ask(question): def ask(question):
""" ask(question) -> string """ ask(question) -> string
Ask the given question and return the answer. Also catch Ask the given question and return the answer. Also catch
KeyboardInterrupt (Ctrl+C) and EOFError (Ctrl+D) exceptions and KeyboardInterrupt (Ctrl+C) and EOFError (Ctrl+D) exceptions and
immediately return None if one of those is found. immediately return None if one of those is found.
""" """
try: try:
answer = raw_input(question) answer = raw_input(question)
except (KeyboardInterrupt, EOFError): except (KeyboardInterrupt, EOFError):
@ -298,9 +287,7 @@ def help(exit_code = 0):
""" help() -> None """ help() -> None
Print a help message for pbuilder-dist, and exit with the given code. Print a help message for pbuilder-dist, and exit with the given code.
""" """
print 'See man pbuilder-dist for more information.' print 'See man pbuilder-dist for more information.'
exit(exit_code) exit(exit_code)
@ -312,9 +299,7 @@ def main():
object, modifies all necessary settings taking data from the object, modifies all necessary settings taking data from the
executable's name and command line options and finally either ends executable's name and command line options and finally either ends
the script and runs pbuilder itself or exists with an error message. the script and runs pbuilder itself or exists with an error message.
""" """
script_name = os.path.basename(argv[0]) script_name = os.path.basename(argv[0])
parts = script_name.split('-') parts = script_name.split('-')