Skip to content

Commit

Permalink
Merge branch 'python3'
Browse files Browse the repository at this point in the history
  • Loading branch information
sergejx committed Oct 23, 2013
2 parents ea5b633 + bc71828 commit 05128fa
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion indentation_settings.plugin
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[Plugin]
Loader=python
Loader=python3
Module=indentation_settings
IAge=3
Name=Indentation Settings
Expand Down
4 changes: 2 additions & 2 deletions indentation_settings/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@

from gi.repository import GObject, Gedit, PeasGtk

import settings
from dialog import IndentationSettingsDialog
from . import settings
from .dialog import IndentationSettingsDialog

class IndentationSettingsApp(GObject.Object, Gedit.AppActivatable,
PeasGtk.Configurable):
Expand Down
2 changes: 1 addition & 1 deletion indentation_settings/dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
from contextlib import contextmanager
from gi.repository import Gtk, GtkSource

import settings
from . import settings

class IndentationSettingsDialog(object):
def __init__(self, datadir):
Expand Down
9 changes: 4 additions & 5 deletions indentation_settings/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,13 @@
"""

import os
import glib
from gi.repository import Gio
from gi.repository import Gio, GLib

SETTINGS_KEY = "org.gnome.gedit.preferences.editor"
TABS = 0

# Initialze module
filename = os.path.join(glib.get_user_config_dir(),
filename = os.path.join(GLib.get_user_config_dir(),
"gedit", "indentation-settings")
settings = {}
gedit_settings = Gio.Settings(SETTINGS_KEY)
Expand All @@ -58,7 +57,7 @@ def indent_from_string(string):
def read():
"""Read configuration file."""
try:
f = file(filename, "r")
f = open(filename, "r")
except IOError: # No settings
settings['makefile'] = TABS
return
Expand All @@ -71,7 +70,7 @@ def read():
pass

def write():
f = file(filename, "w")
f = open(filename, "w")
for lang, indent in sorted(settings.items()):
indent_s = str(indent) if indent > 0 else "tabs"
f.write(lang + ":" + indent_s + "\n")
Expand Down

0 comments on commit 05128fa

Please sign in to comment.