diff options
author | Yann Leboulanger <asterix@lagaule.org> | 2008-10-11 13:38:17 +0400 |
---|---|---|
committer | Yann Leboulanger <asterix@lagaule.org> | 2008-10-11 13:38:17 +0400 |
commit | ba12a63d558db3986ab5aa69ab3eeec22bcff3fa (patch) | |
tree | 8c2388d6d641d3b21860b5e95c1515b1e3fccab2 /src | |
parent | 567f1e17c1f5273c7e8a052351d57327df100edb (diff) |
[thorstenp] replace file with open
Diffstat (limited to 'src')
-rw-r--r-- | src/gtkgui_helpers.py | 4 | ||||
-rw-r--r-- | src/osx/dbus.py | 4 | ||||
-rw-r--r-- | src/osx/growler.py | 4 |
3 files changed, 6 insertions, 6 deletions
diff --git a/src/gtkgui_helpers.py b/src/gtkgui_helpers.py index 4cdef98fb..f83e22882 100644 --- a/src/gtkgui_helpers.py +++ b/src/gtkgui_helpers.py @@ -157,7 +157,7 @@ def get_default_font(): if os.path.exists(xfce_config_file): try: - for line in file(xfce_config_file): + for line in open(xfce_config_file): if line.find('name="Gtk/FontName"') != -1: start = line.find('value="') + 7 return line[start:line.find('"', start)].decode('utf-8') @@ -167,7 +167,7 @@ def get_default_font(): elif os.path.exists(kde_config_file): try: - for line in file(kde_config_file): + for line in open(kde_config_file): if line.find('font=') == 0: # font=Verdana,9,other_numbers start = 5 # 5 is len('font=') line = line[start:] diff --git a/src/osx/dbus.py b/src/osx/dbus.py index 20376bc36..27a160946 100644 --- a/src/osx/dbus.py +++ b/src/osx/dbus.py @@ -20,7 +20,7 @@ _GTK_BASE = "/Library/Frameworks/GTK+.framework/Versions/Current" def readEnv(): gajimpaths.add_from_root(u'dbus.env', u'dbus.env') try: - dbus_env = file(gajimpaths[u'dbus.env'], "r") + dbus_env = open(gajimpaths[u'dbus.env'], "r") except Exception: return False try: @@ -64,7 +64,7 @@ def setEnv(env): def writeEnv(env): gajimpaths.add_from_root(u'dbus.env', u'dbus.env') try: - dbus_env = file(gajimpaths[u'dbus.env'], "w+") + dbus_env = open(gajimpaths[u'dbus.env'], "w+") dbus_env.write("DBUS_SESSION_BUS_ADDRESS=\"" + env[0] + "\"\n") dbus_env.write("DBUS_SESSION_BUS_PID=\"" + env[1] + "\"\n") dbus_env.close() diff --git a/src/osx/growler.py b/src/osx/growler.py index 0b39a66f6..62573d5a3 100644 --- a/src/osx/growler.py +++ b/src/osx/growler.py @@ -23,7 +23,7 @@ growler = None def init(): global growler, notifications - icon = file(os.path.join(gajim.DATA_DIR, "pixmaps", "gajim.icns"), "r") + icon = open(os.path.join(gajim.DATA_DIR, "pixmaps", "gajim.icns"), "r") growler = GrowlNotifier(applicationName = "Gajim", notifications = notifications, applicationIcon = icon.read(), @@ -46,7 +46,7 @@ def notify(event_type, jid, account, msg_type, path_to_image, title, text): path_to_image = os.path.abspath( os.path.join(gajim.DATA_DIR, 'pixmaps', 'events', 'chat_msg_recv.png')) # img to display - icon = file(path_to_image, "r") + icon = open(path_to_image, "r") context = [account, jid, msg_type] growler.notify(event_type, title, text, icon.read(), False, None, context) |