Add files

pull/354/head
Nicolas Hennion 2014-01-12 20:59:06 +01:00
parent 9335672b05
commit 496f6e8795
7 changed files with 120 additions and 0 deletions

24
glances/README.txt Normal file
View File

@ -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
...

0
glances/core/__init__.py Normal file
View File

View File

@ -0,0 +1,26 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Glances - An eye on your system
#
# Copyright (C) 2014 Nicolargo <nicolas@nicolargo.com>
#
# 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 <http://www.gnu.org/licenses/>.
class GlancesCore(object):
"""
"""
def start(self):
print("Start Glances")

View File

View File

View File

@ -0,0 +1,42 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Glances - An eye on your system
#
# Copyright (C) 2014 Nicolargo <nicolas@nicolargo.com>
#
# 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 <http://www.gnu.org/licenses/>.
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

View File

@ -0,0 +1,28 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Glances - An eye on your system
#
# Copyright (C) 2014 Nicolargo <nicolas@nicolargo.com>
#
# 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 <http://www.gnu.org/licenses/>.
class GlancesPlugin(object):
"""
Main class for Glances' plugin
"""
def __init__(self):
# Init the stat list
self.stats = None