diff options
| author | Joel Andres Granados <jgranado@redhat.com> | 2008-07-14 13:41:50 +0200 |
|---|---|---|
| committer | Joel Andres Granados <jgranado@redhat.com> | 2008-07-14 13:41:50 +0200 |
| commit | a6440d7404e7f0f2f88edd5d1eddf808cbcbb589 (patch) | |
| tree | 43dc35da6b054715f0bb67df5b93e1edb002d02a | |
| parent | f87a133d6b734c1aa15c1070726f5b77b5648cbc (diff) | |
| download | firstaidkit-a6440d7404e7f0f2f88edd5d1eddf808cbcbb589.tar.gz firstaidkit-a6440d7404e7f0f2f88edd5d1eddf808cbcbb589.tar.xz firstaidkit-a6440d7404e7f0f2f88edd5d1eddf808cbcbb589.zip | |
Avoid the ugly space left by adding "\" to a string separation.
When deviding a string into two lines one must use pythons automatic
string concatenation (python concatenates strings that are in different
line but are inside parenthesis). Do not use the "\" in the string as
this will cause strange and unwanted output.
Yes:
print("long string"
"rest of string")
No:
print("long string \
rest of string")
| -rw-r--r-- | plugins/xserver.py | 20 | ||||
| -rw-r--r-- | pyfirstaidkit/configuration.py | 4 | ||||
| -rw-r--r-- | pyfirstaidkit/errors.py | 4 | ||||
| -rw-r--r-- | pyfirstaidkit/interpret.py | 14 | ||||
| -rw-r--r-- | pyfirstaidkit/issue.py | 4 | ||||
| -rw-r--r-- | pyfirstaidkit/plugins.py | 44 |
6 files changed, 45 insertions, 45 deletions
diff --git a/plugins/xserver.py b/plugins/xserver.py index 02659da..6713cac 100644 --- a/plugins/xserver.py +++ b/plugins/xserver.py @@ -72,8 +72,8 @@ class Xserver(Plugin): if os.path.exists("/tmp/.X0-lock"): self._reporting.info("An X server is already running.", level = PLUGIN, origin = self) - self._reporting.info("You can run the \"force\" flow to \ - avoud this check. In some cases it works.", + self._reporting.info("You can run the \"force\" flow to " + "avoud this check. In some cases it works.", level = PLUGIN, origin = self) self._result = ReturnSuccess @@ -86,8 +86,8 @@ class Xserver(Plugin): # If the configuration is not there dont even bother to try #fixing it. This will go through the proces of trying to fix #it. at least we told the user. - self._reporting.info("The error is in the xservers autodetection \ - mechanism, this does not have an automated solution yet.", + self._reporting.info("The error is in the xservers autodetection " + "mechanism, this does not have an automated solution yet.", level = PLUGIN, origin = self) self._result = ReturnFailure @@ -110,8 +110,8 @@ class Xserver(Plugin): # If the configuration is not there dont even bother to try fixing it. # This will go through the proces of trying to fix it. at least we #told the user. - self._reporting.info("The error is in the xservers autodetection \ - mechanism, this does not have an automated solution yet.", + self._reporting.info("The error is in the xservers autodetection " + "mechanism, this does not have an automated solution yet.", level = PLUGIN, origin = self) self._result = ReturnFailure @@ -147,8 +147,8 @@ class Xserver(Plugin): level = PLUGIN, origin = self) self._result = ReturnSuccess else: - self._reporting.info("X server is still missconfigured with new \ - file.", level = PLUGIN, origin = self) + self._reporting.info("X server is still missconfigured with new " + "file.", level = PLUGIN, origin = self) self._result = ReturnFailure self._issue.set(fixed = (self._result == ReturnSuccess), reporting = self._reporting, level = PLUGIN, origin = self) @@ -156,8 +156,8 @@ class Xserver(Plugin): def restore(self): if not self.backupSpace.exists(path=self.confPath): # This is the case where there is no config file. - self._reporting.info("The backedup file was not present. Assuming \ - that xorg did not have a config file to begin with.", + self._reporting.info("The backedup file was not present. Assuming " + "that xorg did not have a config file to begin with.", level = PLUGIN, origin = self) else: self._reporting.info("Restoring original file.", level = PLUGIN , diff --git a/pyfirstaidkit/configuration.py b/pyfirstaidkit/configuration.py index cbf9d7b..ee260b7 100644 --- a/pyfirstaidkit/configuration.py +++ b/pyfirstaidkit/configuration.py @@ -56,8 +56,8 @@ def createDefaultConfig(config): config.system.configuration = "/etc/firstaidkit" # Frontend modules are in specified directories - config.system.frontend = "'/usr/lib64/firstaidkit/frontend' \ - '/usr/lib/firstaidkit/frontend'" + config.system.frontend = ("'/usr/lib64/firstaidkit/frontend'" + "'/usr/lib/firstaidkit/frontend'") # # There will be 4 default places where FAK will look for plugins, diff --git a/pyfirstaidkit/errors.py b/pyfirstaidkit/errors.py index a32d1ec..061703e 100644 --- a/pyfirstaidkit/errors.py +++ b/pyfirstaidkit/errors.py @@ -18,8 +18,8 @@ class InvalidFlowStateException(Exception): def __init__(self, flow): - self.message="There appears to be an inconsistency with the %s \ - varialbe. " % flow + self.message="There appears to be an inconsistency with the %s " + "varialbe. " % flow def __str__(self): return self.message diff --git a/pyfirstaidkit/interpret.py b/pyfirstaidkit/interpret.py index f440ddb..71c1152 100644 --- a/pyfirstaidkit/interpret.py +++ b/pyfirstaidkit/interpret.py @@ -61,8 +61,8 @@ class Tasker: def interrupt(self): self._running = False - self._reporting.info("You sent an interrupt signal to \ - Tasker! This is not recommended.", level = TASKER, + self._reporting.info("You sent an interrupt signal to " + "Tasker! This is not recommended.", level = TASKER, origin = self, importance = logging.WARNING) def flags(self): @@ -88,7 +88,7 @@ class Tasker: level = TASKER, origin = self, importance = logging.WARNING) self._provide.provide("root") else: - self._reporting.info("You are not running the firstaidkit as " \ + self._reporting.info("You are not running the firstaidkit as " "root. Some plugins may not be available.", level = TASKER, origin = self, importance = logging.WARNING) self._provide.unprovide("root") @@ -133,8 +133,8 @@ class Tasker: not pluginSystem.getplugin(plugin).default_flow in pluginSystem.getplugin(plugin).getFlows())): - self._reporting.info("Plugin %s does not contain \ - flow %s"% (plugin, flow or \ + self._reporting.info("Plugin %s does not contain " + "flow %s"% (plugin, flow or \ pluginSystem.getplugin(plugin).default_flow,), \ level = TASKER, origin = self) @@ -147,8 +147,8 @@ class Tasker: #some plugins may not be called because of unfavorable flags for plugin in set(map(lambda x: x[0], actlist)): - self._reporting.info("Plugin %s was not called because of \ - unsatisfied dependencies"% (plugin,), level = TASKER, \ + self._reporting.info("Plugin %s was not called because of " + "unsatisfied dependencies"% (plugin,), level = TASKER, \ origin = self, importance = logging.WARNING) # For the flags case diff --git a/pyfirstaidkit/issue.py b/pyfirstaidkit/issue.py index e706fa4..3896d5c 100644 --- a/pyfirstaidkit/issue.py +++ b/pyfirstaidkit/issue.py @@ -96,8 +96,8 @@ Return values: class Issue(SimpleIssue): name = "Parent issue" - description = "This happens when you use the wrong object in the issues \ - list" + description = "This happens when you use the wrong object in the issues " + "list" def __init__(self, plugin, reporting = None): SimpleIssue.__init__(self, self.name, self.description) diff --git a/pyfirstaidkit/plugins.py b/pyfirstaidkit/plugins.py index 5bd857f..4d7ce14 100644 --- a/pyfirstaidkit/plugins.py +++ b/pyfirstaidkit/plugins.py @@ -284,8 +284,8 @@ class Plugin(object): """ #We want these functions to be overridden by the plugin developer. if self.__class__ is Plugin: - Logger.warning("Prepare is an abstract method, it should be used \ - as such.") + Logger.warning("Prepare is an abstract method, it should be used " + "as such.") def clean(self): """Final actions. @@ -297,36 +297,36 @@ class Plugin(object): """ #We want these functions to be overridden by the plugin developer. if self.__class__ is Plugin: - Logger.warning("Clean is an abstract method, it should be used as \ - such.") + Logger.warning("Clean is an abstract method, it should be used as " + "such.") def backup(self): """Gather important information needed for restore.""" #We want these functions to be overridden by the plugin developer. if self.__class__ is Plugin: - Logger.warning("Backup is an abstract method, it should be used as \ - such.") + Logger.warning("Backup is an abstract method, it should be used as " + "such.") def restore(self): """Try to restore the previous state described in backup.""" #We want these functions to be overridden by the plugin developer. if self.__class__ is Plugin: - Logger.warning("Restore is an abstract method, it should be used \ - as such.") + Logger.warning("Restore is an abstract method, it should be used " + "as such.") def diagnose(self): """Diagnose the situation.""" #We want these functions to be overridden by the plugin developer. if self.__class__ is Plugin: - Logger.warning("Diagnose is an abstract method, it should be used \ - as such.") + Logger.warning("Diagnose is an abstract method, it should be used " + "as such.") def fix(self): """Try to fix whatever is wrong in the system.""" #We want these functions to be overridden by the plugin developer. if self.__class__ is Plugin: - Logger.warning("Fix is an abstract method, it should be used as \ - such.") + Logger.warning("Fix is an abstract method, it should be used as " + "such.") class IssuesPlugin(Plugin): """Plugin which uses Issue classes to test smaller and INDEPENDENT issues. @@ -446,12 +446,12 @@ class FlagTrackerPlugin(Plugin): """Decide about state of higher level flags.""" #We want these functions to be overridden by the plugin developer. if self.__class__ is FlagTrackerPlugin: - Logger.warning("Decide is an abstract method, it should be used \ - as such.") + Logger.warning("Decide is an abstract method, it should be used " + "as such.") if self.flag_decide is None: - Logger.warning("You have to specify flag to set when everything \ - is ok.") + Logger.warning("You have to specify flag to set when everything " + "is ok.") return Return for flag in self.flag_list: @@ -522,13 +522,13 @@ class PluginSystem(object): #reverse-dependencies self._deps.introduce(module.get_plugin().getConflicts()) self._plugins[m] = module - self._reporting.debug("Module %s successfully imported \ - with basedir %s" % + self._reporting.debug("Module %s successfully imported " + "with basedir %s" % (m, os.path.dirname(module.__file__)), level = PLUGINSYSTEM, origin = self) except Exception, e: - self._reporting.error(message = "Module %s was NOT \ - imported, because of %s" % + self._reporting.error(message = "Module %s was NOT " + "imported, because of %s" % (m, str(e)), level = PLUGINSYSTEM, origin = self) finally: imp.release_lock() @@ -569,8 +569,8 @@ class PluginSystem(object): Logger.info("Using %s flow" % flowName) if flowName not in flows: - self._reporting.exception(message = "Flow %s does not exist in \ - plugin %s" % (flowName, plugin), level = PLUGINSYSTEM, + self._reporting.exception(message = "Flow %s does not exist in " + "plugin %s" % (flowName, plugin), level = PLUGINSYSTEM, origin = self) self._reporting.stop(level=PLUGIN, origin=self, message=plugin) raise InvalidFlowNameException(flowName) |
