diff --git a/glances/README.txt b/glances/README.txt new file mode 100644 index 00000000..62755e2c --- /dev/null +++ b/glances/README.txt @@ -0,0 +1,24 @@ +You are in the main Glances's source folder. +This page is for developpers and contributors. + +If you are lookink for user manual, please follow this link: https://github.com/nicolargo/glances/blob/master/docs/glances-doc.rst + +=== + +glances_main.py Main script to rule them up... +core/ + glances_client.py Glances client + glances_config.py Script to manage configuration file + glances_server.py Glances_server +plugins/ + glances_plugins.py Main class for others plugins + glances_cpu.py Grab CPU stats + glances_load.py Grab LOAD stats + glances_mem.py Grab MEM (both RAM and SWAP) stats + ... +outputs/ + glances_api.py The API interface + glances_curse.py The Curse (console) interface + glances_csv.py The CSV interface + glances_html.py The HTML interface + ... \ No newline at end of file diff --git a/glances/core/__init__.py b/glances/core/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/glances/core/glances_core.py b/glances/core/glances_core.py new file mode 100644 index 00000000..39989ab4 --- /dev/null +++ b/glances/core/glances_core.py @@ -0,0 +1,26 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +# +# Glances - An eye on your system +# +# Copyright (C) 2014 Nicolargo +# +# Glances is free software; you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# Glances is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with this program. If not, see . + +class GlancesCore(object): + """ + """ + + def start(self): + print("Start Glances") diff --git a/glances/outputs/__init__.py b/glances/outputs/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/glances/plugins/__init__.py b/glances/plugins/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/glances/plugins/glances_cpu.py b/glances/plugins/glances_cpu.py new file mode 100644 index 00000000..de3f7d67 --- /dev/null +++ b/glances/plugins/glances_cpu.py @@ -0,0 +1,42 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +# +# Glances - An eye on your system +# +# Copyright (C) 2014 Nicolargo +# +# Glances is free software; you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# Glances is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with this program. If not, see . + +from ..plugins.glances_plugin import GlancesPlugin + +class CpuPlugin(GlancesPlugin): + """ + Glances' Cpu Plugin + + stats is a dict + """ + + def __init__(self): + GlancesPlugin.__init__(self) + self.update() + + def update(self): + # !!! Example + self.stats = { 'user': 15, 'iowait': 10 } + + def __str__(self): + ret = "CPU\n" + for k in self.stats: + ret += "{0} {1}\n".format(k, self.stats[k]) + return ret diff --git a/glances/plugins/glances_plugin.py b/glances/plugins/glances_plugin.py new file mode 100644 index 00000000..de20f450 --- /dev/null +++ b/glances/plugins/glances_plugin.py @@ -0,0 +1,28 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +# +# Glances - An eye on your system +# +# Copyright (C) 2014 Nicolargo +# +# Glances is free software; you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# Glances is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with this program. If not, see . + +class GlancesPlugin(object): + """ + Main class for Glances' plugin + """ + + def __init__(self): + # Init the stat list + self.stats = None