# Path: meld/util/compat.py



import os
import sys
import gio
import gtk
import gobject
import pango
import atk
    import gconf
from gettext import gettext as _
from ..util.compat import text_type
    def get_directory_entry(self):
        return self.directory_entry

    def _get_default(self):
        default = self.__default_path
        last_path = self._get_last_open()
        if last_path and os.path.exists(last_path):
            default = last_path
        return default

    def get_full_path(self):
        text = self.__gentry.get_entry().get_text()
        if not text:
            return None
        sys_text = gobject.filename_from_utf8(text)
        filename = _expand_filename(sys_text, self._get_default())
        if not filename:
            return None
        return filename

    def set_filename(self, filename):
        self.__gentry.get_entry().set_text(filename)

    def __browse_dialog_ok(self, filewidget):
        filename = filewidget.get_filename()
        if not filename:
            return

        encoding = sys.getfilesystemencoding()
        if encoding:

# Path: meld/util/compat.py



# Path: meld/ui/historyentry.py
import os
import sys
import gio
import gtk
import gobject
import pango
import atk
    import gconf
from gettext import gettext as _
from ..util.compat import text_type

    def get_directory_entry(self):
        return self.directory_entry

    def _get_default(self):
        default = self.__default_path
        last_path = self._get_last_open()
        if last_path and os.path.exists(last_path):
            default = last_path
        return default

    def get_full_path(self):
        text = self.__gentry.get_entry().get_text()
        if not text:
            return None
        sys_text = gobject.filename_from_utf8(text)
        filename = _expand_filename(sys_text, self._get_default())
        if not filename:
            return None
        return filename

    def set_filename(self, filename):
        self.__gentry.get_entry().set_text(filename)

    def __browse_dialog_ok(self, filewidget):
        filename = filewidget.get_filename()
        if not filename:
            return

        encoding = sys.getfilesystemencoding()
        if encoding:

            filename = text_type(filename, encoding)