Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skippatches #60

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions gogrepo.py
Original file line number Diff line number Diff line change
Expand Up @@ -465,6 +465,7 @@ def process_argv(argv):
g1.add_argument('-dryrun', action='store_true', help='display, but skip downloading of any files')
g1.add_argument('-skipextras', action='store_true', help='skip downloading of any GOG extra files')
g1.add_argument('-skipgames', action='store_true', help='skip downloading of any GOG game files')
g1.add_argument('-skippatches', action='store_true', help='skip downloading of any game patches')
g1.add_argument('-id', action='store', help='id of the game in the manifest to download')
g1.add_argument('-wait', action='store', type=float,
help='wait this long in hours before starting', default=0.0) # sleep in hr
Expand Down Expand Up @@ -771,7 +772,7 @@ def cmd_import(src_dir, dest_dir):
shutil.copy(f, dest_file)


def cmd_download(savedir, skipextras, skipgames, skipids, dryrun, id):
def cmd_download(savedir, skipextras, skipgames, skippatches, skipids, dryrun, id):
sizes, rates, errors = {}, {}, {}
work = Queue() # build a list of work items

Expand Down Expand Up @@ -816,6 +817,9 @@ def gigs(b):
if skipgames:
item.downloads = []

if skippatches:
item.downloads = [d for d in item.downloads if not d["name"].startswith("patch_")]

# Generate and save a game info text file
if not dryrun:
with ConditionalWriter(os.path.join(item_homedir, INFO_FILENAME)) as fd_info:
Expand Down Expand Up @@ -1147,7 +1151,7 @@ def main(args):
if args.wait > 0.0:
info('sleeping for %.2fhr...' % args.wait)
time.sleep(args.wait * 60 * 60)
cmd_download(args.savedir, args.skipextras, args.skipgames, args.skipids, args.dryrun, args.id)
cmd_download(args.savedir, args.skipextras, args.skipgames, args.skippatches, args.skipids, args.dryrun, args.id)
elif args.cmd == 'import':
cmd_import(args.src_dir, args.dest_dir)
elif args.cmd == 'verify':
Expand Down