-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Python 3 Port[In progress] #7
Conversation
The activity hasn't been ported to Gtk3, you should do that first. The error you got is as a result of that. |
@Saumya-Mishra9129, next time please copy and paste errors into GItHub markdown text blocks, using ``` to delimit. Images are expensive, and can't be searched. |
Great, we'll wait for it. |
I think |
@srevinsaju I looked at Terminal activity which also contains Vte. You have worked there , Can you have a look at this activity? |
@Saumya-Mishra9129 i will check |
@Saumya-Mishra9129, the Vte library was changed a few times, may I suggest;
|
configparser accepts <class 'str'> as *args. Boolean and integer args had to be converted to str
Fixes TypeError: Expected a Vte.CursorBlinkMode, but got str
@Saumya-Mishra9129 Please review Saumya-Mishra9129#1 Currently the To include |
@srevinsaju I just looked at VTE documentation and found that spawn_sync is deprecated since version 0.48. For your reference -https://lazka.github.io/pgi-docs/Vte-2.91/classes/Terminal.html#Vte.Terminal.spawn_sync |
@Saumya-Mishra9129 Although deprecated; its still usable; Anyways, I have used |
Reviewed f38db26. An issue wasn't opened for frotz binaries in this activity but I think you should remove the binaries, the binaries exists for users who would run the activity on an XO laptop; porting to python3 removes the need for that.
|
Agreed. This should also result in a fix for #2. Reminder of standing advice for future use: make sure the activity works properly before porting, close any solved issues, merge any pull requests or branches and release the last Python 2 version. |
Re: d57cfd5, my preference is to use Or, you can use |
Thanks , I tested spawn_async is not working with Ubuntu 18.04.
Yeah It can be best. |
Reapply the license to the program, see "How to Apply These Terms to Your New Programs" in COPYING.
db2c1c5
to
799d8f2
Compare
799d8f2
to
52f914c
Compare
Only this needs a fix. |
a164e54 It does not work this error in log:
|
I suggest using launch_bundle as used by sugarterm.py in Terminal activity. |
a164e54
to
538c28d
Compare
538c28d
to
ca59b68
Compare
frotz.py
Outdated
cmd = '/usr/games/frotz' | ||
else: | ||
cmd = '/usr/bin/frotz' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This still may not work. If I build frotz manually, it always installs to /usr/local/bin
or /usr/local/games
(on apt
based distros). A suggested fix is to do this, as @quozl suggested is to:
def get_executable_path(executable, raise_error=True):
"""
Returns the absolute path of the executable
if it is found on the PATH,
if it is not found raises a FileNotFoundError
:param executable:
:return:
"""
for i in PATH:
if os.path.exists(os.path.join(i, executable)):
return os.path.join(i, executable)
if raise_error:
raise FileNotFoundError(
"Could not find {p} on PATH. "
"Make sure {p} is added to path and try again".format(
p=executable))
else:
return False
Link to original source provided above the code snippet.
You can do a try...catch
on FileNotFoundError
or pass raise_error=False
and check if the returned value is false to check if Frotz exists on path.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks , Tried it in 65c66e6. Tested on debian and Ubuntu works fine. 😃
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perfect! 🎉
7e7adb2
to
65c66e6
Compare
Python source was searched for references to the PATH environment variable. Of those available, the simplest API is shutil.which.
An alternative would be to convert README.md to HTML and point the browser to file:///$SOURCE_PATH/README.md.html
- no need for another function, - no need for "w+", - change journal object description.
Thanks Reviewed till 3a9baf7. Please merge these changes. |
Trying to port from python 2 to 3 , as Sugar-toolkit is also ported , I am getting this error, get stuck at this.Kindly look at error.
and do review also.Thanks