Skip to content

Commit f30eaf1

Browse files
committed
cleanup readme, fix icons
1 parent 396c48d commit f30eaf1

3 files changed

Lines changed: 157 additions & 154 deletions

File tree

README.md

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@ sudo apt install python3-lxml
1616
pip install pykeepass
1717
```
1818

19-
Quickstart
20-
-------
19+
# Quickstart
2120

2221
General database manipulation
2322

@@ -198,19 +197,21 @@ OTP codes
198197
```
199198

200199

201-
Tests and Debugging
202-
-------------------
200+
# Tests and Debugging
203201

204202
Run tests with `python tests/tests.py` or `python tests/tests.py SomeSpecificTest`
205203

206204
Enable debugging when doing tests in console:
207205

208-
>>> from pykeepass.pykeepass import debug_setup
209-
>>> debug_setup()
210-
>>> kp.entries[0]
211-
DEBUG:pykeepass.pykeepass:xpath query: //Entry
212-
DEBUG:pykeepass.pykeepass:xpath query: (ancestor::Group)[last()]
213-
DEBUG:pykeepass.pykeepass:xpath query: (ancestor::Group)[last()]
214-
DEBUG:pykeepass.pykeepass:xpath query: String/Key[text()="Title"]/../Value
215-
DEBUG:pykeepass.pykeepass:xpath query: String/Key[text()="UserName"]/../Value
216-
Entry: "root_entry (foobar_user)"
206+
``` python
207+
>>> from pykeepass.pykeepass import debug_setup
208+
>>> debug_setup()
209+
>>> kp.entries[0]
210+
DEBUG:pykeepass.pykeepass:xpath query: //Entry
211+
DEBUG:pykeepass.pykeepass:xpath query: (ancestor::Group)[last()]
212+
DEBUG:pykeepass.pykeepass:xpath query: (ancestor::Group)[last()]
213+
DEBUG:pykeepass.pykeepass:xpath query: String/Key[text()="Title"]/../Value
214+
DEBUG:pykeepass.pykeepass:xpath query: String/Key[text()="UserName"]/../Value
215+
Entry: "root_entry (foobar_user)"
216+
```
217+

pykeepass/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from .entry import Entry
77
from .group import Group
88
from .attachment import Attachment
9-
from .icons import icons as icons
9+
from .icons import icons
1010
from .version import __version__
1111

1212
__all__ = ["PyKeePass", "Entry", "Group", "Attachment", "icons", "create_database", "__version__"]

pykeepass/icons.py

Lines changed: 142 additions & 140 deletions
Original file line numberDiff line numberDiff line change
@@ -145,146 +145,148 @@
145145
CERTIFICATE = '67'
146146
SMARTPHONE = '68'
147147

