Skip to content

Commit

Permalink
Merge branch 'dhkatz:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
VensGTH authored Sep 26, 2024
2 parents 7ceebf4 + 4bcf695 commit cd4706a
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 18 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
548.2
548.8
9 changes: 8 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,16 @@
with open(os.path.join(HERE, 'README.md')) as f:
README = f.read()

execfile('t5de/version.py')

# noinspection PyUnresolvedReferences
version = __version__

print('Running T5DE patcher setup v%s' % version)

setup(
name='T5DE',
version=os.getenv('T5DE_VERSION', '1.0.0'),
version=version,
description='A modified IMVU client that unlocks useful features.',
long_description=README,
long_description_content_type='text/markdown',
Expand Down
1 change: 1 addition & 0 deletions t5de/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
from .version import __version__
from Client import Client
from Context import Context
35 changes: 19 additions & 16 deletions t5de/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,13 @@
import dotenv
import argparse

from .version import __version__
from .patchers import InterfacePatcher, PythonPatcher, ChecksumPatcher
from .diff import InterfaceDiff, PythonDiff
from . import Client


def main():
imvu_version = os.getenv('IMVU_VERSION')
t5de_version = os.getenv('T5DE_VERSION')

if not imvu_version:
print('IMVU_VERSION environment variable not set')
return 1

if not t5de_version:
print('T5DE_VERSION environment variable not set')
return 1

print('Running T5DE patcher v%s for IMVU v%s' % (t5de_version, imvu_version))

parser = argparse.ArgumentParser(prog='t5de', description='The T5DE patcher for IMVU')
parser.add_argument('--dry-run', action='store_true', help='Perform a dry run')
parser.add_argument('--diff', help='Generate a diff between two IMVU versions', const='latest', nargs='?', type=str)
Expand All @@ -32,17 +20,32 @@ def main():

args = parser.parse_args()

imvu_version = args.version or os.getenv('IMVU_VERSION')
t5de_version = os.getenv('T5DE_VERSION') or __version__

if not t5de_version:
print('T5DE_VERSION environment variable not set')
return 1

print('Running T5DE patcher v%s' % t5de_version)

if args.diff:
if not imvu_version:
print('IMVU_VERSION environment variable not set')
return 1
version = None if args.diff == 'latest' else args.diff
with Client(args.version or imvu_version) as client:
with Client(imvu_version) as client:
client.diff(generators=[InterfaceDiff, PythonDiff], version=version)

if args.patch:
with Client(args.version or imvu_version) as patcher:
if not imvu_version:
print('IMVU_VERSION environment variable not set')
return 1
with Client(imvu_version) as patcher:
patcher.download()
patcher.install()
patcher.copy()
patcher.patch(patchers=[InterfacePatcher, PythonPatcher, ChecksumPatcher], dry_run=False)
patcher.patch(patchers=[InterfacePatcher, PythonPatcher, ChecksumPatcher], dry_run=args.dry_run)

return 0

Expand Down
1 change: 1 addition & 0 deletions t5de/version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__version__ = '1.2.5'

0 comments on commit cd4706a

Please sign in to comment.