Magellan Linux

Annotation of /trunk/pyxdg/patches/pyxdg-0.19-subprocess.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1648 - (hide annotations) (download)
Fri Feb 17 19:22:52 2012 UTC (12 years, 4 months ago) by niro
File size: 1122 byte(s)
-added pyxdg patches
1 niro 1648 #Patch sent to upstream on March 1st, 2009
2     #Jesus Rivero (Neurogeek)
3     #Replaced deprecated os.popen3 for subprocess
4    
5     diff -uNr xdg.orig/Menu.py xdg/Menu.py
6     --- xdg.orig/Menu.py 2009-03-01 04:34:38.000000000 -0430
7     +++ xdg/Menu.py 2009-03-01 04:41:27.000000000 -0430
8     @@ -12,6 +12,7 @@
9    
10     import xdg.Locale
11     import xdg.Config
12     +from subprocess import Popen, PIPE
13    
14     ELEMENT_NODE = xml.dom.Node.ELEMENT_NODE
15    
16     @@ -841,13 +842,16 @@
17     return m
18    
19     def __parseKDELegacyDirs(filename, parent):
20     - f=os.popen3("kde-config --path apps")
21     - output = f[1].readlines()
22     try:
23     - for dir in output[0].split(":"):
24     - __parseLegacyDir(dir,"kde", filename, parent)
25     - except IndexError:
26     - pass
27     + f=Popen("kde-config --path apps", shell=True, stdout=PIPE).stdout
28     + output = f.readlines()
29     + try:
30     + for dir in output[0].split(":"):
31     + __parseLegacyDir(dir,"kde", filename, parent)
32     + except IndexError:
33     + pass
34     + except:
35     + raise Exception, "kde-config failed"
36    
37     # remove duplicate entries from a list
38     def __removeDuplicates(list):