148-
icons = {
149-
"Key": "0",
150-
"World": "1",
151-
"Warning": "2",
152-
"NetworkServer": "3",
153-
"MarkedDirectory": "4",
154-
"UserCommunication": "5",
155-
"Parts": "6",
156-
"Notepad": "7",
157-
"WorldSocket": "8",
158-
"Identity": "9",
159-
"PaperReady": "10",
160-
"Digicam": "11",
161-
"IRCommunication": "12",
162-
"MultiKeys": "13",
163-
"Energy": "14",
164-
"Scanner": "15",
165-
"WorldStar": "16",
166-
"CDRom": "17",
167-
"Monitor": "18",
168-
"EMail": "19",
169-
"Configuration": "20",
170-
"ClipboardReady": "21",
171-
"PaperNew": "22",
172-
"Screen": "23",
173-
"EnergyCareful": "24",
174-
"EMailBox": "25",
175-
"Disk": "26",
176-
"Drive": "27",
177-
"PaperQ": "28",
178-
"TerminalEncrypted": "29",
179-
"Console": "30",
180-
"Printer": "31",
181-
"ProgramIcons": "32",
182-
"Run": "33",
183-
"Settings": "34",
184-
"WorldComputer": "35",
185-
"Archive": "36",
186-
"Homebanking": "37",
187-
"DriveWindows": "38",
188-
"Clock": "39",
189-
"EMailSearch": "40",
190-
"PaperFlag": "41",
191-
"Memory": "42",
192-
"TrashBin": "43",
193-
"Note": "44",
194-
"Expired": "45",
195-
"Info": "46",
196-
"Package": "47",
197-
"Folder": "48",
198-
"FolderOpen": "49",
199-
"FolderPackage": "50",
200-
"LockOpen": "51",
201-
"PaperLocked": "52",
202-
"Checked": "53",
203-
"Pen": "54",
204-
"Thumbnail": "55",
205-
"Book": "56",
206-
"List": "57",
207-
"UserKey": "58",
208-
"Tool": "59",
209-
"Home": "60",
210-
"Star": "61",
211-
"Tux": "62",
212-
"Feather": "63",
213-
"Apple": "64",
214-
"Wiki": "65",
215-
"Money": "66",
216-
"Certificate": "67",
217-
"BlackBerry": "68",
148+
from types import SimpleNamespace
149+
150+
icons = SimpleNamespace(
151+
Key = '0',
152+
World = '1',
153+
Warning = '2',
154+
NetworkServer = '3',
155+
MarkedDirectory = '4',
156+
UserCommunication = '5',
157+
Parts = '6',
158+
Notepad = '7',
159+
WorldSocket = '8',
160+
Identity = '9',
161+
PaperReady = '10',
162+
Digicam = '11',
163+
IRCommunication = '12',
164+
MultiKeys = '13',
165+
Energy = '14',
166+
Scanner = '15',
167+
WorldStar = '16',
168+
CDRom = '17',
169+
Monitor = '18',
170+
EMail = '19',
171+
Configuration = '20',
172+
ClipboardReady = '21',
173+
PaperNew = '22',
174+
Screen = '23',
175+
EnergyCareful = '24',
176+
EMailBox = '25',
177+
Disk = '26',
178+
Drive = '27',
179+
PaperQ = '28',
180+
TerminalEncrypted = '29',
181+
Console = '30',
182+
Printer = '31',
183+
ProgramIcons = '32',
184+
Run = '33',
185+
Settings = '34',
186+
WorldComputer = '35',
187+
Archive = '36',
188+
Homebanking = '37',
189+
DriveWindows = '38',
190+
Clock = '39',
191+
EMailSearch = '40',
192+
PaperFlag = '41',
193+
Memory = '42',
194+
TrashBin = '43',
195+
Note = '44',
196+
Expired = '45',
197+
Info = '46',
198+
Package = '47',
199+
Folder = '48',
200+
FolderOpen = '49',
201+
FolderPackage = '50',
202+
LockOpen = '51',
203+
PaperLocked = '52',
204+
Checked = '53',
205+
Pen = '54',
206+
Thumbnail = '55',
207+
Book = '56',
208+
List = '57',
209+
UserKey = '58',
210+
Tool = '59',
211+
Home = '60',
212+
Star = '61',
213+
Tux = '62',
214+
Feather = '63',
215+
Apple = '64',
216+
Wiki = '65',
217+
Money = '66',
218+
Certificate = '67',
219+
BlackBerry = '68',
218220

219221
# deprecated icons
220222

221-
"KEY": "0",
222-
"GLOBE": "1",
223-
"WARNING_SIGN": "2",
224-
"SERVER": "3",
225-
"PINNED_NOTE": "4",
226-
"SPEECH_BUBBLE": "5",
227-
"SQUARES": "6",
228-
"HANDWRITTEN_NOTE": "7",
229-
"GLOBE_PLUG": "8",
230-
"BUSINESS_CARD": "9",
231-
"GREEN_AND_WHITE_THINGY": "10",
232-
"CAMERA": "11",
233-
"INFRARED": "12",
234-
"KEYS": "13",
235-
"POWER_PLUG": "14",
236-
"FLATBED_SCANNER": "15",
237-
"GLOBE_STAR": "16",
238-
"CD_ROM": "17",
239-
"MONITOR": "18",
240-
"ENVELOPE": "19",
241-
"GEAR": "20",
242-
"CHECKLIST": "21",
243-
"NOTEPAD": "22",
244-
"DESKTOP": "23",
245-
"POWER_FLASH": "24",
246-
"FOLDER_ENVELOPE": "25",
247-
"FLOPPY_DISK": "26",
248-
"SERVER_2": "27",
249-
"GREEN_DOT": "28",
250-
"MONITOR_KEY": "29",
251-
"SHELL": "30",
252-
"PRINTER": "31",
253-
"DASHBOARD": "32",
254-
"CROATIA": "33",
255-
"WRENCH": "34",
256-
"PC_INTERNET": "35",
257-
"ZIP_FILE": "36",
258-
"PERCENT_SIGN": "37",
259-
"SAMBA_SHARE": "38",
260-
"CLOCK": "39",
261-
"SEARCH": "40",
262-
"USED_TAMPON": "41",
263-
"MEMORY_STICK": "42",
264-
"RECYCLE_BIN": "43",
265-
"POST_IT": "44",
266-
"RED_CROSS": "45",
267-
"INFO_SIGN": "46",
268-
"CARDBOARD": "47",
269-
"FOLDER": "48",
270-
"FOLDER_OPEN": "49",
271-
"FOLDER_CUBE": "50",
272-
"LOCK_OPEN": "51",
273-
"LOCK_CLOSED": "52",
274-
"GREEN_CHECKMARK": "53",
275-
"FEATHER_PEN": "54",
276-
"POLAROID_PICTURE": "55",
277-
"BOOK_OPENED": "56",
278-
"UI": "57",
279-
"MANAGER": "58",
280-
"HAMMER": "59",
281-
"HOUSE": "60",
282-
"STAR": "61",
283-
"PENGUIN": "62",
284-
"FEATHER": "63",
285-
"APPLE": "64",
286-
"WIKIPEDIA": "65",
287-
"DOLLAR_SIGN": "66",
288-
"CERTIFICATE": "67",
289-
"SMARTPHONE": "68",
290-
}
223+
KEY = '0',
224+
GLOBE = '1',
225+
WARNING_SIGN = '2',
226+
SERVER = '3',
227+
PINNED_NOTE = '4',
228+
SPEECH_BUBBLE = '5',
229+
SQUARES = '6',
230+
HANDWRITTEN_NOTE = '7',
231+
GLOBE_PLUG = '8',
232+
BUSINESS_CARD = '9',
233+
GREEN_AND_WHITE_THINGY = '10',
234+
CAMERA = '11',
235+
INFRARED = '12',
236+
KEYS = '13',
237+
POWER_PLUG = '14',
238+
FLATBED_SCANNER = '15',
239+
GLOBE_STAR = '16',
240+
CD_ROM = '17',
241+
MONITOR = '18',
242+
ENVELOPE = '19',
243+
GEAR = '20',
244+
CHECKLIST = '21',
245+
NOTEPAD = '22',
246+
DESKTOP = '23',
247+
POWER_FLASH = '24',
248+
FOLDER_ENVELOPE = '25',
249+
FLOPPY_DISK = '26',
250+
SERVER_2 = '27',
251+
GREEN_DOT = '28',
252+
MONITOR_KEY = '29',
253+
SHELL = '30',
254+
PRINTER = '31',
255+
DASHBOARD = '32',
256+
CROATIA = '33',
257+
WRENCH = '34',
258+
PC_INTERNET = '35',
259+
ZIP_FILE = '36',
260+
PERCENT_SIGN = '37',
261+
SAMBA_SHARE = '38',
262+
CLOCK = '39',
263+
SEARCH = '40',
264+
USED_TAMPON = '41',
265+
MEMORY_STICK = '42',
266+
RECYCLE_BIN = '43',
267+
POST_IT = '44',
268+
RED_CROSS = '45',
269+
INFO_SIGN = '46',
270+
CARDBOARD = '47',
271+
FOLDER = '48',
272+
FOLDER_OPEN = '49',
273+
FOLDER_CUBE = '50',
274+
LOCK_OPEN = '51',
275+
LOCK_CLOSED = '52',
276+
GREEN_CHECKMARK = '53',
277+
FEATHER_PEN = '54',
278+
POLAROID_PICTURE = '55',
279+
BOOK_OPENED = '56',
280+
UI = '57',
281+
MANAGER = '58',
282+
HAMMER = '59',
283+
HOUSE = '60',
284+
STAR = '61',
285+
PENGUIN = '62',
286+
FEATHER = '63',
287+
APPLE = '64',
288+
WIKIPEDIA = '65',
289+
DOLLAR_SIGN = '66',
290+
CERTIFICATE = '67',
291+
SMARTPHONE = '68',
292+
)

0 commit comments

Comments
 (0)