Kapiainen / Lauhdutin

A Rainmeter skin for launching games.
MIT License
67 stars 8 forks source link

After save and exit i get this error #16

Closed Xarishark closed 7 years ago

Xarishark commented 7 years ago

image

Kavex commented 7 years ago

Go into Lauhdutin\@Resources\ and delete settings.json file. This will allow you to fill out the settings again.

If you are still having issues please provide Rainmeter and Python versions

Xarishark commented 7 years ago

still having the error i have the latest python and rainmeter.

Xarishark commented 7 years ago

image

Xarishark commented 7 years ago

versions are on the right.

Kavex commented 7 years ago

From looking at the code I believe that error comes from an incorrect steam path. I'm not sure if the GUI is filling out or reading the .json correctly. What does the "steam_path":"" say in the settings.json under Lauhdutin\@Resources\ ?

Mine doesn't seem to fill out any settings in the settings.json nor does it the browse button work. I've manually edit the Frontend Settings.lua to auto fill this information for me but it still refuses to get pass Processing.

Edit: Fixed my browsing and json writing issue, user error (duh!) I had to restart after changing python path for 3.x.

Any input on this Kapiainen?

Xarishark commented 7 years ago

"steam_path":"C:\/Program Files (x86)\/Steam"

Kavex commented 7 years ago

You forgot to put code markdown so is it this? "steam_path":"C:\/Program Files (x86)\/Steam"

Xarishark commented 7 years ago

oh shit yes thats how it is

Kapiainen commented 7 years ago

Could you modify Python="pythonw" to Python="python" in the Main.ini file and try loading that config again? The line in question is under the Variables section. The command prompt will then be visible when the Python script is executed and hopefully help to narrow down the source of the problem. The scripts should print out some stuff including a stack traceback, if an exception was caught.

Kavex commented 7 years ago

It's throwing an ImportError in BannerDownloader.py

No module named request

Kapiainen commented 7 years ago

That is odd. urllib.request is part of the standard library and has been for a long time (at least since 3.3.0 according to available documentation). Could you verify by opening up the Python interpreter and trying to import that module (import urllib.request)?

Kavex commented 7 years ago

Yeah it was added awhile ago

It imports without throwing an error in the interpreter

Kavex commented 7 years ago

I think it wants to run Python 2.7 since I have both installed

I changed import from urllib.request to urllib and it runs just fine. You might need to throw in a check.

Edit: Yep I was correct, I throw in a print (sys.version) and it's running 2.7 which is weird because the python path is set to 3.6.

Xarishark commented 7 years ago

So what do i need to do?

Kavex commented 7 years ago

@Xarishark Go into Lauhdutin\@Resources\Backend\ and open BannerDownloader.py

Change import os, urllib.request, time to import os, urllib, time

Xarishark commented 7 years ago

stuck at processing now

Xarishark commented 7 years ago

no network activity indicating that it downloads anything

Kavex commented 7 years ago

@Xarishark Please modify Python="pythonw" to Python="python" in the Main.ini

Xarishark commented 7 years ago

done and still stuck at processing image

Kapiainen commented 7 years ago

Could you post a screenshot of the Python script's output to the console?

Kavex commented 7 years ago

@Xarishark a terminal window should have popped up

What did it say? and you are refreshing the skin right?

Xarishark commented 7 years ago

Yes im refreshing there is no terminal open tho. It appears and disappears instantly . The terminal i mean

Kavex commented 7 years ago

@Xarishark Delete the Lauhdutin folder and re-add a fresh one then modify Python="pythonw" to Python="python" in the Main.ini and run the setup.

Let's start with a base case again

See if the terminal stays open

Xarishark commented 7 years ago

image

Kapiainen commented 7 years ago

Could you open \Lauhdutin\@Resources\Backend\Steam.py and replace line 33

with open(a_path) as f:

with this

with open(a_path, encoding="utf-8") as f:

Xarishark commented 7 years ago

image

Xarishark commented 7 years ago

how do i hide the terminal now?

Xarishark commented 7 years ago

also anyway to make the orientation horizontal pls?

Kavex commented 7 years ago

@Xarishark Change back to Python="pythonw in Main.ini and this should make the terminal disappear.

Xarishark commented 7 years ago

what about the horizontality ?

Kavex commented 7 years ago

Kapiainen has to answer that one because I have no clue about the new version

Xarishark commented 7 years ago

ty!

Kapiainen commented 7 years ago

Horizontal orientation is not supported at the moment, but it is on the list of stuff to add in the next version.

Kavex commented 7 years ago

@Kapiainen

You might want to write an if statement for BannerDownloader.py in case someone has both version of python installed. For some reason BannerDownloader.py wanted to run 2.7 even tho the path was set to 3.6.

import sys

if sys.version_info[0] == 3:
    import os, urllib.request, time
else:
    import os, urllib, time

Or at least a Frontend warning if python 2.7 is running

Might save you a future headache, food for thought.

Kapiainen commented 7 years ago

@Kavex I'd rather avoid the hassle (renamed/restructured modules, handling of Unicode, etc.) of supporting both Python 2.x and 3.x. I support both major versions in a few other projects because I have to, but I'd rather not have that headache in this project. I'll be adding some checks, extra print statements, pass more info about exceptions straight to the skin, etc. for the next version. Among those things will straight up be a warning that, as you also suggested, the system is trying to run the Python scripts with an unsupported version.

Kavex commented 7 years ago

@Kapiainen

I totally understand and the more information on the exceptions will be nice :) Good work so far

I'll have to fix the problem with it running 2.7 which isn't hard but not everyone is so computer literate as us even tho Python happens to be on the low end of the totem pole for me as for languages I know.

Cheers :3

Kapiainen commented 7 years ago

@Kavex Thanks. And thank you for the issue template and helping out with this issue report. I'm adding a Python path setting to the settings GUI to make it easier to adjust and also adding it to the settings.json file so that the value can be retained when updating from one version of Lauhdutin 2.x.x to the next.

Kavex commented 7 years ago

@Kapiainen You're very welcome, I find the templates very useful for my stuff. You should edit it more so people are required to present more information then just "It's broken!!!" when creating an issue ticket. XD

Also I'd suggest using the Wiki too :)

Kapiainen commented 7 years ago

@Xarishark Version 2.1.0 adds support for a horizontal layout (a toggle can be found in the settings menu).