~sforman/python-oberon#7: 
It doesn't work.

I tried to run the CLI command from the README and "It doesn't work."

PythonOberon$ python -i -m oberon
/home/spf/Desktop/bock/sforman/src/PythonOberon/oberon/__main__.py:26: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
  from pkg_resources import resource_filename
Unable to import pygame.
Traceback (most recent call last):
  File "/usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/home/spf/Desktop/bock/sforman/src/PythonOberon/oberon/__main__.py", line 99, in <module>
    print(('Using disk image file', args.disk_image.name))
AttributeError: 'Namespace' object has no attribute 'disk_image'
>>> 

There are at least three things wrong here:

1 DeprecationWarning: pkg_resources

I'm annoyed by what I see as the hijinx of Python's deploy story these days (PyPA is out of Brazil IMO) but that's neither here nor there. In any event, I gotta stop using resource_filename.

2 Unable to import pygame.

I thought I had it install? Easy fix.

3 AttributeError: 'Namespace' object has no attribute 'disk_image'

I'm guessing that's because I didn't put a 'disk_image' in the Namespace? args.disk_image.name suggests that this is a CLI option that is now required.

Status
REPORTED
Submitter
~sforman
Assigned to
No-one
Submitted
6 months ago
Updated
6 months ago
Labels
No labels applied.

~sforman 6 months ago

It's because there's no subcommand, so the subparser never adds the default attr. Running with emulate allows it to proceed:

PythonOberon$ python -m oberon emulate
/home/spf/Desktop/bock/sforman/src/PythonOberon/oberon/__main__.py:26: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
  from pkg_resources import resource_filename
Unable to import pygame.
('Using disk image file', '/home/spf/Desktop/bock/sforman/src/PythonOberon/oberon/disk.img')
0
LEDs 10000000
LEDs 10000010
10000
20000
30000
40000
50000
60000
Register here or Log in to comment, or comment via email.