get rid of thread_id and useless logic it used

This commit is contained in:
Von Random 2016-11-21 13:34:32 +03:00
parent bb9658d053
commit 0495bc2d79
7 changed files with 7 additions and 9 deletions

View file

@ -5,7 +5,7 @@ BATTERY_DIR = '/sys/class/power_supply/BAT0/'
class PluginThread(plugins.common.PluginThreadCommon):
def __init__(self, section, config, thread_id):
def __init__(self, section, config):
super(PluginThread, self).__init__(section, config)
def main(self):

View file

@ -3,7 +3,7 @@ import plugins.common
class PluginThread(plugins.common.PluginThreadCommon):
def __init__(self, section, config, thread_id):
def __init__(self, section, config):
super(PluginThread, self).__init__(section, config)
self.date_format = config.get(section, 'format', fallback='%c')

View file

@ -3,7 +3,7 @@ import psutil
class PluginThread(plugins.common.PluginThreadCommon):
def __init__(self, section, config, thread_id):
def __init__(self, section, config):
super(PluginThread, self).__init__(section, config)
self.part = config.get(section, 'part')

View file

@ -3,7 +3,7 @@ import plugins.common
class PluginThread(plugins.common.PluginThreadCommon):
def __init__(self, section, config, thread_id):
def __init__(self, section, config):
super(PluginThread, self).__init__(section, config)
self.hide_ok = config.getboolean(section, 'hide_ok', fallback=False)

View file

@ -3,7 +3,7 @@ import plugins.common
class PluginThread(plugins.common.PluginThreadCommon):
def __init__(self, section, config, thread_id):
def __init__(self, section, config):
super(PluginThread, self).__init__(section, config)
def main(self):

View file

@ -4,7 +4,7 @@ import plugins.common
class PluginThread(plugins.common.PluginThreadCommon):
def __init__(self, section, config, thread_id):
def __init__(self, section, config):
super(PluginThread, self).__init__(section, config)
self.hosts = config.get(section, 'hosts').split(',')
self.title = config.get(section, 'title')

View file

@ -1,7 +1,6 @@
#!/usr/bin/python3
# TODO: handle SIGINT properly
# TODO: add documentation / comments
# TODO: add a dummy plugin to use as a starting point
# TODO: interactivity support
import argparse
import configparser
@ -36,9 +35,8 @@ class PluginRunner:
self.format_output = self.format_term
for section in self.config.sections():
plugin_name = self.config.get(section, 'plugin')
plugin_id = len(self.plugins_loaded)
module = importlib.import_module('.' + plugin_name, 'plugins')
thread_object = module.PluginThread(section, self.config, plugin_id)
thread_object = module.PluginThread(section, self.config)
self.plugins_loaded.append(thread_object)
def start(self):