shizmob / renpy2linux

Convert a Windows Ren'Py-based game into a Linux-compatible one.
27 stars 9 forks source link

A way to automate finding the Ren'Py version. #2

Open Uradamus opened 6 years ago

Uradamus commented 6 years ago

Looking around a bit, I found that you can get the version number from the ./renpy/__init__.py file in the game's directory. It's declared as a tuple along the lines of:

version_tuple = (6, 99, 11, vc_version)

Only the first 3 parts are relevant and they could be grabbed with a code snippet like this:

RENPYVER=grep "^version_tuple =" renpy/__init__.py | awk '{for(i=1;i<NF;i++){match($i,/[0-9]+/);if(RLENGTH!=-1){if(length(r)>0){r=r "."};r=r substr($i,RSTART,RLENGTH)}};print r}'

Uradamus commented 6 years ago

looks like the issue tracker decided to interpret the double underscores before and after init to mean I wanted bold text... Ok, found out how to do unformatted text, everything looks proper now.