-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathbleachbit.py
38 lines (32 loc) · 1.34 KB
/
bleachbit.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# (C) 2016 Adam Ziaja <[email protected]> http://adamziaja.com
# http://docs.bleachbit.org/doc/cleanerml.html
# https://github.com/az0/cleanerml/
# https://github.com/az0/bleachbit/blob/master/doc/cleaner_markup_language.xsd
# https://github.com/az0/bleachbit/tree/master/cleaners
# https://github.com/az0/bleachbit/blob/master/bleachbit/Cleaner.py
import os
from lxml import etree # http://lxml.de/xpathxslt.html#the-xpath-method
import xml.etree.ElementTree
for file in os.listdir('.'): # https://github.com/az0/bleachbit/tree/master/cleaners
if file.endswith('.xml'):
e = xml.etree.ElementTree.parse(file).getroot()
#print e.attrib['id']
print e.find('label').text + ' -',
try:
print e.find('description').text
except:
pass
for option in e.findall('option'):
print option.find('description').text
for action in option.iter('action'):
print action.attrib
#if 'path' in action.attrib:
# print action.attrib['path']
#else:
# for action in option.iter('action'):
# print action.attrib
print
# https://gist.github.com/adamziaja/317def09ab62f85367c4
# https://gist.github.com/adamziaja/34e6dea311c166bcd506