[gem5-dev] Change in gem5/gem5[develop]: python: Improve the print statements in downloader.py

2021-10-15 Thread Bobby R. Bruce (Gerrit) via gem5-dev
Bobby R. Bruce has submitted this change. (  
https://gem5-review.googlesource.com/c/public/gem5/+/51370 )


Change subject: python: Improve the print statements in downloader.py
..

python: Improve the print statements in downloader.py

Most importantly, these print statements now make clear to the user
where the resources are being downloaded to.

Change-Id: Id2661d2567a7ea5ee3157142dc91e814e3e2edaf
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/51370
Reviewed-by: Bobby R. Bruce 
Maintainer: Bobby R. Bruce 
Tested-by: kokoro 
---
M src/python/gem5/resources/downloader.py
1 file changed, 31 insertions(+), 4 deletions(-)

Approvals:
  Bobby R. Bruce: Looks good to me, approved; Looks good to me, approved
  kokoro: Regressions pass




diff --git a/src/python/gem5/resources/downloader.py  
b/src/python/gem5/resources/downloader.py

index 28f813d..f05d9d0 100644
--- a/src/python/gem5/resources/downloader.py
+++ b/src/python/gem5/resources/downloader.py
@@ -274,19 +274,30 @@

 # TODO: Might be nice to have some kind of download status bar  
here.

 # TODO: There might be a case where this should be silenced.
-print("'{}' not found locally.  
Downloading...".format(resource_name))

+print(
+"Resource '{}' was not found locally. Downloading to '{}'..."
+.format(
+resource_name, download_dest
+)
+)

 # Get the URL. The URL may contain '{url_base}' which needs  
replaced

 # with the correct value.
 url = resource_json["url"].format(url_base=_get_url_base())

 _download(url=url, download_to=download_dest)
-print("Finished downloading '{}'.".format(resource_name))
+print("Finished downloading resource '{}'.".format(resource_name))

 if run_unzip:
-print("Decompressing '{}'...".format(resource_name))
+print(
+"Decompressing resource '{}' ('{}')...".format(
+resource_name, download_dest
+)
+)
 with gzip.open(download_dest, "rb") as f:
 with open(to_path, "wb") as o:
 shutil.copyfileobj(f, o)
 os.remove(download_dest)
-print("Finished decompressing '{}.".format(resource_name))
+print(
+"Finished decompressing  
resource '{}'.".format(resource_name)

+)

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/51370
To unsubscribe, or for help writing mail filters, visit  
https://gem5-review.googlesource.com/settings


Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: Id2661d2567a7ea5ee3157142dc91e814e3e2edaf
Gerrit-Change-Number: 51370
Gerrit-PatchSet: 5
Gerrit-Owner: Bobby R. Bruce 
Gerrit-Reviewer: Andreas Sandberg 
Gerrit-Reviewer: Bobby R. Bruce 
Gerrit-Reviewer: Jason Lowe-Power 
Gerrit-Reviewer: Jason Lowe-Power 
Gerrit-Reviewer: kokoro 
Gerrit-MessageType: merged
___
gem5-dev mailing list -- gem5-dev@gem5.org
To unsubscribe send an email to gem5-dev-le...@gem5.org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

[gem5-dev] Change in gem5/gem5[develop]: python: Improve the print statements in downloader.py

2021-10-07 Thread Bobby R. Bruce (Gerrit) via gem5-dev
Bobby R. Bruce has uploaded this change for review. (  
https://gem5-review.googlesource.com/c/public/gem5/+/51370 )



Change subject: python: Improve the print statements in downloader.py
..

python: Improve the print statements in downloader.py

Most importantly, these print statements now make clear to the user
where the resources are being downloaded to.

Change-Id: Id2661d2567a7ea5ee3157142dc91e814e3e2edaf
---
M src/python/gem5/resources/downloader.py
1 file changed, 19 insertions(+), 4 deletions(-)



diff --git a/src/python/gem5/resources/downloader.py  
b/src/python/gem5/resources/downloader.py

index 5163724..af1f47b 100644
--- a/src/python/gem5/resources/downloader.py
+++ b/src/python/gem5/resources/downloader.py
@@ -242,14 +242,17 @@

 # TODO: Might be nice to have some kind of download status bar  
here.

 # TODO: There might be a case where this should be silenced.
-print("'{}' not found locally.  
Downloading...".format(resource_name))

+print("Resource '{}' was not found locally. Downloading to '{}'..."
+  .format(resource_name, download_dest))
 _download(url=resource_json["url"], download_to=download_dest)
-print("Finished downloading '{}'.".format(resource_name))
+print("Finished downloading resource '{}'.".format(resource_name))

 if run_unzip:
-print("Decompressing '{}'...".format(resource_name))
+print("Decompressing resource '{}' ('{}')..."
+  .format(resource_name, download_dest))
 with gzip.open(download_dest, "rb") as f:
 with open(to_path, "wb") as o:
 shutil.copyfileobj(f, o)
 os.remove(download_dest)
-print("Finished decompressing '{}.".format(resource_name))
+print("Finished decompressing resource '{}'."
+  .format(resource_name))

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/51370
To unsubscribe, or for help writing mail filters, visit  
https://gem5-review.googlesource.com/settings


Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: Id2661d2567a7ea5ee3157142dc91e814e3e2edaf
Gerrit-Change-Number: 51370
Gerrit-PatchSet: 1
Gerrit-Owner: Bobby R. Bruce 
Gerrit-MessageType: newchange
___
gem5-dev mailing list -- gem5-dev@gem5.org
To unsubscribe send an email to gem5-dev-le...@gem5.org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s