TkTech / Burger

A simple tool for picking out information from the minecraft JARs, primarily useful for developers.
MIT License
145 stars 33 forks source link

Cant get it to run: SyntaxError: invalid syntax #34

Closed njt1982 closed 4 years ago

njt1982 commented 4 years ago
$ python munch.py ~/Desktop/server.jar
Traceback (most recent call last):
  File "munch.py", line 37, in <module>
    from jawa.classloader import ClassLoader
  File "/usr/local/lib/python2.7/site-packages/jawa-2.2.0-py2.7.egg/jawa/classloader.py", line 41
    def __init__(self, *sources, max_cache: int=50, klass=ClassFile,
                                         ^
SyntaxError: invalid syntax

I have run the setup.py install and it seems to have worked...

$ python setup.py install
running install
running bdist_egg
running egg_info
writing requirements to Burger.egg-info/requires.txt
writing Burger.egg-info/PKG-INFO
writing top-level names to Burger.egg-info/top_level.txt
writing dependency_links to Burger.egg-info/dependency_links.txt
reading manifest file 'Burger.egg-info/SOURCES.txt'
writing manifest file 'Burger.egg-info/SOURCES.txt'
installing library code to build/bdist.macosx-10.15-x86_64/egg
running install_lib
running build_py
creating build/bdist.macosx-10.15-x86_64/egg
creating build/bdist.macosx-10.15-x86_64/egg/burger
copying build/lib/burger/util.py -> build/bdist.macosx-10.15-x86_64/egg/burger
copying build/lib/burger/__init__.py -> build/bdist.macosx-10.15-x86_64/egg/burger
copying build/lib/burger/roundedfloats.py -> build/bdist.macosx-10.15-x86_64/egg/burger
creating build/bdist.macosx-10.15-x86_64/egg/burger/toppings
copying build/lib/burger/toppings/tags.py -> build/bdist.macosx-10.15-x86_64/egg/burger/toppings
copying build/lib/burger/toppings/topping.py -> build/bdist.macosx-10.15-x86_64/egg/burger/toppings
copying build/lib/burger/toppings/biomes.py -> build/bdist.macosx-10.15-x86_64/egg/burger/toppings
copying build/lib/burger/toppings/version.py -> build/bdist.macosx-10.15-x86_64/egg/burger/toppings
copying build/lib/burger/toppings/sounds.py -> build/bdist.macosx-10.15-x86_64/egg/burger/toppings
copying build/lib/burger/toppings/entitymetadata.py -> build/bdist.macosx-10.15-x86_64/egg/burger/toppings
copying build/lib/burger/toppings/blockstates.py -> build/bdist.macosx-10.15-x86_64/egg/burger/toppings
copying build/lib/burger/toppings/__init__.py -> build/bdist.macosx-10.15-x86_64/egg/burger/toppings
copying build/lib/burger/toppings/stats.py -> build/bdist.macosx-10.15-x86_64/egg/burger/toppings
copying build/lib/burger/toppings/language.py -> build/bdist.macosx-10.15-x86_64/egg/burger/toppings
copying build/lib/burger/toppings/recipes.py -> build/bdist.macosx-10.15-x86_64/egg/burger/toppings
copying build/lib/burger/toppings/packetinstructions.py -> build/bdist.macosx-10.15-x86_64/egg/burger/toppings
copying build/lib/burger/toppings/entities.py -> build/bdist.macosx-10.15-x86_64/egg/burger/toppings
copying build/lib/burger/toppings/identify.py -> build/bdist.macosx-10.15-x86_64/egg/burger/toppings
copying build/lib/burger/toppings/blocks.py -> build/bdist.macosx-10.15-x86_64/egg/burger/toppings
copying build/lib/burger/toppings/objects.py -> build/bdist.macosx-10.15-x86_64/egg/burger/toppings
copying build/lib/burger/toppings/items.py -> build/bdist.macosx-10.15-x86_64/egg/burger/toppings
copying build/lib/burger/toppings/tileentities.py -> build/bdist.macosx-10.15-x86_64/egg/burger/toppings
copying build/lib/burger/toppings/packets.py -> build/bdist.macosx-10.15-x86_64/egg/burger/toppings
copying build/lib/burger/website.py -> build/bdist.macosx-10.15-x86_64/egg/burger
byte-compiling build/bdist.macosx-10.15-x86_64/egg/burger/util.py to util.pyc
byte-compiling build/bdist.macosx-10.15-x86_64/egg/burger/__init__.py to __init__.pyc
byte-compiling build/bdist.macosx-10.15-x86_64/egg/burger/roundedfloats.py to roundedfloats.pyc
byte-compiling build/bdist.macosx-10.15-x86_64/egg/burger/toppings/tags.py to tags.pyc
byte-compiling build/bdist.macosx-10.15-x86_64/egg/burger/toppings/topping.py to topping.pyc
byte-compiling build/bdist.macosx-10.15-x86_64/egg/burger/toppings/biomes.py to biomes.pyc
byte-compiling build/bdist.macosx-10.15-x86_64/egg/burger/toppings/version.py to version.pyc
byte-compiling build/bdist.macosx-10.15-x86_64/egg/burger/toppings/sounds.py to sounds.pyc
byte-compiling build/bdist.macosx-10.15-x86_64/egg/burger/toppings/entitymetadata.py to entitymetadata.pyc
byte-compiling build/bdist.macosx-10.15-x86_64/egg/burger/toppings/blockstates.py to blockstates.pyc
byte-compiling build/bdist.macosx-10.15-x86_64/egg/burger/toppings/__init__.py to __init__.pyc
byte-compiling build/bdist.macosx-10.15-x86_64/egg/burger/toppings/stats.py to stats.pyc
byte-compiling build/bdist.macosx-10.15-x86_64/egg/burger/toppings/language.py to language.pyc
byte-compiling build/bdist.macosx-10.15-x86_64/egg/burger/toppings/recipes.py to recipes.pyc
byte-compiling build/bdist.macosx-10.15-x86_64/egg/burger/toppings/packetinstructions.py to packetinstructions.pyc
byte-compiling build/bdist.macosx-10.15-x86_64/egg/burger/toppings/entities.py to entities.pyc
byte-compiling build/bdist.macosx-10.15-x86_64/egg/burger/toppings/identify.py to identify.pyc
byte-compiling build/bdist.macosx-10.15-x86_64/egg/burger/toppings/blocks.py to blocks.pyc
byte-compiling build/bdist.macosx-10.15-x86_64/egg/burger/toppings/objects.py to objects.pyc
byte-compiling build/bdist.macosx-10.15-x86_64/egg/burger/toppings/items.py to items.pyc
byte-compiling build/bdist.macosx-10.15-x86_64/egg/burger/toppings/tileentities.py to tileentities.pyc
byte-compiling build/bdist.macosx-10.15-x86_64/egg/burger/toppings/packets.py to packets.pyc
byte-compiling build/bdist.macosx-10.15-x86_64/egg/burger/website.py to website.pyc
creating build/bdist.macosx-10.15-x86_64/egg/EGG-INFO
copying Burger.egg-info/PKG-INFO -> build/bdist.macosx-10.15-x86_64/egg/EGG-INFO
copying Burger.egg-info/SOURCES.txt -> build/bdist.macosx-10.15-x86_64/egg/EGG-INFO
copying Burger.egg-info/dependency_links.txt -> build/bdist.macosx-10.15-x86_64/egg/EGG-INFO
copying Burger.egg-info/requires.txt -> build/bdist.macosx-10.15-x86_64/egg/EGG-INFO
copying Burger.egg-info/top_level.txt -> build/bdist.macosx-10.15-x86_64/egg/EGG-INFO
zip_safe flag not set; analyzing archive contents...
creating 'dist/Burger-0.3.0-py2.7.egg' and adding 'build/bdist.macosx-10.15-x86_64/egg' to it
removing 'build/bdist.macosx-10.15-x86_64/egg' (and everything under it)
Processing Burger-0.3.0-py2.7.egg
Removing /usr/local/lib/python2.7/site-packages/Burger-0.3.0-py2.7.egg
Copying Burger-0.3.0-py2.7.egg to /usr/local/lib/python2.7/site-packages
Burger 0.3.0 is already the active version in easy-install.pth

Installed /usr/local/lib/python2.7/site-packages/Burger-0.3.0-py2.7.egg
Processing dependencies for Burger==0.3.0
Searching for jawa==2.2.0
Best match: jawa 2.2.0
Processing jawa-2.2.0-py2.7.egg
jawa 2.2.0 is already the active version in easy-install.pth
Installing jawa script to /usr/local/bin

Using /usr/local/lib/python2.7/site-packages/jawa-2.2.0-py2.7.egg
Searching for six==1.15.0
Best match: six 1.15.0
Processing six-1.15.0-py2.7.egg
six 1.15.0 is already the active version in easy-install.pth

Using /usr/local/lib/python2.7/site-packages/six-1.15.0-py2.7.egg
Searching for click==7.1.2
Best match: click 7.1.2
Processing click-7.1.2-py2.7.egg
click 7.1.2 is already the active version in easy-install.pth

Using /usr/local/lib/python2.7/site-packages/click-7.1.2-py2.7.egg
Finished processing dependencies for Burger==0.3.0

What am I doing wrong/missing? 😉

Might be an idea to have paragraph in the README about installation steps/requirements?

Pokechu22 commented 4 years ago

You need to use Python 3.7 or newer (jawa requires it).

njt1982 commented 4 years ago

Ok... so no I have a new error ;)

