Skip to content

Commit

Permalink
add dependencies in pyproject.toml
Browse files Browse the repository at this point in the history
  • Loading branch information
cnfatal committed Jan 11, 2024
1 parent 3e21f8a commit f939973
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 11 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
*.pyo
*.rpy
*.rpyc
*.txt
__pycache__
/build
/dist
Expand Down
6 changes: 3 additions & 3 deletions Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 19 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,14 @@

A tools for decompiling and translating Ren'py compiled script files (.rpyc and .rpymc).

## Features
## How it works

- Decompile for Ren'py compiled script files .rpyc to .rpy files.
- Automatic scan translations in scripts and translate to target language (default using Google Translate).
All rpyc files are compiled from rpy files, renpy SDK read every file and parse it to AST object(renpy), and then use pickle to serialize the AST to rpyc file. So we use pickle to deserialize the rpyc file to AST, and then restore the rpy file from AST.

We created a fake "renpy" package(unlikely unrpyc) and it's ast objects to make the pickle can be deserialized correctly.
Another reason to create a fake "renpy" package is that we can separate code generate logic (the `get_code(...)` function) to each AST object, it will be easier to future maintain and for multi-version renpy support.

The most difficult part is generating the rpy file from AST. Different renpy version has different AST structure also different grammar.

## Usage

Expand Down Expand Up @@ -43,6 +47,18 @@ Use pipenv to manage dependencies:
pipenv install --dev
```

## Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

## FAQ

- **Q: It always raise pickle `import ** \nModuleNotFoundError: No module named '***'` error.**

A: It's because the our fake packages("renpy","store") is not contains the object you want to decompile. Please open an issue and tell us the renpy version and the rpyc file you want to decompile. Join our telegram group to get help also be better.

## Community

Welcome to join our community to discuss and get help.

- [Telegram Group](https://t.me/rpycdec)
11 changes: 7 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
[build-system]
requires = ["hatchling","hatch-vcs"]
requires = ["hatchling", "hatch-vcs"]
build-backend = "hatchling.build"

[project]
name = "rpycdec"
authors = [{ name = "cnfatl", email = "[email protected]" }]
authors = [{ name = "cnfatal", email = "[email protected]" }]
description = "A tool to decrypt .rpyc files"
readme = "README.md"
requires-python = ">=3.7"
Expand All @@ -15,7 +15,10 @@ classifiers = [
"Operating System :: OS Independent",
]
dynamic = ["version"]

dependencies = [
"requests",
"ratelimit",
]
[project.urls]
"Homepage" = "https://github.com/cnfatal/rpycdec"
"Bug Tracker" = "https://github.com/cnfatal/rpycdec/issues"
Expand All @@ -27,7 +30,7 @@ rpycdec = "rpycdec:main"
exclude = ["/.github", "/docs"]

[tool.hatch.build.targets.wheel]
packages = ["renpy", "."]
packages = ["renpy", "store", "rpycdec.py"]

[tool.hatch.version]
source = "vcs"

0 comments on commit f939973

Please sign in to comment.