summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Sulfrian <alexander@sulfrian.net>2016-02-22 02:05:23 +0100
committerAlexander Sulfrian <alexander@sulfrian.net>2016-02-22 02:05:23 +0100
commit4646aef9f05165635176015a639b44d8c4f314eb (patch)
tree52e827a043ff9f568282c945851580fee26f2690
parent5167abd3248520946dc6571a53a3d3e666e161e9 (diff)
downloadspline-startup-4646aef9f05165635176015a639b44d8c4f314eb.tar.gz
spline-startup-4646aef9f05165635176015a639b44d8c4f314eb.tar.bz2
spline-startup-4646aef9f05165635176015a639b44d8c4f314eb.zip
Code style
Some style fixes for pylint.
-rwxr-xr-xspline-startup19
1 files changed, 12 insertions, 7 deletions
diff --git a/spline-startup b/spline-startup
index c961d61..545dee9 100755
--- a/spline-startup
+++ b/spline-startup
@@ -84,23 +84,24 @@ class SplineStartup(object):
else:
return 0
- def _run_scripts(self, user, action, su=True):
+ def _run_scripts(self, user, action, use_su=True):
self._pdebug("Running scripts for user '%s'" % user.pw_name)
- dir = os.path.join(user.pw_dir, 'etc', 'rc.d')
+ directory = os.path.join(user.pw_dir, 'etc', 'rc.d')
args = ['--arg=%s' % quote(action)]
if action == 'stop':
args.append('--reverse')
- if not os.path.isdir(dir):
+ if not os.path.isdir(directory):
return True
- if su:
+ if use_su:
returnvalue = self._call(['su', '-', user.pw_name,
'-c', 'run-parts %s -- %s' %
- (' '.join(args), quote(dir))])
+ (' '.join(args),
+ quote(directory))])
else:
- returnvalue = self._call(['run-parts'] + args + ['--', dir])
+ returnvalue = self._call(['run-parts'] + args + ['--', directory])
return returnvalue == 0
@@ -124,6 +125,10 @@ class SplineStartup(object):
self._run_scripts(user, self.options.action)
-if __name__ == '__main__':
+def main():
app = SplineStartup()
app.run()
+
+
+if __name__ == '__main__':
+ main()