icon_naming_spec.py - Viewer of Icon Naming Specificication


SUBMITTED BY: Guest

DATE: Feb. 23, 2014, 10:22 a.m.

FORMAT: Python

SIZE: 35.3 kB

HITS: 1226

  1. #!/usr/bin/env python3
  2. # -*- coding: utf-8 -*-
  3. # icon_naming_spec.py
  4. # Viewer of the Icon Naming Specification, version 1.0
  5. # See screenshot at http://bitimg.com/dH1azu
  6. # Icon Naming Specification document
  7. # Author: Rodney Dawes <dobey.pwns@gmail.com>
  8. # Copy & paste from http://standards.freedesktop.org/icon-naming-spec/icon-naming-spec-latest.html
  9. SPEC_DATA = """
  10. Table 2. Standard Action Icons
  11. Name Description
  12. address-book-new The icon used for the action to create a new address book.
  13. application-exit The icon used for exiting an application. Typically this is seen in the application's menus as File->Quit.
  14. appointment-new The icon used for the action to create a new appointment in a calendaring application.
  15. call-start The icon used for initiating or accepting a call. Should be similar to the standard cellular call pickup icon, a green handset with ear and mouth pieces facing upward.
  16. call-stop The icon used for stopping a current call. Should be similar to the standard cellular call hangup icon, a red handset with ear and mouth pieces facing downward.
  17. contact-new The icon used for the action to create a new contact in an address book application.
  18. document-new The icon used for the action to create a new document.
  19. document-open The icon used for the action to open a document.
  20. document-open-recent The icon used for the action to open a document that was recently opened.
  21. document-page-setup The icon for the page setup action of a document editor.
  22. document-print The icon for the print action of an application.
  23. document-print-preview The icon for the print preview action of an application.
  24. document-properties The icon for the action to view the properties of a document in an application.
  25. document-revert The icon for the action of reverting to a previous version of a document.
  26. document-save The icon for the save action. Should be an arrow pointing down and toward a hard disk.
  27. document-save-as The icon for the save as action.
  28. document-send The icon for the send action. Should be an arrow pointing up and away from a hard disk.
  29. edit-clear The icon for the clear action.
  30. edit-copy The icon for the copy action.
  31. edit-cut The icon for the cut action.
  32. edit-delete The icon for the delete action.
  33. edit-find The icon for the find action.
  34. edit-find-replace The icon for the find and replace action.
  35. edit-paste The icon for the paste action.
  36. edit-redo The icon for the redo action.
  37. edit-select-all The icon for the select all action.
  38. edit-undo The icon for the undo action.
  39. folder-new The icon for creating a new folder.
  40. format-indent-less The icon for the decrease indent formatting action.
  41. format-indent-more The icon for the increase indent formatting action.
  42. format-justify-center The icon for the center justification formatting action.
  43. format-justify-fill The icon for the fill justification formatting action.
  44. format-justify-left The icon for the left justification formatting action.
  45. format-justify-right The icon for the right justification action.
  46. format-text-direction-ltr The icon for the left-to-right text formatting action.
  47. format-text-direction-rtl The icon for the right-to-left formatting action.
  48. format-text-bold The icon for the bold text formatting action.
  49. format-text-italic The icon for the italic text formatting action.
  50. format-text-underline The icon for the underlined text formatting action.
  51. format-text-strikethrough The icon for the strikethrough text formatting action.
  52. go-bottom The icon for the go to bottom of a list action.
  53. go-down The icon for the go down in a list action.
  54. go-first The icon for the go to the first item in a list action.
  55. go-home The icon for the go to home location action.
  56. go-jump The icon for the jump to action.
  57. go-last The icon for the go to the last item in a list action.
  58. go-next The icon for the go to the next item in a list action.
  59. go-previous The icon for the go to the previous item in a list action.
  60. go-top The icon for the go to the top of a list action.
  61. go-up The icon for the go up in a list action.
  62. help-about The icon for the About item in the Help menu.
  63. help-contents The icon for Contents item in the Help menu.
  64. help-faq The icon for the FAQ item in the Help menu.
  65. insert-image The icon for the insert image action of an application.
  66. insert-link The icon for the insert link action of an application.
  67. insert-object The icon for the insert object action of an application.
  68. insert-text The icon for the insert text action of an application.
  69. list-add The icon for the add to list action.
  70. list-remove The icon for the remove from list action.
  71. mail-forward The icon for the forward action of an electronic mail application.
  72. mail-mark-important The icon for the mark as important action of an electronic mail application.
  73. mail-mark-junk The icon for the mark as junk action of an electronic mail application.
  74. mail-mark-notjunk The icon for the mark as not junk action of an electronic mail application.
  75. mail-mark-read The icon for the mark as read action of an electronic mail application.
  76. mail-mark-unread The icon for the mark as unread action of an electronic mail application.
  77. mail-message-new The icon for the compose new mail action of an electronic mail application.
  78. mail-reply-all The icon for the reply to all action of an electronic mail application.
  79. mail-reply-sender The icon for the reply to sender action of an electronic mail application.
  80. mail-send The icon for the send action of an electronic mail application.
  81. mail-send-receive The icon for the send and receive action of an electronic mail application.
  82. media-eject The icon for the eject action of a media player or file manager.
  83. media-playback-pause The icon for the pause action of a media player.
  84. media-playback-start The icon for the start playback action of a media player.
  85. media-playback-stop The icon for the stop action of a media player.
  86. media-record The icon for the record action of a media application.
  87. media-seek-backward The icon for the seek backward action of a media player.
  88. media-seek-forward The icon for the seek forward action of a media player.
  89. media-skip-backward The icon for the skip backward action of a media player.
  90. media-skip-forward The icon for the skip forward action of a media player.
  91. object-flip-horizontal The icon for the action to flip an object horizontally.
  92. object-flip-vertical The icon for the action to flip an object vertically.
  93. object-rotate-left The icon for the rotate left action performed on an object.
  94. object-rotate-right The icon for the rotate rigt action performed on an object.
  95. process-stop The icon used for the “Stop” action in applications with actions that may take a while to process, such as web page loading in a browser.
  96. system-lock-screen The icon used for the “Lock Screen” item in the desktop's panel application.
  97. system-log-out The icon used for the “Log Out” item in the desktop's panel application.
  98. system-run The icon used for the “Run Application...” item in the desktop's panel application.
  99. system-search The icon used for the “Search” item in the desktop's panel application.
  100. system-reboot The icon used for the “Reboot” item in the desktop's panel application.
  101. system-shutdown The icon used for the “Shutdown” item in the desktop's panel application.
  102. tools-check-spelling The icon used for the “Check Spelling” item in the application's “Tools” menu.
  103. view-fullscreen The icon used for the “Fullscreen” item in the application's “View” menu.
  104. view-refresh The icon used for the “Refresh” item in the application's “View” menu.
  105. view-restore The icon used by an application for leaving the fullscreen view, and returning to a normal windowed view.
  106. view-sort-ascending The icon used for the “Sort Ascending” item in the application's “View” menu, or in a button for changing the sort method for a list.
  107. view-sort-descending The icon used for the “Sort Descending” item in the application's “View” menu, or in a button for changing the sort method for a list.
  108. window-close The icon used for the “Close Window” item in the application's “Windows” menu.
  109. window-new The icon used for the “New Window” item in the application's “Windows” menu.
  110. zoom-fit-best The icon used for the “Best Fit” item in the application's “View” menu.
  111. zoom-in The icon used for the “Zoom in” item in the application's “View” menu.
  112. zoom-original The icon used for the “Original Size” item in the application's “View” menu.
  113. zoom-out The icon used for the “Zoom Out” item in the application's “View” menu.
  114. Table 3. Standard Animation Icons
  115. Name Description
  116. process-working This is the standard spinner animation for web browsers and file managers to show that the location is loading.
  117. Table 4. Standard Application Icons
  118. Name Description
  119. accessories-calculator The icon used for the desktop's calculator accessory program.
  120. accessories-character-map The icon used for the desktop's international and extended text character accessory program.
  121. accessories-dictionary The icon used for the desktop's dictionary accessory program.
  122. accessories-text-editor The icon used for the desktop's text editing accessory program.
  123. help-browser The icon used for the desktop's help browsing application.
  124. multimedia-volume-control The icon used for the desktop's hardware volume control application.
  125. preferences-desktop-accessibility The icon used for the desktop's accessibility preferences.
  126. preferences-desktop-font The icon used for the desktop's font preferences.
  127. preferences-desktop-keyboard The icon used for the desktop's keyboard preferences.
  128. preferences-desktop-locale The icon used for the desktop's locale preferences.
  129. preferences-desktop-multimedia The icon used for the desktop's multimedia preferences.
  130. preferences-desktop-screensaver The icon used for the desktop's screen saving preferences.
  131. preferences-desktop-theme The icon used for the desktop's theme preferences.
  132. preferences-desktop-wallpaper The icon used for the desktop's wallpaper preferences.
  133. system-file-manager The icon used for the desktop's file management application.
  134. system-software-install The icon used for the desktop's software installer application.
  135. system-software-update The icon used for the desktop's software updating application.
  136. utilities-system-monitor The icon used for the desktop's system resource monitor application.
  137. utilities-terminal The icon used for the desktop's terminal emulation application.
  138. Table 5. Standard Category Icons
  139. Name Description
  140. applications-accessories The icon for the “Accessories” sub-menu of the Programs menu.
  141. applications-development The icon for the “Programming” sub-menu of the Programs menu.
  142. applications-engineering The icon for the “Engineering” sub-menu of the Programs menu.
  143. applications-games The icon for the “Games” sub-menu of the Programs menu.
  144. applications-graphics The icon for the “Graphics” sub-menu of the Programs menu.
  145. applications-internet The icon for the “Internet” sub-menu of the Programs menu.
  146. applications-multimedia The icon for the “Multimedia” sub-menu of the Programs menu.
  147. applications-office The icon for the “Office” sub-menu of the Programs menu.
  148. applications-other The icon for the “Other” sub-menu of the Programs menu.
  149. applications-science The icon for the “Science” sub-menu of the Programs menu.
  150. applications-system The icon for the “System Tools” sub-menu of the Programs menu.
  151. applications-utilities The icon for the “Utilities” sub-menu of the Programs menu.
  152. preferences-desktop The icon for the “Desktop Preferences” category.
  153. preferences-desktop-peripherals The icon for the “Peripherals” sub-category of the “Desktop Preferences” category.
  154. preferences-desktop-personal The icon for the “Personal” sub-category of the “Desktop Preferences” category.
  155. preferences-other The icon for the “Other” preferences category.
  156. preferences-system The icon for the “System Preferences” category.
  157. preferences-system-network The icon for the “Network” sub-category of the “System Preferences” category.
  158. system-help The icon for the “Help” system category.
  159. Table 6. Standard Device Icons
  160. Name Description
  161. audio-card The icon used for the audio rendering device.
  162. audio-input-microphone The icon used for the microphone audio input device.
  163. battery The icon used for the system battery device.
  164. camera-photo The icon used for a digital still camera devices.
  165. camera-video The fallback icon for video cameras.
  166. camera-web The fallback icon for web cameras.
  167. computer The icon used for the computing device as a whole.
  168. drive-harddisk The icon used for hard disk drives.
  169. drive-optical The icon used for optical media drives such as CD and DVD.
  170. drive-removable-media The icon used for removable media drives.
  171. input-gaming The icon used for the gaming input device.
  172. input-keyboard The icon used for the keyboard input device.
  173. input-mouse The icon used for the mousing input device.
  174. input-tablet The icon used for graphics tablet input devices.
  175. media-flash The fallback icon used for flash media, such as memory stick and SD.
  176. media-floppy The icon used for physical floppy disk media.
  177. media-optical The icon used for physical optical media such as CD and DVD.
  178. media-tape The icon used for generic physical tape media.
  179. modem The icon used for modem devices.
  180. multimedia-player The icon used for generic multimedia playing devices.
  181. network-wired The icon used for wired network connections.
  182. network-wireless The icon used for wireless network connections.
  183. pda This is the fallback icon for Personal Digial Assistant devices. Primary use of this icon is for PDA devices connected to the PC. Connection medium is not an important aspect of the icon. The metaphor for this fallback icon should be a generic PDA device icon.
  184. phone This is the default fallback for phone devices. Primary use of this icon group is for phone devices which support connectivity to the PC. These may be VoIP, cellular, or possibly landline phones. The metaphor for this fallback should be a generic mobile phone device.
  185. printer The icon used for a printer device.
  186. scanner The icon used for a scanner device.
  187. video-display The icon used for the monitor that video gets displayed to.
  188. Table 7. Standard Emblem Icons
  189. Name Description
  190. emblem-default The icon used as an emblem to specify the default selection of a printer for example.
  191. emblem-documents The icon used as an emblem for the directory where a user's documents are stored.
  192. emblem-downloads The icon used as an emblem for the directory where a user's downloads from the internet are stored.
  193. emblem-favorite The icon used as an emblem for files and directories that the user marks as favorites.
  194. emblem-important The icon used as an emblem for files and directories that are marked as important by the user.
  195. emblem-mail The icon used as an emblem to specify the directory where the user's electronic mail is stored.
  196. emblem-photos The icon used as an emblem to specify the directory where the user stores photographs.
  197. emblem-readonly The icon used as an emblem for files and directories which can not be written to by the user.
  198. emblem-shared The icon used as an emblem for files and directories that are shared to other users.
  199. emblem-symbolic-link The icon used as an emblem for files and direcotires that are links to other files or directories on the filesystem.
  200. emblem-synchronized The icon used as an emblem for files or directories that are configured to be synchronized to another device.
  201. emblem-system The icon used as an emblem for directories that contain system libraries, settings, and data.
  202. emblem-unreadable The icon used as an emblem for files and directories that are inaccessible.
  203. Table 8. Standard Emotion Icons
  204. Name Description
  205. face-angel The icon used for the 0:-) emote.
  206. face-angry The icon used for the X-( emote.
  207. face-cool The icon used for the B-) emote.
  208. face-crying The icon used for the :'( emote.
  209. face-devilish The icon used for the >:-) emote.
  210. face-embarrassed The icon used for the :-[ emote.
  211. face-kiss The icon used for the :-* emote.
  212. face-laugh The icon used for the :-)) emote.
  213. face-monkey The icon used for the :-(|) emote.
  214. face-plain The icon used for the :-| emote.
  215. face-raspberry The icon used for the :-P emote.
  216. face-sad The icon used for the :-( emote.
  217. face-sick The icon used for the :-& emote.
  218. face-smile The icon used for the :-) emote.
  219. face-smile-big The icon used for the :-D emote.
  220. face-smirk The icon used for the :-! emote.
  221. face-surprise The icon used for the :-0 emote.
  222. face-tired The icon used for the |-) emote.
  223. face-uncertain The icon used for the :-/ emote.
  224. face-wink The icon used for the ;-) emote.
  225. face-worried The icon used for the :-S emote.
  226. Table 9. Standard International Icons
  227. Name Description
  228. flag-aa The flag for the country with the ISO 3166 country code AA. All flags should use ISO 3166 two-letter country codes, in lowercase form, as the specifier for the country.
  229. Table 10. Standard MIME Type Icons
  230. Name Description
  231. application-x-executable The icon used for executable file types.
  232. audio-x-generic The icon used for generic audio file types.
  233. font-x-generic The icon used for generic font file types.
  234. image-x-generic The icon used for generic image file types.
  235. package-x-generic The icon used for generic package file types.
  236. text-html The icon used for HTML text file types.
  237. text-x-generic The icon used for generic text file types.
  238. text-x-generic-template The icon used for generic text templates.
  239. text-x-script The icon used for script file types, such as shell scripts.
  240. video-x-generic The icon used for generic video file types.
  241. x-office-address-book The icon used for generic address book file types.
  242. x-office-calendar The icon used for generic calendar file types.
  243. x-office-document The icon used for generic document and letter file types.
  244. x-office-presentation The icon used for generic presentation file types.
  245. x-office-spreadsheet The icon used for generic spreadsheet file types.
  246. Table 11. Standard Place Icons
  247. Name Description
  248. folder The standard folder icon used to represent directories on local filesystems, mail folders, and other hierarchical groups.
  249. folder-remote The icon used for normal directories on a remote filesystem.
  250. network-server The icon used for individual host machines under the “Network Servers” place in the file manager.
  251. network-workgroup The icon for the “Network Servers” place in the desktop's file manager, and workgroups within the network.
  252. start-here The icon used by the desktop's main menu for accessing places, applications, and other features.
  253. user-bookmarks The icon for the user's special “Bookmarks” place.
  254. user-desktop The icon for the special “Desktop” directory of the user.
  255. user-home The icon for the special “Home” directory of the user.
  256. user-trash The icon for the user's “Trash” place in the desktop's file manager.
  257. Table 12. Standard Status Icons
  258. Name Description
  259. appointment-missed The icon used when an appointment was missed.
  260. appointment-soon The icon used when an appointment will occur soon.
  261. audio-volume-high The icon used to indicate high audio volume.
  262. audio-volume-low The icon used to indicate low audio volume.
  263. audio-volume-medium The icon used to indicate medium audio volume.
  264. audio-volume-muted The icon used to indicate the muted state for audio playback.
  265. battery-caution The icon used when the battery is below 40%.
  266. battery-low The icon used when the battery is below 20%.
  267. dialog-error The icon used when a dialog is opened to explain an error condition to the user.
  268. dialog-information The icon used when a dialog is opened to give information to the user that may be pertinent to the requested action.
  269. dialog-password The icon used when a dialog requesting the authentication credentials for a user is opened.
  270. dialog-question The icon used when a dialog is opened to ask a simple question of the user.
  271. dialog-warning The icon used when a dialog is opened to warn the user of impending issues with the requested action.
  272. folder-drag-accept The icon used for a folder while an object is being dragged onto it, that is of a type that the directory can contain.
  273. folder-open The icon used for folders, while their contents are being displayed within the same window. This icon would normally be shown in a tree or list view, next to the main view of a folder's contents.
  274. folder-visiting The icon used for folders, while their contents are being displayed in another window. This icon would typically be used when using multiple windows to navigate the hierarchy, such as in Nautilus's spatial mode.
  275. image-loading The icon used when another image is being loaded, such as thumnails for larger images in the file manager.
  276. image-missing The icon used when another image could not be loaded.
  277. mail-attachment The icon used for an electronic mail that contains attachments.
  278. mail-unread The icon used for an electronic mail that is unread.
  279. mail-read The icon used for an electronic mail that is read.
  280. mail-replied The icon used for an electronic mail that has been replied to.
  281. mail-signed The icon used for an electronic mail that contains a signature.
  282. mail-signed-verified The icon used for an electronic mail that contains a signature which has also been verified by the security system.
  283. media-playlist-repeat The icon for the repeat mode of a media player.
  284. media-playlist-shuffle The icon for the shuffle mode of a media player.
  285. network-error The icon used when an error occurs trying to intialize the network connection of the computing device. This icon should be two computers, one in the background, with the screens of both computers, colored black, and with the theme's style element for errors, overlayed on top of the icon.
  286. network-idle The icon used when no data is being transmitted or received, while the computing device is connected to a network. This icon should be two computers, one in the background, with the screens of both computers, colored black.
  287. network-offline The icon used when the computing device is disconnected from the network. This icon should be a computer in the background, with a screen colored black, and the theme's icon element to show that a device is not accessible, in the foreground.
  288. network-receive The icon used when data is being received, while the computing device is connected to a network. This icon should be two computers, one in the background, with its screen colored green, and the screen of the computer in the foreground, colored black.
  289. network-transmit The icon used when data is being transmitted, while the computing device is connected to a network. This icon should be two computers, one in the background, with its screen colored black, and the screen of the computer in the foreground, colored green.
  290. network-transmit-receive The icon used data is being both transmitted and received simultaneously, while the computing device is connected to a network. This icon should be two computers, one in the background, with the screens of both computers, colored green.
  291. printer-error The icon used when an error occurs while attempting to print. This icon should be the theme's printer device icon, with the theme's style element for errors, overlayed on top of the icon.
  292. printer-printing The icon used while a print job is successfully being spooled to a printing device. This icon should be the theme's printer device icon, with a document emerging from the printing device.
  293. security-high The icon used to indicate that the security level of a connection is known to be secure, using strong encryption and a valid certificate.
  294. security-medium The icon used to indicate that the security level of a connection is presumed to be secure, using strong encryption, and a certificate that could not be automatically verified, but which the user has chosen to trust.
  295. security-low The icon used to indicate that the security level of a connection is presumed to be insecure, either by using weak encryption, or by using a certificate that the could not be automatically verified, and which the user has not chosent to trust.
  296. software-update-available The icon used when an update is available for software installed on the computing device, through the system software update program.
  297. software-update-urgent The icon used when an urgent update is available through the system software update program.
  298. sync-error The icon used when an error occurs while attempting to synchronize data from the computing device, to another device.
  299. sync-synchronizing The icon used while data is successfully synchronizing to another device.
  300. task-due The icon used when a task is due soon.
  301. task-past-due The icon used when a task that was due, has been left incomplete.
  302. user-available The icon used when a user on a chat network is available to initiate a conversation with.
  303. user-away The icon used when a user on a chat network is away from their keyboard and the chat program.
  304. user-idle The icon used when a user on a chat network has not been an active participant in any chats on the network, for an extended period of time.
  305. user-offline The icon used when a user on a chat network is not available.
  306. user-trash-full The icon for the user's “Trash” in the desktop's file manager, when there are items in the “Trash” waiting for disposal or recovery.
  307. weather-clear The icon used while the weather for a region is “clear skies”.
  308. weather-clear-night The icon used while the weather for a region is “clear skies” during the night.
  309. weather-few-clouds The icon used while the weather for a region is “partly cloudy”.
  310. weather-few-clouds-night The icon used while the weather for a region is “partly cloudy” during the night.
  311. weather-fog The icon used while the weather for a region is “foggy”.
  312. weather-overcast The icon used while the weather for a region is “overcast”.
  313. weather-severe-alert The icon used while a sever weather alert is in effect for a region.
  314. weather-showers The icon used while rain showers are occurring in a region.
  315. weather-showers-scattered The icon used while scattered rain showers are occurring in a region.
  316. weather-snow The icon used while snow showers are occurring in a region.
  317. weather-storm The icon used while storms are occurring in a region.
  318. """
  319. ISO_3166 = """\
  320. A1 Anonymous Proxy
  321. A2 Satellite Provider
  322. O1 Other Country
  323. AD Andorra
  324. AE United Arab Emirates
  325. AF Afghanistan
  326. AG Antigua and Barbuda
  327. AI Anguilla
  328. AL Albania
  329. AM Armenia
  330. AO Angola
  331. AP Asia/Pacific Region
  332. AQ Antarctica
  333. AR Argentina
  334. AS American Samoa
  335. AT Austria
  336. AU Australia
  337. AW Aruba
  338. AX Aland Islands
  339. AZ Azerbaijan
  340. BA Bosnia and Herzegovina
  341. BB Barbados
  342. BD Bangladesh
  343. BE Belgium
  344. BF Burkina Faso
  345. BG Bulgaria
  346. BH Bahrain
  347. BI Burundi
  348. BJ Benin
  349. BL Saint Bartelemey
  350. BM Bermuda
  351. BN Brunei Darussalam
  352. BO Bolivia
  353. BQ Bonaire Saint Eustatius and Saba
  354. BR Brazil
  355. BS Bahamas
  356. BT Bhutan
  357. BV Bouvet Island
  358. BW Botswana
  359. BY Belarus
  360. BZ Belize
  361. CA Canada
  362. CC Cocos (Keeling) Islands
  363. CD Congo The Democratic Republic of the
  364. CF Central African Republic
  365. CG Congo
  366. CH Switzerland
  367. CI Cote d'Ivoire
  368. CK Cook Islands
  369. CL Chile
  370. CM Cameroon
  371. CN China
  372. CO Colombia
  373. CR Costa Rica
  374. CU Cuba
  375. CV Cape Verde
  376. CW Curacao
  377. CX Christmas Island
  378. CY Cyprus
  379. CZ Czech Republic
  380. DE Germany
  381. DJ Djibouti
  382. DK Denmark
  383. DM Dominica
  384. DO Dominican Republic
  385. DZ Algeria
  386. EC Ecuador
  387. EE Estonia
  388. EG Egypt
  389. EH Western Sahara
  390. ER Eritrea
  391. ES Spain
  392. ET Ethiopia
  393. EU Europe
  394. FI Finland
  395. FJ Fiji
  396. FK Falkland Islands (Malvinas)
  397. FM Micronesia Federated States of
  398. FO Faroe Islands
  399. FR France
  400. GA Gabon
  401. GB United Kingdom
  402. GD Grenada
  403. GE Georgia
  404. GF French Guiana
  405. GG Guernsey
  406. GH Ghana
  407. GI Gibraltar
  408. GL Greenland
  409. GM Gambia
  410. GN Guinea
  411. GP Guadeloupe
  412. GQ Equatorial Guinea
  413. GR Greece
  414. GS South Georgia and the South Sandwich Islands
  415. GT Guatemala
  416. GU Guam
  417. GW Guinea-Bissau
  418. GY Guyana
  419. HK Hong Kong
  420. HM Heard Island and McDonald Islands
  421. HN Honduras
  422. HR Croatia
  423. HT Haiti
  424. HU Hungary
  425. ID Indonesia
  426. IE Ireland
  427. IL Israel
  428. IM Isle of Man
  429. IN India
  430. IO British Indian Ocean Territory
  431. IQ Iraq
  432. IR Iran Islamic Republic of
  433. IS Iceland
  434. IT Italy
  435. JE Jersey
  436. JM Jamaica
  437. JO Jordan
  438. JP Japan
  439. KE Kenya
  440. KG Kyrgyzstan
  441. KH Cambodia
  442. KI Kiribati
  443. KM Comoros
  444. KN Saint Kitts and Nevis
  445. KP Korea Democratic People's Republic of
  446. KR Korea Republic of
  447. KW Kuwait
  448. KY Cayman Islands
  449. KZ Kazakhstan
  450. LA Lao People's Democratic Republic
  451. LB Lebanon
  452. LC Saint Lucia
  453. LI Liechtenstein
  454. LK Sri Lanka
  455. LR Liberia
  456. LS Lesotho
  457. LT Lithuania
  458. LU Luxembourg
  459. LV Latvia
  460. LY Libyan Arab Jamahiriya
  461. MA Morocco
  462. MC Monaco
  463. MD Moldova Republic of
  464. ME Montenegro
  465. MF Saint Martin
  466. MG Madagascar
  467. MH Marshall Islands
  468. MK Macedonia
  469. ML Mali
  470. MM Myanmar
  471. MN Mongolia
  472. MO Macao
  473. MP Northern Mariana Islands
  474. MQ Martinique
  475. MR Mauritania
  476. MS Montserrat
  477. MT Malta
  478. MU Mauritius
  479. MV Maldives
  480. MW Malawi
  481. MX Mexico
  482. MY Malaysia
  483. MZ Mozambique
  484. NA Namibia
  485. NC New Caledonia
  486. NE Niger
  487. NF Norfolk Island
  488. NG Nigeria
  489. NI Nicaragua
  490. NL Netherlands
  491. NO Norway
  492. NP Nepal
  493. NR Nauru
  494. NU Niue
  495. NZ New Zealand
  496. OM Oman
  497. PA Panama
  498. PE Peru
  499. PF French Polynesia
  500. PG Papua New Guinea
  501. PH Philippines
  502. PK Pakistan
  503. PL Poland
  504. PM Saint Pierre and Miquelon
  505. PN Pitcairn
  506. PR Puerto Rico
  507. PS Palestinian Territory
  508. PT Portugal
  509. PW Palau
  510. PY Paraguay
  511. QA Qatar
  512. RE Reunion
  513. RO Romania
  514. RS Serbia
  515. RU Russian Federation
  516. RW Rwanda
  517. SA Saudi Arabia
  518. SB Solomon Islands
  519. SC Seychelles
  520. SD Sudan
  521. SE Sweden
  522. SG Singapore
  523. SH Saint Helena
  524. SI Slovenia
  525. SJ Svalbard and Jan Mayen
  526. SK Slovakia
  527. SL Sierra Leone
  528. SM San Marino
  529. SN Senegal
  530. SO Somalia
  531. SR Suriname
  532. SS South Sudan
  533. ST Sao Tome and Principe
  534. SV El Salvador
  535. SX Sint Maarten
  536. SY Syrian Arab Republic
  537. SZ Swaziland
  538. TC Turks and Caicos Islands
  539. TD Chad
  540. TF French Southern Territories
  541. TG Togo
  542. TH Thailand
  543. TJ Tajikistan
  544. TK Tokelau
  545. TL Timor-Leste
  546. TM Turkmenistan
  547. TN Tunisia
  548. TO Tonga
  549. TR Turkey
  550. TT Trinidad and Tobago
  551. TV Tuvalu
  552. TW Taiwan
  553. TZ Tanzania United Republic of
  554. UA Ukraine
  555. UG Uganda
  556. UM United States Minor Outlying Islands
  557. US United States
  558. UY Uruguay
  559. UZ Uzbekistan
  560. VA Holy See (Vatican City State)
  561. VC Saint Vincent and the Grenadines
  562. VE Venezuela
  563. VG Virgin Islands British
  564. VI Virgin Islands U.S.
  565. VN Vietnam
  566. VU Vanuatu
  567. WF Wallis and Futuna
  568. WS Samoa
  569. YE Yemen
  570. YT Mayotte
  571. ZA South Africa
  572. ZM Zambia
  573. ZW Zimbabwe"""
  574. # About the following code:
  575. #
  576. # Author: Jiří Janoušek <janousek.jiri@gmail.com>
  577. #
  578. # To the extent possible under law, author has waived all
  579. # copyright and related or neighboring rights to this file.
  580. # http://creativecommons.org/publicdomain/zero/1.0/
  581. #
  582. # THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS "AS IS" AND
  583. # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  584. # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  585. # DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR
  586. # ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  587. # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  588. # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  589. # ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  590. # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  591. # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  592. from gi.repository import Gtk, Pango, Gdk
  593. clipboard = Gtk.Clipboard.get(Gdk.SELECTION_CLIPBOARD)
  594. def on_row_activated(view, path, column):
  595. model = view.get_model()
  596. iter = model.get_iter(path)
  597. icon = model.get(iter, 0)[0]
  598. clipboard.set_text(icon, -1)
  599. notebook = Gtk.Notebook(hexpand=True, vexpand=True)
  600. for line in SPEC_DATA.splitlines():
  601. if not line.strip():
  602. pass
  603. elif line.startswith("Table"):
  604. label = line.split(".")[1].strip()
  605. prefix = "Standard"
  606. suffix = "Icons"
  607. label = label[len(prefix) + 1 : 0 - len(suffix) - 1]
  608. model = Gtk.ListStore(str, str)
  609. view = Gtk.TreeView(model)
  610. view.connect("row-activated", on_row_activated)
  611. renderer = Gtk.CellRendererPixbuf()
  612. column = Gtk.TreeViewColumn("Icon", renderer, icon_name=0)
  613. column.set_sort_column_id(0)
  614. view.append_column(column)
  615. renderer = Gtk.CellRendererText()
  616. column = Gtk.TreeViewColumn("Name", renderer, text=0)
  617. column.set_sort_column_id(0)
  618. view.append_column(column)
  619. renderer = Gtk.CellRendererText(wrap_mode=Pango.WrapMode.WORD)
  620. column = Gtk.TreeViewColumn("Description", renderer, text=1)
  621. column.set_sort_column_id(1)
  622. view.append_column(column)
  623. scroll = Gtk.ScrolledWindow()
  624. scroll.add(view)
  625. notebook.append_page(scroll, Gtk.Label.new(label))
  626. elif line.startswith("Name"):
  627. pass
  628. else:
  629. try:
  630. i = line.index("\t")
  631. name = line[:i]
  632. desc = line[i + 1:]
  633. model.append((name, desc))
  634. if name == "flag-aa":
  635. for line in ISO_3166.splitlines():
  636. name = "flag-" + line[:2].lower()
  637. desc = line[3:]
  638. model.append((name, desc))
  639. except ValueError:
  640. print(line)
  641. text = """Based on document \
  642. <a href="http://standards.freedesktop.org/icon-naming-spec/icon-naming-spec-latest.html">Icon \
  643. Naming Specification</a> by <a href="mailto:dobey.pwns@gmail.com">Rodney Dawes</a>.\nDouble click \
  644. a row to copy an icon name to the clipboard."""
  645. legend = Gtk.Label(hexpand=True, use_markup=True, label=text)
  646. grid = Gtk.Grid(orientation=Gtk.Orientation.VERTICAL)
  647. grid.add(legend)
  648. grid.add(notebook)
  649. win = Gtk.Window(title="Icon Naming Specification")
  650. win.set_default_size(600, 600)
  651. win.connect("delete-event", Gtk.main_quit)
  652. win.add(grid)
  653. win.show_all()
  654. Gtk.main()

comments powered by Disqus