def __init__(self) : PoDiff.__init__(self) self.fileBase = "testBase.po" self.fileA = "testA.po" self.fileB = "testB.po" self.fileMerge = "testMerge.po" self.expected_results = None
def __init__(self): PoDiff.__init__(self) self.builder = gtk.Builder() self.builder.set_translation_domain(GETTEXT_DOMAIN) self.builder.add_from_file(os.path.join(os.path.dirname(__file__), "podiff.glade")) self.builder.connect_signals(self) self.diff_table = self.builder.get_object("diffTable") self.unit_dict = {} self.win = self.builder.get_object("poDiffWindow") self.win.show() PoUnitGtk.po_diff = self self.dirty = [False, False, False, False] self.prev_page = 0 self.stores = [] self.clear() self.scrolling = False self.search_iter = None self.unit_frames = {} self.config = ConfigParser.ConfigParser() try : config_filename = os.path.expanduser(os.path.join(PoDiffGtk.CONFIG_DIR, PoDiffGtk.CONFIG_FILENAME)) self.config.read([config_filename]) if self.config.has_option("gui", "units_per_page") : PoDiffGtk.UNITS_PER_PAGE = self.config.getint("gui", "units_per_page") else : if not self.config.has_section("gui") : self.config.add_section("gui") self.config.set("gui", "units_per_page", PoDiffGtk.UNITS_PER_PAGE) if not os.path.isdir(os.path.expanduser(PoDiffGtk.CONFIG_DIR)) : os.makedirs(os.path.expanduser(PoDiffGtk.CONFIG_DIR)) with open(os.path.expanduser(config_filename), 'ab') as configfile: self.config.write(configfile) except Exception as e: print "Error reading config file: " + str(e)
def __init__(self): PoDiff.__init__(self) self.builder = gtk.Builder() self.builder.set_translation_domain(GETTEXT_DOMAIN) self.builder.add_from_file( os.path.join(os.path.dirname(__file__), "podiff.glade")) self.builder.connect_signals(self) self.diff_table = self.builder.get_object("diffTable") self.unit_dict = {} self.win = self.builder.get_object("poDiffWindow") self.win.show() PoUnitGtk.po_diff = self self.dirty = [False, False, False, False] self.prev_page = 0 self.stores = [] self.clear() self.scrolling = False self.search_iter = None self.unit_frames = {} self.config = ConfigParser.ConfigParser() try: config_filename = os.path.expanduser( os.path.join(PoDiffGtk.CONFIG_DIR, PoDiffGtk.CONFIG_FILENAME)) self.config.read([config_filename]) if self.config.has_option("gui", "units_per_page"): PoDiffGtk.UNITS_PER_PAGE = self.config.getint( "gui", "units_per_page") else: if not self.config.has_section("gui"): self.config.add_section("gui") self.config.set("gui", "units_per_page", PoDiffGtk.UNITS_PER_PAGE) if not os.path.isdir(os.path.expanduser(PoDiffGtk.CONFIG_DIR)): os.makedirs(os.path.expanduser(PoDiffGtk.CONFIG_DIR)) with open(os.path.expanduser(config_filename), 'ab') as configfile: self.config.write(configfile) except Exception as e: print "Error reading config file: " + str(e)