mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-23 02:05:57 +01:00
shell_helpers: wget for release-download-latest
This commit is contained in:
@@ -10,6 +10,7 @@ import stat
|
||||
import subprocess
|
||||
import sys
|
||||
import threading
|
||||
import urllib.request
|
||||
|
||||
class LF:
|
||||
'''
|
||||
@@ -269,6 +270,20 @@ class ShellHelpers:
|
||||
else:
|
||||
os.unlink(path)
|
||||
|
||||
def wget(self, url, download_path):
|
||||
'''
|
||||
Append extra KEY=val configs into the given config file.
|
||||
|
||||
I wissh we could have a progress indicator, but impossible:
|
||||
https://stackoverflow.com/questions/51212/how-to-write-a-download-progress-indicator-in-python
|
||||
'''
|
||||
self.print_cmd([
|
||||
'wget', LF,
|
||||
'-O', download_path, LF,
|
||||
url, LF,
|
||||
])
|
||||
urllib.request.urlretrieve(url, download_path)
|
||||
|
||||
def write_configs(self, config_path, configs, config_fragments=None, mode='a'):
|
||||
'''
|
||||
Append extra KEY=val configs into the given config file.
|
||||
|
||||
Reference in New Issue
Block a user