artifactory-scripts icon indicating copy to clipboard operation
artifactory-scripts copied to clipboard

Fixed: DownloadUsage.py invalid syntax, requirements.txt issues

Open james-flynn-ie opened this issue 3 years ago • 3 comments

Adding fixes for the DownloadUsage.py script, as it failed to execute due to requirements.txt and invalid syntax errors:

  • Fixed print statement declarations
  File ".\DownloadUsage.py", line 23
    print "Parsing Access Log..."
          ^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print("Parsing Access Log...")?

  File ".\DownloadUsage.py", line 39
    print Fore.RED + "Could not find",(notfound),"artifacts(most likely deleted)"
          ^
SyntaxError: invalid syntax
  • Removed duplicate import statement (colorama)
  • Replaced 'ur' string type with the synonym 'r' (which is compatible with both Py2 and Py3).
  File ".\DownloadUsage.py", line 26
    p = re.compile(ur'(\d*)-(\d*-\d*\d*......)(........)(.*])(.*)(:)(.*)(for)(.)(.*)(\/)(.*)(\.)')
                     ^
SyntaxError: invalid syntax
  • Removed dependencies from requirements.txt which are installed as part of Python and not found on Pip:
   ERROR: Could not find a version that satisfies the requirement sys
   ERROR: No matching distribution found for sys
   ERROR: Could not find a version that satisfies the requirement re
   ERROR: No matching distribution found for re
   ERROR: Could not find a version that satisfies the requirement json
   ERROR: No matching distribution found for json

Changes verified on Python 3.8.2.

james-flynn-ie avatar Dec 17 '21 16:12 james-flynn-ie

CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅

github-actions[bot] avatar Dec 17 '21 16:12 github-actions[bot]

I have read the CLA Document and I hereby sign the CLA

james-flynn-ie avatar Dec 17 '21 17:12 james-flynn-ie

recheck

james-flynn-ie avatar Dec 17 '21 17:12 james-flynn-ie