26 lines
522 B
Plaintext
26 lines
522 B
Plaintext
#!/bin/kuroko
|
|
|
|
import fileio
|
|
|
|
let lines
|
|
let cpus = {0: {}}
|
|
let current = 0
|
|
|
|
with fileio.open('/proc/cpuinfo','r') as f:
|
|
lines = f.readlines()
|
|
|
|
for line in lines:
|
|
if line == '\n':
|
|
current++
|
|
cpus[current] = {}
|
|
continue
|
|
line = line.strip()
|
|
if ': ' in line:
|
|
let key, value = line.split(': ')
|
|
cpus[current][key] = value
|
|
|
|
if cpus and 'Model name' in cpus[0]:
|
|
print(cpus[0]['Model name'])
|
|
else if cpus and 'PartNum' in cpus[0]:
|
|
print('(ARM64)', cpus[0]['PartNum'])
|