Skip to content

astlog not working in MacOS environments #5

@gzrubio

Description

@gzrubio

Hello!

First of all thanks for your amazing tool, it has made my life way easier :)

I recently switched to a MacOS environment and when I try to use the tool I get an error about a file missing:

(astlog) gonzalo@XXXX ~ % astlog $PWD/sip.log
Traceback (most recent call last):
  File "/Users/gonzalo/astlog/astlog/app.py", line 1112, in run
    self.loop.run()
  File "/Users/gonzalo/.virtualenvs/astlog/lib/python3.9/site-packages/urwid-2.6.10-py3.9.egg/urwid/event_loop/main_loop.py", line 337, in run
    self._run()
  File "/Users/gonzalo/.virtualenvs/astlog/lib/python3.9/site-packages/urwid-2.6.10-py3.9.egg/urwid/event_loop/main_loop.py", line 439, in _run
    self.event_loop.run()
  File "/Users/gonzalo/.virtualenvs/astlog/lib/python3.9/site-packages/urwid-2.6.10-py3.9.egg/urwid/event_loop/select_loop.py", line 182, in run
    self._loop()
  File "/Users/gonzalo/.virtualenvs/astlog/lib/python3.9/site-packages/urwid-2.6.10-py3.9.egg/urwid/event_loop/select_loop.py", line 224, in _loop
    alarm_callback()
  File "/Users/gonzalo/.virtualenvs/astlog/lib/python3.9/site-packages/urwid-2.6.10-py3.9.egg/urwid/event_loop/main_loop.py", line 218, in cb
    callback(self, user_data)
  File "/Users/gonzalo/astlog/astlog/app.py", line 1110, in <lambda>
    self.loop.set_alarm_in(0, lambda loop, data: self.reload_file())
  File "/Users/gonzalo/astlog/astlog/app.py", line 1035, in reload_file
    self.parser.load_file(progress)
  File "/Users/gonzalo/astlog/astlog/reader.py", line 559, in load_file
    data = self.read_data()
  File "/Users/gonzalo/astlog/astlog/reader.py", line 548, in read_data
    mem_size = get_memory_size()
  File "/Users/gonzalo/astlog/astlog/reader.py", line 1449, in get_memory_size
    with open('/proc/meminfo') as f:
FileNotFoundError: [Errno 2] No such file or directory: '/proc/meminfo'

I suspect this has to do with the get_memory_size method:

Given that MacOS does not use /proc/ :

  • is there any way to circumvent this memory size check?
  • Alternatively, can we add support for it? -> Do you accept external PRs? I would not mind to try to fix it myself!

Best,

grubio

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions