Opened 10 years ago
Closed 10 years ago
#268 closed defect (fixed)
.desktop files not parsed correctly
Reported by: | Nathan Rennie-Waldock | Owned by: | Antoine gmail |
---|---|---|---|
Priority: | major | Milestone: | |
Component: | Server | Keywords: | |
Cc: |
Description
.desktop files aren't being parsed correctly. Thunderbird is showing incorrectly as "Contacts". It appears only the last section is being processed, not the Desktop Entry section.
Attachments (1)
Change History (5)
Changed 10 years ago by
Attachment: | thunderbird.desktop added |
---|
comment:1 Changed 10 years ago by
Owner: | set to Antoine gmail |
---|---|
Status: | new → accepted |
comment:2 Changed 10 years ago by
That should work. The alternative would be to use ConfigParser? to parse just the Desktop Entry section.
>>> from ConfigParser import ConfigParser >>> config = ConfigParser() >>> config.read("/usr/share/applications/thunderbird.desktop") ['/usr/share/applications/thunderbird.desktop'] >>> config.sections() ['Desktop Entry', 'Desktop Action Compose', 'Desktop Action Contacts'] >>> config.get("Desktop Entry", "Name") 'Thunderbird Mail' >>> config.get("Desktop Entry", "Exec") 'thunderbird %u' >>> config.get("Desktop Entry", "Icon") 'thunderbird'
comment:3 Changed 10 years ago by
If I had been aware of ConfigParser
when I wrote this code... we wouldn't have this problem!
Oh well, r5297 should fix this.
comment:4 Changed 10 years ago by
Resolution: | → fixed |
---|---|
Status: | accepted → closed |
Yep, that's working properly now. Thanks
Note: See
TracTickets for help on using
tickets.
Yeah, you're right, I think the easiest thing to do is to just parse the first one and stop there.