Skip to content

New plugin: abort_exists#1899

Merged
liiight merged 7 commits intodevelopfrom
abort_exists
Jul 24, 2017
Merged

New plugin: abort_exists#1899
liiight merged 7 commits intodevelopfrom
abort_exists

Conversation

@cvium
Copy link
Copy Markdown
Contributor

@cvium cvium commented Jul 24, 2017

Motivation for changes:

I wants it. When using LFTP or another program to download from a remote location, it can ruin a lot if FlexGet moves files before the transfer is completed. A lot of it can be handled by using "incomplete" filenames in LFTP, but there are situations where I want the transfer to be fully completed before moving.

Detailed changes:

  • Added new plugin

for entry in task.all_entries:
# if pattern matches any entry
if field not in entry:
log.debug('Field %s not found. Skipping.', field)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Continue?

if field not in entry:
log.debug('Field %s not found. Skipping.', field)
if abort_re.search(entry[field]):
task.abort('An entry contained %s in field %s. Abort!' % (config['regexp'], field))
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can silently abort, bit sure if it fits here though

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dunno. I kind of want logging but I also don't want to add a separate log entry.

@liiight liiight merged commit 734b81c into develop Jul 24, 2017
@cvium cvium deleted the abort_exists branch July 24, 2017 12:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants