Skip to content

Commit

Permalink
OS X -> macOS
Browse files Browse the repository at this point in the history
  • Loading branch information
asergi committed Jan 18, 2017
1 parent 9cf2863 commit 47a85ee
Show file tree
Hide file tree
Showing 12 changed files with 30 additions and 30 deletions.
2 changes: 1 addition & 1 deletion .coveragerc
Expand Up @@ -26,5 +26,5 @@ exclude_lines =
except ImportError:
raise NotImplementedError
if WINDOWS
if OSX
if MACOS
if BSD
8 changes: 4 additions & 4 deletions README.rst
Expand Up @@ -9,7 +9,7 @@ Glances - An eye on your system
:target: https://github.com/nicolargo/glances/
:alt: Github stars

.. image:: https://img.shields.io/travis/nicolargo/glances/master.svg?maxAge=3600&label=Linux%20/%20BSD%20/%20OSX
.. image:: https://img.shields.io/travis/nicolargo/glances/master.svg?maxAge=3600&label=Linux%20/%20BSD%20/%20macOS
:target: https://travis-ci.org/nicolargo/glances
:alt: Linux tests (Travis)

Expand Down Expand Up @@ -226,10 +226,10 @@ To install Glances from ports:
# cd /usr/ports/sysutils/py-glances/
# make install clean
OS X
----
macOS
-----

OS X users can install Glances using ``Homebrew`` or ``MacPorts``.
macOS users can install Glances using ``Homebrew`` or ``MacPorts``.

Homebrew
````````
Expand Down
2 changes: 1 addition & 1 deletion docs/cmds.rst
Expand Up @@ -323,7 +323,7 @@ The following commands (key pressed) are supported while in Glances:
``ENTER``
Set the process filter

**Note**: on OS X, please use ``CTRL-H`` to delete
**Note**: on macOS, please use ``CTRL-H`` to delete
filter.

Filter is a regular expression pattern:
Expand Down
10 changes: 5 additions & 5 deletions docs/config.rst
Expand Up @@ -20,7 +20,7 @@ You can put your own ``glances.conf`` file in the following locations:
=========== ============================================================
``Linux`` ~/.config/glances ($XDG_CONFIG_HOME environment variable) or /etc/glances
``*BSD`` ~/.config/glances or /usr/local/etc/glances
``OS X`` ~/Library/Application Support/glances or /usr/local/etc/glances
``macOS`` ~/Library/Application Support/glances or /usr/local/etc/glances
``Windows`` %APPDATA%\\glances
=========== ============================================================

Expand Down Expand Up @@ -108,10 +108,10 @@ line.

By default, the ``glances-USERNAME.log`` file is under the temporary directory:

===================== ==================================================
``Linux, *BSD, OS X`` /tmp
``Windows`` %APPDATA%\\Local\\temp
===================== ==================================================
====================== ==================================================
``Linux, *BSD, macOS`` /tmp
``Windows`` %APPDATA%\\Local\\temp
====================== ==================================================

If you want to use another system path or change the log message, you can use
your own logger configuration. First of all you have to create a glances.json
Expand Down
8 changes: 4 additions & 4 deletions glances/config.py
Expand Up @@ -25,7 +25,7 @@
from io import open

from glances.compat import ConfigParser, NoOptionError
from glances.globals import BSD, LINUX, OSX, WINDOWS, sys_prefix
from glances.globals import BSD, LINUX, MACOS, WINDOWS, sys_prefix
from glances.logger import logger


Expand All @@ -52,8 +52,8 @@ def config_file_paths(self):
* custom path: /path/to/glances
* Linux: ~/.config/glances, /etc/glances
* BSD: ~/.config/glances, /usr/local/etc/glances
* OS X: ~/Library/Application Support/glances, /usr/local/etc/glances
* *BSD: ~/.config/glances, /usr/local/etc/glances
* macOS: ~/Library/Application Support/glances, /usr/local/etc/glances
* Windows: %APPDATA%\glances
The config file will be searched in the following order of priority:
Expand All @@ -75,7 +75,7 @@ def config_file_paths(self):
paths.append(os.path.join(sys.prefix, 'etc', 'glances', self.config_filename))
else:
paths.append(os.path.join('/etc/glances', self.config_filename))
elif OSX:
elif MACOS:
paths.append(
os.path.join(os.path.expanduser('~/Library/Application Support/glances'),
self.config_filename))
Expand Down
2 changes: 1 addition & 1 deletion glances/globals.py
Expand Up @@ -26,7 +26,7 @@
# Note: Somes libs depends of OS
BSD = sys.platform.find('bsd') != -1
LINUX = sys.platform.startswith('linux')
OSX = sys.platform.startswith('darwin')
MACOS = sys.platform.startswith('darwin')
SUNOS = sys.platform.startswith('sunos')
WINDOWS = sys.platform.startswith('win')

Expand Down
4 changes: 2 additions & 2 deletions glances/outdated.py
Expand Up @@ -33,7 +33,7 @@
outdated_tag = True

from glances import __version__
from glances.globals import BSD, LINUX, OSX, WINDOWS
from glances.globals import BSD, LINUX, MACOS, WINDOWS
from glances.logger import logger


