loook-0.7.3/0000755000175000017500000000000012266707222013330 5ustar mechtildemechtildeloook-0.7.3/loook.de.po0000644000175000017500000000562512266752074015417 0ustar mechtildemechtilde # German translation for Loook package # German messages for Loook. # Copyright (C) 2013 Mechtilde Stehmann # This file is distributed under the same license as the Loook package. # Mechtilde Stehmann , 2013. # msgid "" msgstr "" "Project-Id-Version: Loook 0.7.3\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-11-15 21:37+0100\n" "PO-Revision-Date: 2013-11-15 21:39+0100\n" "Last-Translator: Mechtilde Stehmann \n" "Language-Team: German\n" "Language: de\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: loook.py:62 msgid "Cannot find home directory, settings will not be saved." msgstr "Kann das Nutzerverzeichnis nicht finden. Die Einstellungen werden nicht gespeichert." #: loook.py:69 msgid "Viewer:" msgstr "Betrachter:" #: loook.py:70 msgid "Search path:" msgstr "Suchpfad:" #: loook.py:71 msgid "Search terms:" msgstr "Suchbegriffe:" #: loook.py:72 msgid "Mode:" msgstr "Modus:" #: loook.py:73 msgid "Matches:" msgstr "Treffer:" #: loook.py:104 loook.py:106 loook.py:183 loook.py:246 msgid "AND" msgstr "UND" #: loook.py:107 loook.py:187 loook.py:255 msgid "OR" msgstr "ODER" #: loook.py:108 loook.py:191 loook.py:239 msgid "Phrase" msgstr "Ausdruck" #: loook.py:128 msgid "Search" msgstr "Suchen" #: loook.py:132 msgid "Quit" msgstr "Beenden" #: loook.py:136 msgid "Stop" msgstr "Stopp" #: loook.py:143 msgid "Ready." msgstr "Fertig." #: loook.py:214 loook.py:323 msgid "Error" msgstr "Fehler" #: loook.py:214 msgid "Set viewer first." msgstr "Bestimmen Sie erst den Betrachter." #: loook.py:218 msgid "Starting viewer..." msgstr "Betrachter starten..." #: loook.py:226 msgid "Warning: Command returned code != 0: " msgstr "Warnung: Befehl gibt Code != 0 zurück: " #: loook.py:309 msgid "Warning: Supposed ZIP file " msgstr "Warnung: Vermeintliche ZIP Datei " #: loook.py:309 loook.py:311 msgid "could not be opened: " msgstr "kann nicht geöffnet werden" #: loook.py:311 msgid "Warning: File " msgstr "Warnung: Datei " #: loook.py:323 msgid "Path " msgstr "Pfad" #: loook.py:323 msgid "doesn't exist." msgstr "existiert nicht." #: loook.py:329 msgid "in" msgstr "in" #: loook.py:329 msgid "files" msgstr "Dateien" #: loook.py:331 msgid "matches so far" msgstr "Übereinstimmungen soweit" #: loook.py:331 msgid "(search stopped)" msgstr "(Suche gestoppt)" #: loook.py:334 msgid "matches" msgstr "Treffer" #: loook.py:353 msgid "Searching in " msgstr "Suchen in " #: loook.py:358 msgid "Warning: " msgstr "Warnung: " #: loook.py:361 msgid "Warning: Unicode problem with directory name..." msgstr "Warnung: Unicode Problem mit Verzeichnisnamen..." #: loook.py:474 msgid "Usage:" msgstr "Verwendung:" #: loook.py:474 msgid "[search path] [search term]..." msgstr "[Suchpfad] [Suchbegriff]..." #: loook.py:478 msgid "OpenOffice.org File Finder" msgstr "OpenOffice.org Suche" loook-0.7.3/Changelog0000644000175000017500000000256212266752074015154 0ustar mechtildemechtilde loook.py 0.7.3 (2014-01-10) - Search in OpenOffice file 0.7.2 to 0.7.3 Add *.docx support and fixes 0.7.1 to 0.7.2 More small fixes 0.7 to 0.7.1 Small fixes 0.6.8 to 0.7 Integration of localisation 0.6.7 to 0.6.8: Search embedded files (thanks to Hanna Ruotsalainen) 0.6.6 to 0.6.7: Fixes to make loook work with Python 3.1.1 when started with parameters 0.6.5 to 0.6.6: Made Loook work with Python 3.1.1 0.6.4 to 0.6.5: Fixed problems with filenames that contain special (non-ASCII) characters -- thanks to Roman Shiryaev 0.6.3 to 0.6.4: Fixed starting OpenOffice.org on Windows -- thanks to Matthias Hüning 0.6.2 to 0.6.3: Added support for the new file formats of OpenOffice.org 2.x; sort results by file name; made saving configuration more robust 0.6.1 to 0.6.2: Should now also work on Windows98 0.6 to 0.6.1: Search directory can now be set via command line, e.g.: loook.py ~/Documents term1 term2 The number of searched OpenOffice.org files is now printed in the status bar. 0.5 to 0.6: loook.py now remembers your directory settings (path to OOo and search path). Homepage: http://www.danielnaber.de/loook/ New Home: http://mechtilde.de/Loook (since version 0.7) loook-0.7.3/loook.en.po0000644000175000017500000000550712266752074015430 0ustar mechtildemechtilde # English original text for Loook package # English messages for Loook. # Copyright (C) 2013 Mechtilde Stehmann # This file is distributed under the same license as the Loook package. # Mechtilde Stehmann , 2013. # msgid "" msgstr "" "Project-Id-Version: Loook 0.7.3\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-11-15 21:37+0100\n" "PO-Revision-Date: 2013-11-15 21:39+0100\n" "Last-Translator: Mechtilde Stehmann \n" "Language-Team: English\n" "Language: en\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: loook.py:62 msgid "Cannot find home directory, settings will not be saved." msgstr "Cannot find home directory, settings will not be saved." #: loook.py:69 msgid "Viewer:" msgstr "Viewer:" #: loook.py:70 msgid "Search path:" msgstr "Search path:" #: loook.py:71 msgid "Search terms:" msgstr "Search terms:" #: loook.py:72 msgid "Mode:" msgstr "Mode:" #: loook.py:73 msgid "Matches:" msgstr "Matches:" #: loook.py:104 loook.py:106 loook.py:183 loook.py:246 msgid "AND" msgstr "AND" #: loook.py:107 loook.py:187 loook.py:255 msgid "OR" msgstr "OR" #: loook.py:108 loook.py:191 loook.py:239 msgid "Phrase" msgstr "Phrase" #: loook.py:128 msgid "Search" msgstr "Search" #: loook.py:132 msgid "Quit" msgstr "Quit" #: loook.py:136 msgid "Stop" msgstr "Stop" #: loook.py:143 msgid "Ready." msgstr "Ready." #: loook.py:214 loook.py:323 msgid "Error" msgstr "Error" #: loook.py:214 msgid "Set viewer first." msgstr "Set viewer first." #: loook.py:218 msgid "Starting viewer..." msgstr "Starting viewer..." #: loook.py:226 msgid "Warning: Command returned code != 0: " msgstr "Warning: Command returned code != 0: " #: loook.py:309 msgid "Warning: Supposed ZIP file " msgstr "Warning: Supposed ZIP file " #: loook.py:309 loook.py:311 msgid "could not be opened: " msgstr "could not be opened: " #: loook.py:311 msgid "Warning: File " msgstr "Warning: File " #: loook.py:323 msgid "Path " msgstr "Path " #: loook.py:323 msgid "doesn't exist." msgstr "doesn't exist." #: loook.py:329 msgid "in" msgstr "in" #: loook.py:329 msgid "files" msgstr "files" #: loook.py:331 msgid "matches so far" msgstr "matches so far" #: loook.py:331 msgid "(search stopped)" msgstr "(search stopped)" #: loook.py:334 msgid "matches" msgstr "matches" #: loook.py:353 msgid "Searching in " msgstr "Searching in " #: loook.py:358 msgid "Warning: " msgstr "Warning: " #: loook.py:361 msgid "Warning: Unicode problem with directory name..." msgstr "Warning: Unicode problem with directory name..." #: loook.py:474 msgid "Usage:" msgstr "Usage:" #: loook.py:474 msgid "[search path] [search term]..." msgstr "[search path] [search term]..." #: loook.py:478 msgid "OpenOffice.org File Finder" msgstr "OpenOffice.org File Finder" loook-0.7.3/uninstall.sh0000755000175000017500000000220512266752074015704 0ustar mechtildemechtilde#!/bin/bash # -*- coding: utf-8 -*- # # uninstall-loook.sh # # Copyright 2013 Mechtilde Stehmann # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, # MA 02110-1301, USA. InstP="/usr/local/lib/loook" ManP="/usr/share/man" if test $(whoami) == "root" then rm -rv $InstP rm -v $ManP/man1/loook.1.gz rm -v $ManP/de/man1/loook.1.gz rm -v /usr/local/bin/loook rm -v /usr/share/applications/loook.desktop rm -v /usr/share/pixmaps/loook.png else echo "You must be root!" fi exit loook-0.7.3/loook.png0000644000175000017500000000312412233426756015165 0ustar mechtildemechtildePNG  IHDRw=bKGD pHYs B(xtIME   t9LIDATHǵYlT޹0c=cwǀc0)&! 5@JiTB*]UiTUj}C+uU$JDHCZL:7.kY t,<  }::sV}8ޱQj߅y:3YDNjj ʏcT"{osP[{ׁWO]ϝ_d](LkpATbx&Am@Pߝ;ҟFL}5!|tv+pٴ1D<ő |mW׬|{ccW @ ѶR<=_&, ᛻rtܠ]{߾}_@ǓRrWω#[ǎ X 1]nWmk!~w:ihinrǀ?(kW,MNkg=>$ʐ,R((+U4 9ŚPcX4Q{KJl5=z&3ˣ!D[,J6#aKU!#2J#)j+894Jm0OZӇH:ۛ ER)s)t2Mza"’6-LEtMG@JKB1nn$PWndG)p@:tElp8$ ot)Ňk}.ѽ^'"Dne4669 0Id If3Ě膎eWn.[25W|O a߀h8p879 3{CRHRD|1Q{X6NC7oIC 4 ó発)I<7Cn[ޝA_n{Ņ'V0r&#&\ 8 OCD]\J^R~ _+$(W< 7/12Ln&3::̡#5:|=^X@?2֬"*R9,)tB> sys.stderr, _("Cannot find home directory, settings will not be saved.") self.configfile = None self.createWidgets() return def createWidgets(self): """Build and show the GUI elements.""" Label(self.master, text=_("Viewer:")).grid(row=0, sticky=E) Label(self.master, text=_("Search path:")).grid(row=1, sticky=E) Label(self.master, text=_("Search terms:")).grid(row=2, sticky=E) Label(self.master, text=_("Mode:")).grid(row=3, sticky=E) Label(self.master, text=_("Matches:")).grid(row=4, sticky=N+E) self.ooo_path = Entry(self.master) if self.ooo_path_str: self.ooo_path.insert(END, self.ooo_path_str) else: self.ooo_path.insert(END, "soffice") self.ooo_path_b = Button(self.master) self.ooo_path_b.bind("", self.selectOOoPath) self.ooo_path_b["text"] = ">" self.search_path = Entry(self.master) if len(sys.argv) >= 2: self.search_path.insert(END, sys.argv[1]) elif self.search_path_str: self.search_path.insert(END, self.search_path_str) else: self.search_path.insert(END, os.getcwd()) self.search_path_b = Button(self.master) self.search_path_b.bind("", self.selectSearchPath) self.search_path_b["text"] = ">" self.search_query = Entry(self.master) self.search_query.bind('', self.startSearch) if len(sys.argv) >= 2: lang, enc = locale.getdefaultlocale() self.search_query.insert(END, ' '.join(sys.argv[2:])) self.search_query.focus() self.mode_button = Button(self.master) self.mode_button.bind("", self.popupMode) self.mode_button["text"] = _("AND") self.mode_menu = Menu(self.master, tearoff=0) self.mode_menu.add_command(label=_("AND"), command=self.setModeAND) self.mode_menu.add_command(label=_("OR"), command=self.setModeOR) self.mode_menu.add_command(label=_("Phrase"), command=self.setModePhrase) pad = 1 self.ooo_path.grid(columnspan=2, row=0, column=1, sticky=E+W, pady=pad, padx=pad) self.ooo_path_b.grid(row=0, column=3, sticky=E+W, pady=pad, padx=pad) self.search_path.grid(columnspan=2, row=1, column=1, sticky=E+W, pady=pad, padx=pad) self.search_path_b.grid(row=1, column=3, sticky=E+W, pady=pad, padx=pad) self.search_query.grid(columnspan=3, row=2, column=1, sticky=E+W, pady=pad, padx=pad) self.mode_button.grid(columnspan=3, row=3, column=1, sticky=W, pady=pad, padx=pad) self.scrollbar = Scrollbar(self.master) self.scrollbar.grid(row=4, column=3, sticky=N+S, pady=pad, padx=pad) self.listbox = Listbox(self.master, yscrollcommand=self.scrollbar.set) self.listbox.bind('', self.showDoc) self.listbox.grid(columnspan=2, row=4, column=1, sticky=E+W+S+N, pady=pad, padx=pad) self.scrollbar.config(command=self.listbox.yview) f = Frame(self.master) self.search = Button(f) self.search["text"] = _("Search") self.search["command"] = self.startSearch self.search.pack(side=LEFT) self.quit_button = Button(f) self.quit_button["text"] = _("Quit") self.quit_button["command"] = self.doQuit self.quit_button.pack(side=RIGHT) self.stop_button = Button(f) self.stop_button["text"] = _("Stop") self.stop_button["command"] = self.stop self.stop_button["state"] = DISABLED self.stop_button.pack(side=RIGHT) f.grid(row=5, columnspan=2, column=2, sticky=E, pady=pad, padx=pad) self.status = Label(self.master, text="", bd=1, relief=SUNKEN, anchor=W) self.status.config(text=_("Ready.")) self.status.grid(row=6, columnspan=4, column=0, sticky=E+W, pady=pad, padx=pad) return def doQuit(self): """Save configuration, the quit.""" self.saveConfig() self.master.quit() return def saveConfig(self): """Save path settings in configuration file in the user's HOME.""" if self.configfile: file = codecs.open(self.configfile, "w", "utf-8") if not self.config.has_section("General"): self.config.add_section("General") file.write("[General]\n") file.write("ooo_path=%s\n" % self.ooo_path.get()) file.write("search_path=%s\n" % self.search_path.get()) file.close() return def selectOOoPath(self, event): d = tkinter.filedialog.askopenfilename() self.ooo_path.delete(0, END) self.ooo_path.insert(END, d) return def selectSearchPath(self, event): d = tkinter.filedialog.askdirectory() self.search_path.delete(0, END) self.search_path.insert(END, d) return def setMode(self, mode): self.mode = mode self.mode_button["text"] = mode return def setModeAND(self): self.setMode(_("AND")) return def setModeOR(self): self.setMode(_("OR")) return def setModePhrase(self): self.setMode(_("Phrase")) return def popupMode(self, event): try: self.mode_menu.tk_popup(event.x_root, event.y_root, 0) finally: # make sure to release the grab (Tk 8.0a1 only) self.mode_menu.grab_release() return def stop(self): self.stopped = 1 return def showDoc(self, event): """Start OOo to view the file. This method lacks error handling (TODO).""" items = event.widget.curselection() filename = "%s%s" % (self.search_path.get(), event.widget.get(items[0])) filename = os.path.normpath(filename) prg = self.ooo_path.get() if not prg: tkinter.messagebox.showwarning(_('Error'), _('Set viewer first.')) else: filename = filename.replace('"', '\\" ') cmd = "\"%s\" \"%s\" &" % (prg, filename) self.status.config(text=_("Starting viewer...")) print(cmd) try: res = os.system(cmd) except UnicodeError: res = os.system(cmd) if res != 0: # don't show a dialog, this check might not be system-indepenent: print(_("Warning: Command returned code != 0: ") + cmd) return def removeXMLMarkup(self, s, replace_with_space): s = re.compile("", re.DOTALL).sub('', s) repl = '' if replace_with_space: repl = ' ' s = re.compile("<[^>]*>", re.DOTALL).sub(repl, s) return s def match(self, query, docstring): mode = self.mode_button["text"] if mode == _("Phrase"): # match only documents that contain the phrase: regex = re.compile(re.escape(query.lower()), re.DOTALL) if regex.search(docstring): return 1 else: parts = re.split("\s+", query.strip()) if mode == _("AND"): # match only documents that contain all words: match = 1 for part in parts: regex = re.compile(re.escape(part.lower()), re.DOTALL) if not regex.search(docstring): match = 0 break return match elif mode == _("OR"): # match documents that contain at leats one word: match = 0 for part in parts: regex = re.compile(re.escape(part.lower()), re.DOTALL) if regex.search(docstring): match = 1 break return match else: print("Error: unknown search mode '%s'" % mode) return 0 def processFile(self, filename, query): suffix = self.getSuffix(filename) try: # Handle OpenOffice.org files: if suffix in ('sxw', 'stw', # OOo 1.x swriter 'sxc', 'stc', # OOo 1.x scalc 'sxi', 'sti', # OOo 1.x simpress 'sxg', # OOo 1.x master document 'sxm', # OOo 1.x formula 'sxd', 'std', # OOo 1.x sdraw 'odt', 'ott', # OOo > 2.x swriter 'odp', 'otp', # OOo > 2.x simpress 'odf', # OOo > 2.x formula 'odg', 'otg', # OOo > 2.x sdraw 'ods', 'ots', # OOo > 2.x scalc ): zip = zipfile.ZipFile(filename, "r") content = "" docinfo = "" try: # search embedded files: filelist = zip.namelist() for filename in filelist: if filename.endswith("content.xml"): content += str(zip.read(filename), 'utf-8') if filename.endswith("document.xml"): content += str(zip.read(filename), 'utf-8') content = self.removeXMLMarkup(content, replace_with_space=0) docinfo = str(zip.read("meta.xml"), 'utf-8') docinfo = self.removeXMLMarkup(docinfo, replace_with_space=0) self.ooo_count = self.ooo_count + 1 except KeyError as err: print("Warning: %s not found in '%s'" % (err, filename)) return None title = "" title_match = re.compile("(.*?)", re.DOTALL|re.IGNORECASE).search(docinfo) if title_match: title = title_match.group(1) if self.match(query, "%s %s" % (content.lower(), docinfo.lower())): return (filename, title) # Handle MS-Office (>= 2007) files: if suffix in ('docx', 'dotx', # MS-Word Documents >= 2007 'xlsx', 'xltx', # MS-Excel-Documents >= 2007 ): zip = zipfile.ZipFile(filename, "r") content = "" docinfo = "" try: # search embedded files: filelist = zip.namelist() for filename in filelist: if filename.endswith("document.xml"): content += str(zip.read(filename), 'utf-8') if filename.endswith("sharedStrings.xml"): content += str(zip.read(filename), 'utf-8') content = self.removeXMLMarkup(content, replace_with_space=0) docinfo = str(zip.read("docProps/core.xml"), 'utf-8') docinfo = self.removeXMLMarkup(docinfo, replace_with_space=0) self.ooo_count = self.ooo_count + 1 except KeyError as err: print("Warning: %s not found in '%s'" % (err, filename)) return None title = "" title_match = re.compile("(.*?)", re.DOTALL|re.IGNORECASE).search(docinfo) if title_match: title = title_match.group(1) if self.match(query, "%s %s" % (content.lower(), docinfo.lower())): return (filename, title) except zipfile.BadZipfile as err: print(_("Warning: Supposed ZIP file ") + filename + _("could not be opened: ") + err) except IOError as err: print(_("Warning: File ") + filename + _("could not be opened: ") + err) return None def startSearch(self, event=None): self.stopped = 0 self.last_update = 0 self.match_count = 0 self.ooo_count = 0 self.listbox.delete(0, END) self.stop_button["state"] = NORMAL self.quit_button["state"] = DISABLED if not os.path.exists(self.search_path.get()): tkinter.messagebox.showwarning(_("Error"), _("Path ") + self.search_path.get() +_("doesn\'t exist.")) else: #start_time = time.time() self.recursiveSearch(self.search_path.get()) #duration = time.time() - start_time #print("time=%.2f" % duration) count_str = "%s %d %s" % (_("in"), self.ooo_count, _("files")) if self.stopped: self.status.config(text="%d %s %s %s" % (self.match_count, _("matches so far"), count_str, _("(search stopped)"))) self.stopped = 0 else: self.status.config(text="%d %s %s" % (self.match_count, _("matches"), count_str)) self.stop_button["state"] = DISABLED self.quit_button["state"] = NORMAL return def getSuffix(self, filename): suffix_match = re.compile(".*\.(.*)").match(filename) if suffix_match: suffix = suffix_match.group(1).lower() else: suffix = None return suffix def recursiveSearch(self, directory): len_limit = 15 # avoid resizing window dir_part = os.path.split(directory)[1] if len(dir_part) > len_limit: dir_part = "%s..." % dir_part[0:len_limit] #print("'%s'" % dir_part) self.status.config(text=_("Searching in ") + "%s" % dir_part) try: dir_content = os.listdir(directory) dir_content.sort(key=str.lower) except OSError as err: print(_("Warning: ") + directory + (": ") + err) return except UnicodeError as err: print(_("Warning: Unicode problem with directory name...")) return for filename in dir_content: if self.stopped: return filename = os.path.join(directory, filename) if os.path.isfile(filename): match = self.processFile(filename, self.search_query.get()) update_interval = 0.05 time_diff = time.time() - self.last_update if time_diff > update_interval: self.master.update() self.last_update = time.time() if match: title = match[1] if not title: title = "Untitled" display_filename = filename.replace(self.search_path.get(), '') self.listbox.insert('end', "%s" % display_filename) self.match_count = self.match_count + 1 elif os.path.isdir(filename) and not os.path.islink(filename): self.recursiveSearch(filename) return # Begin gettext integration class TranslationIntegration(object): """GNU-gettext for GNU/Linux""" def __init__(self, pname): self.moname = pname + ".mo" self.syslanguage() # check, whether it's a unix system installation _localepath = "/usr/share/locale/" _result = self.look4mo(_localepath) if _result == "xxx": self.syslanguage() _localepath = "locale/" _result = self.look4mo(_localepath) if not _result == "xxx": # chooses the right .mo file and installs translation trans = gettext.translation(pname, _localepath, [self.language]) trans.install() else: # Translating the following strings is absurd! serror = "Bad package! No "+self.moname+" file found!" from tkinter import messagebox messagebox.showerror('Error!', serror) import sys; sys.exit(1) def syslanguage(self): """which is the language of the system (GNU/Linux)?""" _loclang = locale.getdefaultlocale() self.language = _loclang[0] if self.language == None: self.language = "en" return self.language def look4mo(self, localepath): """choose only a language which a .mo file exists for, else use english or return 'xxx' """ _lpath = localepath + self.language + "/LC_MESSAGES/" + self.moname if not os.path.exists(_lpath): _newlang = self.dosplit(self.language, "_") _lpath = localepath + _newlang + "/LC_MESSAGES/"+self.moname if os.path.exists(_lpath): self.language = _newlang else: _newlang = self.dosplit(self.language, "@") _lpath = localepath + _newlang + "/LC_MESSAGES/" + self.moname if os.path.exists(_lpath): self.language = _newlang else: _lpath = localepath + "en/LC_MESSAGES/" + self.moname if os.path.exists(_lpath): self.language = "en" else: self.language = "xxx" return self.language def dosplit(self, language, splitter): """ splits language descriptor >>> gnugettext.dosplit(gnugettext, "de_DE", "_") 'de' >>> gnugettext.dosplit(gnugettext, "be@latin", "@") 'be' """ _newlang = language.split(splitter) _newlang = _newlang[0] return _newlang # End gettext integration if __name__ == "__main__": version = "0.7.3" loookversion = "loook-" + version g = TranslationIntegration(loookversion) if len(sys.argv) >= 2 and (sys.argv[1] == '--help' or sys.argv[1] == '-h'): print(_("Usage:") +" loook [-h|--help] " + _("[search path] [search term]...")) sys.exit(1) root = Tk() root.minsize(380, 200) root.title("Loook " + version + " - " + _("OpenOffice.org File Finder")) root.columnconfigure(1, weight=1) root.rowconfigure(4, weight=1) root.columnconfigure(1, weight=1) root.rowconfigure(5, weight=0) app = Application(root) root.protocol("WM_DELETE_WINDOW", app.doQuit) root.mainloop() loook-0.7.3/loook.desktop0000644000175000017500000000053112266752075016053 0ustar mechtildemechtilde[Desktop Entry] X-AppInstall-Package=Loook X-AppInstall-Popcon=504 X-AppInstall-Section=main Version=0.7.3 Name=Loook Comment=Search strings in ODF documents Comment[de]=Sucht Begriffe in ODF Dokumenten Exec=loook Icon=loook Terminal=false Type=Application Categories=Office;Utility Keywords=Office;Utility;ODF Files; Search StartupNotify=true loook-0.7.3/loook.bat0000755000175000017500000000003412266752074015150 0ustar mechtildemechtildestart pythonw loook.py exit loook-0.7.3/loook.nl.po0000644000175000017500000000564412266752074015441 0ustar mechtildemechtilde # Dutch text for Loook package # Dutch messages for Loook. # Copyright (C) 2013 Arthur Buijs # This file is distributed under the same license as the Loook package. # Arthur Buijs arthur@artietee.nl, 2013. # msgid "" msgstr "" "Project-Id-Version: Loook 0.7.3\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-11-15 21:37+0100\n" "PO-Revision-Date: 2013-11-16 16:21+0100\n" "Last-Translator: Arthur Buijs \n" "Language-Team: Dutch\n" "Language: nl\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" "X-Generator: Poedit 1.5.7\n" #: loook.py:62 msgid "Cannot find home directory, settings will not be saved." msgstr "Kan de home-directory niet vinden, de instellingen worden niet opgeslagen." #: loook.py:69 msgid "Viewer:" msgstr "ODF-viewer:" #: loook.py:70 msgid "Search path:" msgstr "Zoekpad:" #: loook.py:71 msgid "Search terms:" msgstr "Zoekbegrippen:" #: loook.py:72 msgid "Mode:" msgstr "Modus:" #: loook.py:73 msgid "Matches:" msgstr "Overeenkomsten:" #: loook.py:104 loook.py:106 loook.py:183 loook.py:246 msgid "AND" msgstr "EN" #: loook.py:107 loook.py:187 loook.py:255 msgid "OR" msgstr "OF" #: loook.py:108 loook.py:191 loook.py:239 msgid "Phrase" msgstr "Zin" #: loook.py:128 msgid "Search" msgstr "Zoeken" #: loook.py:132 msgid "Quit" msgstr "Afsluiten" #: loook.py:136 msgid "Stop" msgstr "Stoppen" #: loook.py:144 msgid "Ready." msgstr "Klaar." #: loook.py:214 loook.py:323 msgid "Error" msgstr "Fout" #: loook.py:214 msgid "Set viewer first." msgstr "Stel eerst de ODF-viewer in." #: loook.py:218 msgid "Starting viewer..." msgstr "ODF-viewer starten..." #: loook.py:226 msgid "Warning: Command returned code != 0: " msgstr "Waarschuwing: Opdracht komt met code!=0 terug:" #: loook.py:309 msgid "Warning: Supposed ZIP file " msgstr "Waarschuwing: Verondersteld ZIP-bestand " #: loook.py:309 loook.py:311 msgid "could not be opened: " msgstr "kan niet geopend worden: " #: loook.py:311 msgid "Warning: File " msgstr "Waarschuwing: Bestand " #: loook.py:323 msgid "Path " msgstr "Pad" #: loook.py:323 msgid "doesn't exist." msgstr "bestaat niet." #: loook.py:329 msgid "in" msgstr "in" #: loook.py:329 msgid "files" msgstr "bestanden" #: loook.py:331 msgid "matches so far" msgstr "tot dusverre gevonden" #: loook.py:331 msgid "(search stopped)" msgstr "(zoeken gestopt)" #: loook.py:334 msgid "matches" msgstr "overeenkomsten" #: loook.py:353 msgid "Searching in " msgstr "Zoeken in" #: loook.py:358 msgid "Warning: " msgstr "Waarschuwing: " #: loook.py:361 msgid "Warning: Unicode problem with directory name..." msgstr "Waarschuwing: Unicode-probleem met directory-naam..." #: loook.py:474 msgid "Usage:" msgstr "Gebruik:" #: loook.py:474 msgid "[searchpath] [search term]..." msgstr "[Zoekpad] [Zoekbegrip]..." #: loook.py:478 msgid "OpenOffice.org File Finder" msgstr "OpenOffice.org File Zoeken" loook-0.7.3/man/0000755000175000017500000000000012244372743014105 5ustar mechtildemechtildeloook-0.7.3/man/loook.10000644000175000017500000000140412266752075015315 0ustar mechtildemechtilde.\"Created with GNOME Manpages Editor Wizard gmanedit .TH LOOOK 1 "November 23 2013" "Mechtilde Stehmann" "Office" .SH NAME loook \- Search in OpenOffice Files .SH SYNOPSIS fBloook\fP [\-h|\-\-help] [SEARCHPATH] [SEARCHTERM1 SEARCHTERM2 ... ] .br .SH DESCRIPTION This manual page explains the \fBloook\fP program. This program helps to find OpenOffice files containing defined strings (Search terms). OpenOffice files are also files generates Libreoffice or Apache OpenOffice. .PP You can run \fBloook\fP without any arguments. In that case you insert the search path and the search terms into the graphical user interface. OpenOffice files are also files, which are created by Libreoffice or Apache OpenOffice. .SH Optionen .TP \fB\-h, \-\-help\fP show usage and exit loook-0.7.3/man/de/0000755000175000017500000000000012244372743014475 5ustar mechtildemechtildeloook-0.7.3/man/de/loook.10000644000175000017500000000137712266752075015716 0ustar mechtildemechtilde.\"Created with GNOME Manpages Editor Wizard gmanedit .TH LOOOK 1 "November 23 2013" "Mechtilde Stehmann" "Office" .SH NAME loook \- Durchsucht OpenOffice/Libreoffice Dateien .SH SYNTAX fBloook\fP [\-h|\-\-help] [SUCHPFAD] [SUCHBEGRIFF1 SUCHBEGRIFF2 ... ] .br .SH Beschreibung Diese Manualseite beschreibt das Programm \fBloook\fP. Dieses Programm hilft, OpenOffice/Libreoffice Dateien zu finden, die bestimmte Suchbegriffe enthalten. .PP \fBLoook\fP kann ohne zus\[char228]tzliche Parameter gestartet werden. In diesem Fall werden der Suchpfad und die Suchbegiffe in den graphischen Dialog eingegeben. OpenOffice Dateien sind auch solche, die mit Libreoffice oder Apache OpenOffice erzeugt wurden. .SH Optionen .TP \fB\-h, \-\-help\fP Hilfe anzeigen und beenden loook-0.7.3/Copyright0000644000175000017500000003560612266752075015243 0ustar mechtildemechtilde GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS loook-0.7.3/install.sh0000755000175000017500000000407012266752074015343 0ustar mechtildemechtilde#!/bin/bash # -*- coding: utf-8 -*- # # install-loook.sh # # Copyright 2013 Mechtilde Stehmann # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, # MA 02110-1301, USA. InstP="/usr/local/lib/loook" ManP="/usr/share/man" if test $(whoami) == "root" then if test -e "/usr/bin/python3" then mkdir -pv $InstP && cp -av loook.py $InstP/loook.py && chmod +x $InstP/loook.py && mkdir -pv $InstP/locale/en/LC_MESSAGES/ && cp -av locale/en/LC_MESSAGES/loook-0.7.3.mo $InstP/locale/en/LC_MESSAGES/loook-0.7.3.mo && mkdir -pv $InstP/locale/de/LC_MESSAGES/ && cp -av locale/de/LC_MESSAGES/loook-0.7.3.mo $InstP/locale/de/LC_MESSAGES/loook-0.7.3.mo && mkdir -pv $InstP/locale/nl/LC_MESSAGES/ && cp -av locale/nl/LC_MESSAGES/loook-0.7.3.mo $InstP/locale/nl/LC_MESSAGES/loook-0.7.3.mo && ln -sv $InstP/loook.py /usr/local/bin/loook && mkdir -pv $ManP/man1/ && gzip man/loook.1 > $ManP/man1/loook.1.gz && mkdir -pv $ManP/de/man1/ && gzip man/de/loook.1 > $ManP/de/man1/loook.1.gz && cp -av loook.desktop /usr/share/applications/loook.desktop && cp -av loook.png /usr/share/pixmaps/loook.png echo "You can start loook from the menu." else echo "Python3 isn't installed.\nPlease install first!" fi else echo "You must be root!" fi exit