An operating system for CircuitPython devices
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
import os
|
|
|
|
|
|
|
|
def get_app_class(template):
|
|
|
|
class App(template):
|
|
|
|
def F_main(self):
|
|
|
|
if len(self.argv) == 1:
|
|
|
|
path = "."
|
|
|
|
else:
|
|
|
|
path = self.argv[1]
|
|
|
|
|
|
|
|
try:
|
|
|
|
for file in os.listdir(path):
|
|
|
|
print(file)
|
|
|
|
except OSError as e:
|
|
|
|
try:
|
|
|
|
os.stat(path)
|
|
|
|
print(path)
|
|
|
|
except OSError:
|
|
|
|
print(f"ls: cannot access '{path}': No such file or directory")
|
|
|
|
|
|
|
|
self.exit()
|
|
|
|
|
|
|
|
return App
|