Expand Down Expand Up @@ -156,7 +156,7 @@ def _cache_path(self):
return os.path.join(os.environ.get('XDG_CONFIG_HOME') or
os.path.expanduser('~/.config'),
'glances')
elif OSX:
elif MACOS:
return os.path.expanduser('~/Library/Application Support/glances')
elif WINDOWS:
return os.path.join(os.environ.get('APPDATA'), 'glances')
Expand Down
4 changes: 2 additions & 2 deletions glances/outputs/glances_curses.py
Expand Up @@ -23,7 +23,7 @@
import sys

from glances.compat import u, itervalues
from glances.globals import OSX, WINDOWS
from glances.globals import MACOS, WINDOWS
from glances.logger import logger
from glances.logs import glances_logs
from glances.processes import glances_processes
Expand Down Expand Up @@ -751,7 +751,7 @@ def __display_right(self, stat_display):
self.new_line()
self.display_plugin(stat_display["processlist"],
display_optional=(self.screen.getmaxyx()[1] > 102),
display_additional=(not OSX),
display_additional=(not MACOS),
max_y=(self.screen.getmaxyx()[0] - self.get_stats_display_height(stat_display["alert"]) - 2))
self.new_line()
self.display_plugin(stat_display["alert"])
Expand Down
8 changes: 4 additions & 4 deletions glances/password.py
Expand Up @@ -27,7 +27,7 @@
from io import open

from glances.compat import b, input
from glances.globals import BSD, LINUX, OSX, WINDOWS
from glances.globals import BSD, LINUX, MACOS, WINDOWS
from glances.logger import logger


Expand All @@ -44,13 +44,13 @@ def __init__(self, username='glances'):
def get_password_path(self):
r"""Get the path where the password file will be stored.
* Linux and BSD: ~/.config/glances
* OS X: ~/Library/glances
* Linux and *BSD: ~/.config/glances
* macOS: ~/Library/glances
* Windows: %APPDATA%\glances
"""
if LINUX or BSD:
app_path = os.environ.get('XDG_CONFIG_HOME') or os.path.expanduser('~/.config')
elif OSX:
elif MACOS:
app_path = os.path.join(os.environ.get('HOME'), 'Library')
elif WINDOWS:
app_path = os.environ.get('APPDATA')
Expand Down
2 changes: 1 addition & 1 deletion glances/plugins/glances_mem.py
Expand Up @@ -99,7 +99,7 @@ def update(self):
# inactive: (UNIX): memory that is marked as not used.
# buffers: (Linux, BSD): cache for things like file system metadata.
# cached: (Linux, BSD): cache for various things.
# wired: (BSD, OSX): memory that is marked to always stay in RAM. It is never moved to disk.
# wired: (BSD, macOS): memory that is marked to always stay in RAM. It is never moved to disk.
# shared: (BSD): memory that may be simultaneously accessed by multiple processes.
self.reset()
for mem in ['total', 'available', 'percent', 'used', 'free',
Expand Down
2 changes: 1 addition & 1 deletion glances/plugins/glances_processlist.py
Expand Up @@ -287,7 +287,7 @@ def get_process_curses_data(self, p, first, args):
except (OverflowError, TypeError) as e:
# Catch OverflowError on some Amazon EC2 server
# See https://github.com/nicolargo/glances/issues/87
# Also catch TypeError on Mac OS X
# Also catch TypeError on macOS
# See: https://github.com/nicolargo/glances/issues/622
logger.debug("Cannot get TIME+ ({})".format(e))
self.tag_proc_time = False
Expand Down
8 changes: 4 additions & 4 deletions glances/processes.py
Expand Up @@ -21,7 +21,7 @@
import os

from glances.compat import iteritems, itervalues, listitems
from glances.globals import BSD, LINUX, OSX, SUNOS, WINDOWS
from glances.globals import BSD, LINUX, MACOS, SUNOS, WINDOWS
from glances.timer import Timer, getTimeSinceLastUpdate
from glances.processes_tree import ProcessTreeNode
from glances.filter import GlancesFilter
Expand Down Expand Up @@ -279,7 +279,7 @@ def __get_mandatory_stats(self, proc, procstat):
# If io_tag = 0 > Access denied (display "?")
# If io_tag = 1 > No access denied (display the IO rate)
# Availability: all platforms except macOS and Illumos/Solaris
if not (OSX or SUNOS):
if not (MACOS or SUNOS):
try:
# Get the process IO counters
proc_io = proc.io_counters()
Expand Down Expand Up @@ -428,12 +428,12 @@ def update(self):
standard_stats=self.max_processes is None)
# Check if s is note None (issue #879)
# ignore the 'idle' process on Windows and *BSD
# ignore the 'kernel_task' process on OS X
# ignore the 'kernel_task' process on macOS
# waiting for upstream patch from psutil
if (s is None or
BSD and s['name'] == 'idle' or
WINDOWS and s['name'] == 'System Idle Process' or
OSX and s['name'] == 'kernel_task'):
MACOS and s['name'] == 'kernel_task'):
continue
# Continue to the next process if it has to be filtered
if self._filter.is_filtered(s):
Expand Down

0 comments on commit 47a85ee

Please sign in to comment.