➜  Burger git:(master) python3 --version
Python 3.7.3
➜  Burger git:(master) python3 setup.py install
running install
error: can't create or remove files in install directory

The following error occurred while trying to add or remove files in the
installation directory:

    [Errno 2] No such file or directory: '/Library/Python/3.7/site-packages/test-easy-install-4334.write-test'

The installation directory you specified (via --install-dir, --prefix, or
the distutils default setting) was:

    /Library/Python/3.7/site-packages/

This directory does not currently exist.  Please create it and try again, or
choose a different installation directory (using the -d or --install-dir
option).

Guessing I either need to set an install directory or make that folder (really wanna install stuff for this package into such a global location tbh?)

njt1982 commented 4 years ago

python3 setup.py install --root ./ < That seemed to run without error...

Copying Burger.egg-info to ./Library/Python/3.7/site-packages/Burger-0.3.0-py3.7.egg-info
njt1982 commented 4 years ago

ahhh python3 setup.py install --user ^ This worked..

python3 munch.py ~/Desktop/server.jar
[
    {
        "achievements": {},
        "biomes": {
            "biome": {
                "badlands": {
                    "class": "bko",
                    "field": "M",
                    "height": [
                        0.1,
...
...
njt1982 commented 4 years ago

Maybe this will help someone in the future. Closing for now.

Ironically, it didn't help me in this case... I was hoping to find the smelting recipes in the data.

Pokechu22 commented 4 years ago

You should be able to get smelting recipes via data generators (or just looking in the data/minecraft/recipes/ folder). Burger only includes regular crafting recipes, because the current UI code only exists for them and I haven't felt a need to add the other recipe types.

(Side note, for 1.16 snapshots, you need to use my 1.16-dev branch. That'll be merged into master when 1.16 releases, and when another version is started I'll use a new branch for that)

njt1982 commented 4 years ago

Thanks for the tip @Pokechu22