mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-23 02:05:57 +01:00
userland: allow selecting targets, including directories
This commit is contained in:
@@ -310,6 +310,19 @@ class ShellHelpers:
|
||||
else:
|
||||
os.unlink(path)
|
||||
|
||||
def walk(self, root):
|
||||
'''
|
||||
Extended walk that can take files or directories.
|
||||
'''
|
||||
if not os.path.exists(root):
|
||||
raise Exception('Path does not exist: ' + root)
|
||||
if os.path.isfile(root):
|
||||
dirname, basename = os.path.split(root)
|
||||
yield dirname, [], [basename]
|
||||
else:
|
||||
for path, dirnames, filenames in os.walk(root):
|
||||
yield path, dirnames, filenames
|
||||
|
||||
def wget(self, url, download_path):
|
||||
'''
|
||||
Append extra KEY=val configs into the given config file.
|
||||
|
||||
Reference in New Issue
Block a user