Skip to content

Commit

Permalink
Support the renaming of the picklemagic submodule to corrupy, and min…
Browse files Browse the repository at this point in the history
…imize was moved into that module.
  • Loading branch information
CensoredUsername committed Mar 31, 2024
1 parent b06e092 commit 69717b4
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 606 deletions.
6 changes: 3 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[submodule "un.rpyc/picklemagic"]
path = un.rpyc/picklemagic
url = https://github.com/CensoredUsername/picklemagic
[submodule "un.rpyc/corrupy"]
path = un.rpyc/corrupy
url = https://github.com/CensoredUsername/corrupy
branch = master
12 changes: 2 additions & 10 deletions un.rpyc/compile.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,15 @@
import zlib
import argparse
import os, sys
import minimize
import base64
from os import path

from corrupy import pickleast as p, minimize

parser = argparse.ArgumentParser(description="Pack unpryc into un.rpyc which can be ran from inside renpy")

parser.add_argument("-d", "--debug", dest="debug", action="store_true", help="Create debug files")

parser.add_argument("-m", "--magic-path", dest="magic", action="store", default="picklemagic",
help="In case picklemagic isn't in the python search path you can specify its folder here")

parser.add_argument("-p", "--protocol", dest="protocol", action="store", default="1",
help="The pickle protocol used for packing the pickles. default is 1, options are 0, 1 and 2")

Expand All @@ -45,14 +43,8 @@

args = parser.parse_args()

sys.path.append(path.abspath(args.magic))
protocol = int(args.protocol)

try:
import pickleast as p
except ImportError:
exit("Could not import pickleast. Are you sure it's in pythons module search path?")

def Module(name, filename, munge_globals=True, retval=False, package=None):
with open(filename, "rb" if p.PY2 else "r") as f:
code = f.read()
Expand Down
1 change: 1 addition & 0 deletions un.rpyc/corrupy
Submodule corrupy added at 82ecac
4 changes: 2 additions & 2 deletions un.rpyc/makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
PYTHON = ?py -2
PYTHON = py -2

all:
$(PYTHON) compile.py -p 1 -m picklemagic -d
$(PYTHON) compile.py -p 1 -d
Loading

0 comments on commit 69717b4

Please sign in to comment.