Skip to content

Commit

Permalink
apply fragments to every script
Browse files Browse the repository at this point in the history
  • Loading branch information
the-infinity committed Feb 11, 2025
1 parent 3c40a17 commit e311fc3
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
1 change: 1 addition & 0 deletions scripts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ If you have requests, you can run the script with two arguments:
- the source uid which should be registered as user at `config.yaml` and should have a representation at ParkAPI-sources
- the path to the file to push

Afterward, the password will be asked in a secure way, then the upload progress begins.

### curl equivalent

Expand Down
7 changes: 7 additions & 0 deletions scripts/apply-duplicates.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
"""

import argparse
import re
import string
import sys
from getpass import getpass
from pathlib import Path
Expand Down Expand Up @@ -32,6 +34,11 @@ def main():

password = getpass(f'Password for {username}: ')

# Remove weird copy-paste fragments
password = ''.join([c for c in password if c in string.printable])
password = re.sub(r'^\x5b.{1,3}\x7e', '', password)
password = re.sub(r'\x5b.{1,3}\x7e$', '', password)

duplicates_file_path: Optional[Path] = None if args.duplicates_file is None else Path(args.duplicates_file)

# Check if duplicate file exists
Expand Down
7 changes: 7 additions & 0 deletions scripts/push-client.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
"""

import argparse
import re
import string
import sys
from getpass import getpass
from pathlib import Path
Expand All @@ -30,6 +32,11 @@ def main():

password = getpass(f'Password for source UID {source_uid}: ')

# Remove weird copy-paste fragments
password = ''.join([c for c in password if c in string.printable])
password = re.sub(r'^\x5b.{1,3}\x7e', '', password)
password = re.sub(r'\x5b.{1,3}\x7e$', '', password)

file_ending = None
for ending in DATA_TYPES:
if file_path.name.endswith(f'.{ending}'):
Expand Down

0 comments on commit e311fc3

Please sign in to comment.