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.
39 lines
1.2 KiB
39 lines
1.2 KiB
#-*- codding: UTF-8 -*-
|
|
#!/usr/bin/env python
|
|
import os, sys
|
|
|
|
def get_global_USE():
|
|
ListUSE={}
|
|
with open("/usr/portage/profiles/use.desc") as uses:
|
|
line = uses.read().split("\n")
|
|
print(line)
|
|
for l in line:
|
|
if l.startswith('#') or l =='':
|
|
pass
|
|
else:
|
|
try:
|
|
#result[cat].append(search(r))
|
|
ListUSE[str(l.split('-'[0]))] =str(l.split('-')[1:]).replace('[', "") and str(l.split('-')[1:]).replace(']', "")
|
|
print(ListUSE[str(l.split('-'[0]))])
|
|
except Exception (e):
|
|
print(e)
|
|
return ListUSE
|
|
|
|
|
|
def get_local_USE():
|
|
ListUSE={}
|
|
with open("/usr/portage/profiles/use.desc") as uses:
|
|
line = uses.read().split("\n")
|
|
print(line)
|
|
for l in line:
|
|
if l.startswith('#') or l =='':
|
|
pass
|
|
else:
|
|
try:
|
|
#result[cat].append(search(r))
|
|
ListUSE[str(l.split('-')[0])] = str(l.split('-')[1:])
|
|
print(ListUSE[str(l.split('-')[0])])
|
|
except Exception (e):
|
|
print(e)
|
|
return ListUSE
|