Code Monkey home page Code Monkey logo

Comments (7)

CensoredUsername avatar CensoredUsername commented on August 9, 2024 1

Updated licensing stuff on dev to make it clearer.

from unrpyc.

Lumpy-dev avatar Lumpy-dev commented on August 9, 2024

I found another piece of code having the same problem:

for entry in contents_grouped:
if entry[1].startswith("keywords"):
entry[2].append(("tag", keyword_tag))
break
# just force it in there. this might disturb linenumbers but it's
# really hard to know where inbetween children it'd be safe
# to put it in
else:
contents_grouped.insert(0, (block_lineno + 1, "keywords", [("tag", keyword_tag)]))

Also I found some REALLY bad code there, brackets are missing to create a tuple:

elif ty == "broken":
contents_grouped.append(current_keyword_line[0], "keywords_broken", current_keyword_line[2], content)
current_keyword_line = None
elif ty == "atl":
if current_keyword_line[0] == lineno:
contents_grouped.append(lineno, "keywords_atl", current_keyword_line[2], content)

This file should really be re-read, I am currently porting the file so that's what I am doing but I may have let some errors slip through.

from unrpyc.

CensoredUsername avatar CensoredUsername commented on August 9, 2024

but else statements are called only if the loop was ended in a break

I found another piece of code having the same problem:

That is incorrect. Per the python documentation:

In a for loop, the else clause is executed after the loop reaches its final iteration.
In while loop, it’s executed after the loop’s condition becomes false.
In either kind of loop, the else clause is not executed if the loop was terminated by a break.

Also I found some REALLY bad code there, brackets are missing to create a tuple:

Whoops, thanks for the note. Those codepaths aren't taken very often apparently, none of my tests caught it.

from unrpyc.

Lumpy-dev avatar Lumpy-dev commented on August 9, 2024

Sorry, I misread the code I saw to check the else statement behavior.

It's strange that the other code was kept, I get a really big warning when I saw the line. Should some kind of static analysis be put in place to avoid this kind of issue as testing those cases can be quite difficult? (i.e. in testing or Github Actions)

from unrpyc.

CensoredUsername avatar CensoredUsername commented on August 9, 2024

Should some kind of static analysis be put in place to avoid this kind of issue as testing those cases can be quite difficult?

If someone cares enough they could. Mind you, this isn't some extreme security code, it's a decompiler for visual novels that I maintain as a hobby. It passes the tests and if issues come up, people can report them. That said, if you know of a decent solution, f feel free to pull request ;)

I saw a post about the thing you're working on a bit earlier btw, fun project. Must've been quite the hassle to port all that

One minor nitpic that I have to make: when porting code between languages, your code still counts as a derivative work. Right now you're claiming copyright over the entire thing as yours and project contributors, while the copyright over ported unrpyc parts should still be from the original contributors. (it should be stated on the top of most of the relevant files, although I might have forgotten it recently).

from unrpyc.

Lumpy-dev avatar Lumpy-dev commented on August 9, 2024

After reading the whole code of unrpyc multiple times for my project I think I can do some contributions, when I'll have the time I'll do this (although Python is not the language I am best at).

For the nitpic I already included the license for unrpyc in my LICENSE files so that Flutter would directly pick them up and show them in the UI with the Renpy license too (I ported Renpy code for mapping stuff). I thought adding the copyright at the start of each file would be redundant as I ship my project as one piece but to be sure I'll had a header for the next release.

from unrpyc.

CensoredUsername avatar CensoredUsername commented on August 9, 2024

After reading the whole code of unrpyc multiple times for my project I think I can do some contributions, when I'll have the time I'll do this (although Python is not the language I am best at).

No worries, I'm happy to have more people looking over the code to begin with.

I already included the license for unrpyc in my LICENSE files

License and copyright attributions are two different things. Copyright information is for documenting who created something, and licenses are permissions granted by the copyright holder to other folks. You generally need the copyright notice to determine who the license derives from.

It's also just a bit of a credits thing ofc ;) people have spent a lot of time on this tool.

I also didn't find it at first because the main LICENSE file doesn't link to it afaik, but I did find it listed in the backend folder. That said, our license (MIT) does state that you are required to include the copyright notice, that is supposed to be above there but missing, with it.

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

I thought adding the copyright at the start of each file would be redundant

That one is also a bit on me because I seem to have neglected adding the additional significant authors to the main LICENSE file so it's easier to include all of them, I'll update that.

but to be sure I'll had a header for the next release.

Thanks!

from unrpyc.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.