diff -Nru pynagram-0.4.1/bin/pynagram pynagram-0.5.1~lffl~lucid~ppa/bin/pynagram --- pynagram-0.4.1/bin/pynagram 2010-03-25 12:42:26.000000000 +0000 +++ pynagram-0.5.1~lffl~lucid~ppa/bin/pynagram 2010-05-31 12:13:11.000000000 +0100 @@ -21,17 +21,21 @@ # from PyQt4 import QtCore, QtGui +from pynagram.backend import config import sys from pynagram.gui import gui + app = QtGui.QApplication(sys.argv) -pynagram = gui.App() +pynagram_config = config.pynagram_config() +pynagram_config.readconfig() +pynagram = gui.App(config=pynagram_config) +wl = pynagram_config["wordlists"][pynagram_config.setdefault("wordlist", 0)] try: - pynagram.pynagram.read_from_file(sys.path[0] + "/../wordlist/wordlist.txt") + pynagram.pynagram.read_from_file(wl) except IOError: - try: - pynagram.pynagram.read_from_file(sys.path[0] + "/wordlist/wordlist.txt") - except IOError: - pynagram.pynagram.read_from_file(sys.prefix + \ - "/share/pynagram/wordlist.txt") + pynagram_config.writedefault() + pynagram.pynagram.read_from_file(wl) pynagram.init_game() -sys.exit(app.exec_()) +QtGui.qApp = app +app.exec_() +QtGui.qApp = None diff -Nru pynagram-0.4.1/debian/changelog pynagram-0.5.1~lffl~lucid~ppa/debian/changelog --- pynagram-0.4.1/debian/changelog 2010-06-01 14:48:41.000000000 +0100 +++ pynagram-0.5.1~lffl~lucid~ppa/debian/changelog 2010-06-01 14:42:47.000000000 +0100 @@ -1,21 +1,5 @@ -pynagram (0.4.1-1) unstable; urgency=low +pynagram (0.5.1~lffl~lucid~ppa) lucid; urgency=low - * New upstream release: - + Fixed window icon for the main and "About" window (LP: #577874) - + Removed words with characters outside a-z in word list (LP: #569300) + * Initial Release. - -- Umang Varma Thu, 13 May 2010 16:44:30 +0530 - -pynagram (0.4.0-1) unstable; urgency=low - - * New upstream release: - + Fixed window icon for "About" window - + Tweaked back-end: removed unnecessary code while loading word list - - -- Umang Varma Sun, 09 May 2010 20:35:10 +0530 - -pynagram (0.3.4-1) unstable; urgency=low - - * Initial release (Closes: Bug#563920) - - -- Umang Varma Tue, 09 Feb 2010 06:42:15 +0530 + -- Ferramosca Roberto Mon, 31 May 2010 14:55:12 +0200 diff -Nru pynagram-0.4.1/debian/control pynagram-0.5.1~lffl~lucid~ppa/debian/control --- pynagram-0.4.1/debian/control 2010-06-01 14:48:41.000000000 +0100 +++ pynagram-0.5.1~lffl~lucid~ppa/debian/control 2010-06-01 14:42:59.000000000 +0100 @@ -1,7 +1,7 @@ Source: pynagram Section: games Priority: optional -Maintainer: Umang Varma +Maintainer: Ferramosca Roberto Uploaders: Python Applications Packaging Team Build-Depends: debhelper (>= 7.0.50~), python (>= 2.4), python-support (>= 1.0) Standards-Version: 3.8.4 diff -Nru pynagram-0.4.1/debian/copyright pynagram-0.5.1~lffl~lucid~ppa/debian/copyright --- pynagram-0.4.1/debian/copyright 2010-06-01 14:48:41.000000000 +0100 +++ pynagram-0.5.1~lffl~lucid~ppa/debian/copyright 2010-05-28 14:13:39.000000000 +0100 @@ -1,14 +1,20 @@ -This package was debianized by: +This work was packaged for Debian by: - Umang Varma on Fri, 11 Dec 2009 16:25:33 +0530 + Ferramosca Roberto on Fri, 28 May 2010 15:13:37 +0200 It was downloaded from: - http://launchpad.net/pynagram/ + + +Upstream Author(s): + + + Copyright: - Copyright (C) 2009, 2010 Umang Varma + + License: @@ -30,25 +36,15 @@ The Debian packaging is: - Copyright (C) 2009, 2010 Umang Varma + Copyright (C) 2010 Ferramosca Roberto + +# Please chose a license for your packaging work. If the program you package +# uses a mainstream license, using the same license is the safest choice. +# Please avoid to pick license terms that are more restrictive than the +# packaged work, as it may make Debian's contributions unacceptable upstream. +# If you just want it to be GPL version 3, leave the following line in. and is licensed under the GPL version 3, see above. -Pynagram includes a word list which has been compiled using the SCOWL word -list. The word list contains words from the english-words category -upto level 55. Many words from the list have also been deleted, such as words -longer than seven letters, proper nouns, words with apostrophes, etc. The -following copyright notice applies to the word list, as mentioned in the -original package's README file (a copy of which is provided -in /usr/share/doc/pynagram/wordlist-README): - - Copyright 2000-2004 by Kevin Atkinson - - Permission to use, copy, modify, distribute and sell these word - lists, the associated scripts, the output created from the scripts, - and its documentation for any purpose is hereby granted without fee, - provided that the above copyright notice appears in all copies and - that both that copyright notice and this permission notice appear in - supporting documentation. Kevin Atkinson makes no representations - about the suitability of this array for any purpose. It is provided - "as is" without express or implied warranty. +# Please also look if there are files or directories which have a +# different copyright/license attached and list them here. diff -Nru pynagram-0.4.1/PKG-INFO pynagram-0.5.1~lffl~lucid~ppa/PKG-INFO --- pynagram-0.4.1/PKG-INFO 2010-05-11 07:18:07.000000000 +0100 +++ pynagram-0.5.1~lffl~lucid~ppa/PKG-INFO 2010-05-31 14:20:15.000000000 +0100 @@ -1,6 +1,6 @@ Metadata-Version: 1.0 Name: pynagram -Version: 0.4.1 +Version: 0.5.1 Summary: Pynagram - Unjumble the letters and get addicted! Home-page: https://launchpad.net/pynagram Author: Umang Varma diff -Nru pynagram-0.4.1/pynagram/backend/config.py pynagram-0.5.1~lffl~lucid~ppa/pynagram/backend/config.py --- pynagram-0.4.1/pynagram/backend/config.py 1970-01-01 01:00:00.000000000 +0100 +++ pynagram-0.5.1~lffl~lucid~ppa/pynagram/backend/config.py 2010-05-31 12:13:11.000000000 +0100 @@ -0,0 +1,112 @@ +#! /usr/bin/python +# +# config.py +# +# Copyright (c) 2010 Umang Varma . +# +# This file is part of Pynagram +# +# Pynagram 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 +# (at your option) any later version. +# +# Pynagram 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 Pynagram. If not, see . +# +import sys +import os.path +from os import environ +try: + import json +except ImportError: + import simplejson as json +class pynagram_config(dict): + """Handles all configuration actions: read, write, defaults, etc""" + + def __init__(self): + dict.__init__(self) + self.changed = False + + def readconfig(self): + """Reads configuration file and returns a dict with data""" + try: + fsock = open(self.pathtoconfig() + "config.txt") + except IOError: + self.writedefault() + fsock = open(self.pathtoconfig() + "config.txt") + configdata = fsock.read() + fsock.close() + try: + data = json.loads(configdata) + except json.JSONDecodeError: + writedefault() + data = json.loads(configdata) + self.clear() + self.update(data) + self.setdefault("wordlist", 0) + if not self["wordlists"]: + self.adddefaultwl() + self.writeconfig() + + def writeconfig(self): + """Writes configuration data provided by the data dict""" + try: + fsock = open(os.path.join(self.pathtoconfig(),"config.txt"), "w") + except IOError: + self.createdir() + fsock = open(os.path.join(self.pathtoconfig(),"config.txt"), "w") + self["wordlists"] = [os.path.normpath(x) for x in self["wordlists"]] + fsock.write(json.dumps(self, indent=4)) + fsock.close() + + def getdefaultwl(self): + """Returns the default wordlist""" + tries = [[sys.path[0] + "/../wordlist/wordlist.txt", sys.path[0] + \ + "/wordlist/wordlist.txt", sys.prefix + \ + "/share/pynagram/wordlist.txt"]] + # A list of list of possible wordlists. Each nested list contains + # similar wordlists, only one of which will be used. If a wordlist is + # different, it needs to be placed in a separate list. e.g : + # [['a1', 'a2', 'a3'], ['b'], ['c']] when a1, a2, a3 are similar + # wordlists found in different locations and b, c are distinct + wordlists = [] + for source in tries: + for path in source: + if os.path.exists(path): + wordlists.append(path) + break + return wordlists + raise IOError("No wordlist found in any of the expected locations") + + def adddefaultwl(self): + """Adds the default wordlists""" + self.setdefault("wordlists", []).extend(self.getdefaultwl()) + + def writedefault(self): + """Writes default config file""" + self.clear() + self.adddefaultwl() + self.writeconfig() + + def pathtoconfig(self): + """Returns path to configuration file""" + if sys.platform == 'win32': + appdata = os.path.join(environ['APPDATA'], "Pynagram") + else: + appdata = os.path.expanduser(os.path.join("~", ".pynagram/")) + return appdata + + def createdir(self): + """Creates the config directory if it doesn't already exist""" + try: + os.mkdir(self.pathtoconfig()) + except OSError: + print self.pathtoconfig() + " already exists. Writing defaults" + pass # directory already exists + diff -Nru pynagram-0.4.1/pynagram/gui/about.ui pynagram-0.5.1~lffl~lucid~ppa/pynagram/gui/about.ui --- pynagram-0.4.1/pynagram/gui/about.ui 1970-01-01 01:00:00.000000000 +0100 +++ pynagram-0.5.1~lffl~lucid~ppa/pynagram/gui/about.ui 2010-05-31 14:20:10.000000000 +0100 @@ -0,0 +1,82 @@ + + + About + + + + 0 + 0 + 526 + 474 + + + + About Pynagram + + + + + 320 + 430 + 181 + 34 + + + + QDialogButtonBox::Ok + + + + + + 20 + 20 + 491 + 391 + + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'Sans'; font-size:10pt; font-weight:400; font-style:normal;"> +<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:16pt; font-weight:600;">Pynagram 0.5.1 (r58)</span></p> +<p align="center" style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:16pt; font-weight:600;"></p> +<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:11pt;">Copyright (c) 2009, 2010 Umang Varma. </span></p> +<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a href="https://launchpad.net/pynagram"><span style=" text-decoration: underline; color:#0000ff;">Pynagram on Launchpad</span></a></p> +<p align="center" style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:11pt;"></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Pynagram is free software: you can redistribute it and/or modify</p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">it under the terms of the GNU General Public License as published by</p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">the Free Software Foundation, either version 3 of the License, or</p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">(at your option) any later version.</p> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Pynagram is distributed in the hope that it will be useful,</p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">but WITHOUT ANY WARRANTY; without even the implied warranty of</p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the</p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">GNU General Public License for more details.</p> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">You should have received a copy of the GNU General Public License</p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">along with Pynagram. If not, see <a href="http://www.gnu.org/licenses/"><span style=" text-decoration: underline; color:#0000ff;">http://www.gnu.org/licenses/</span></a>.</p></body></html> + + + + + + + buttonBox + clicked(QAbstractButton*) + About + close() + + + 410 + 446 + + + 262 + 236 + + + + + diff -Nru pynagram-0.4.1/pynagram/gui/About.ui pynagram-0.5.1~lffl~lucid~ppa/pynagram/gui/About.ui --- pynagram-0.4.1/pynagram/gui/About.ui 2010-05-11 07:10:58.000000000 +0100 +++ pynagram-0.5.1~lffl~lucid~ppa/pynagram/gui/About.ui 1970-01-01 01:00:00.000000000 +0100 @@ -1,82 +0,0 @@ - - - About - - - - 0 - 0 - 526 - 474 - - - - About Pynagram - - - - - 320 - 430 - 181 - 34 - - - - QDialogButtonBox::Ok - - - - - - 20 - 20 - 491 - 391 - - - - <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> -<html><head><meta name="qrichtext" content="1" /><style type="text/css"> -p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'Sans'; font-size:10pt; font-weight:400; font-style:normal;"> -<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:16pt; font-weight:600;">Pynagram 0.4.1 (r52)</span></p> -<p align="center" style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:16pt; font-weight:600;"></p> -<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:11pt;">Copyright (c) 2009, 2010 Umang Varma. </span></p> -<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a href="https://launchpad.net/pynagram"><span style=" text-decoration: underline; color:#0000ff;">Pynagram on Launchpad</span></a></p> -<p align="center" style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:11pt;"></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Pynagram is free software: you can redistribute it and/or modify</p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">it under the terms of the GNU General Public License as published by</p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">the Free Software Foundation, either version 3 of the License, or</p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">(at your option) any later version.</p> -<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Pynagram is distributed in the hope that it will be useful,</p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">but WITHOUT ANY WARRANTY; without even the implied warranty of</p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the</p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">GNU General Public License for more details.</p> -<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">You should have received a copy of the GNU General Public License</p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">along with Pynagram. If not, see <a href="http://www.gnu.org/licenses/"><span style=" text-decoration: underline; color:#0000ff;">http://www.gnu.org/licenses/</span></a>.</p></body></html> - - - - - - - buttonBox - clicked(QAbstractButton*) - About - close() - - - 410 - 446 - - - 262 - 236 - - - - - diff -Nru pynagram-0.4.1/pynagram/gui/gui.py pynagram-0.5.1~lffl~lucid~ppa/pynagram/gui/gui.py --- pynagram-0.4.1/pynagram/gui/gui.py 2010-05-10 13:22:49.000000000 +0100 +++ pynagram-0.5.1~lffl~lucid~ppa/pynagram/gui/gui.py 2010-05-31 12:51:32.000000000 +0100 @@ -23,6 +23,7 @@ from PyQt4 import QtCore, QtGui from qt_struct import Ui_MainWindow from qt_about import Ui_About +from qt_wl import Ui_Wordlists import random import time @@ -33,24 +34,80 @@ class About(QtGui.QDialog): """This class is the About Dialog""" - def __init__(self, parent=None): + def __init__(self, parent=None, icon=None): QtGui.QWidget.__init__(self, parent) self.ui = Ui_About() self.ui.setupUi(self) - wind_icon = QtGui.QIcon() - wind_icon.addFile('icons/pixmaps/pynagram.xpm') - wind_icon.addFile('/usr/share/pixmaps/pynagram.xpm') + wind_icon = icon or QtGui.QIcon() self.setWindowIcon(wind_icon) def start(self): self.show() +class Wordlists(QtGui.QDialog, Ui_Wordlists): + """This class is the Word lists Dialog""" + + def __init__(self, parent=None, icon=None, config=None): + self.config = config + QtGui.QWidget.__init__(self, parent) + self.setupUi(self) + wind_icon = icon or QtGui.QIcon() + self.setWindowIcon(wind_icon) + # + QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL("accepted()"), \ + self.saveconfig) + QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL("rejected()"), \ + self.cancelconfig) + # + self.wls.__class__.dragEnterEvent = self.dragEnterEvent + self.wls.__class__.dragMoveEvent = self.dragEnterEvent + self.wls.__class__.dropEvent = self.drop + self.readfromconfig() + # + + def saveconfig(self): + self.config["wordlist"] = self.wls.currentRow() + self.config.writeconfig() + self.config.changed = True + self.close() + + def cancelconfig(self): + self.config.readconfig() + self.close() + + def dragEnterEvent(self, event): + if (event.mimeData().hasFormat("text/uri-list") or + event.mimeData().hasFormat("text/plain")): + event.accept() + else: + event.reject() + + def drop(self, event): + data = event.mimeData() + if data.hasFormat("text/uri-list"): + self.config["wordlists"].extend( \ + [str(x.path()) for x in data.urls()]) + self.readfromconfig() + elif data.hasFormat("text/plain"): + path = "%s/wl%d.txt"%(self.config.pathtoconfig(), time.time()) + fsock = open(path , "w") + fsock.write(data.text()) + fsock.close() + self.config["wordlists"].append(path) + self.readfromconfig() + + def readfromconfig(self): + self.wls.clear() + self.wls.addItems(self.config["wordlists"]) + self.wls.setCurrentRow(self.config["wordlist"]) + class App(QtGui.QMainWindow): """This class handles the GUI.""" - def __init__(self, parent=None): + def __init__(self, parent=None, config=None): """Initializes the code for the GUI""" self.pynagram = anagram.Anagram() + self.config = config self.typed = [] self.available_letters = [] self.widgets = {} @@ -66,10 +123,10 @@ QtGui.QWidget.__init__(self, parent) self.ui = Ui_MainWindow() self.ui.setupUi(self) - wind_icon = QtGui.QIcon() - wind_icon.addFile('/usr/share/pixmaps/pynagram.xpm') - wind_icon.addFile('icons/pixmaps/pynagram.xpm') - self.setWindowIcon(wind_icon) + self.wind_icon = QtGui.QIcon() + self.wind_icon.addFile('/usr/share/pixmaps/pynagram.xpm') + self.wind_icon.addFile('icons/pixmaps/pynagram.xpm') + self.setWindowIcon(self.wind_icon) # QtCore.QObject.connect(self.ui.actionSolve, \ QtCore.SIGNAL("activated()"), self.actionSolve_activate) @@ -77,6 +134,8 @@ QtCore.SIGNAL("activated()"), self.actionNew_activate) QtCore.QObject.connect(self.ui.actionAbout, \ QtCore.SIGNAL("activated()"), self.actionAbout_activate) + QtCore.QObject.connect(self.ui.actionWordlists, \ + QtCore.SIGNAL("activated()"), self.actionWordlists_activate) QtCore.QObject.connect(self.timer, QtCore.SIGNAL("timeout()"), \ self.__update_status_bar) QtCore.QObject.connect(self.shuffle_timer, QtCore.SIGNAL("timeout()"),\ @@ -90,6 +149,7 @@ self.last_word = "" self.typed = [] self.show() + random.shuffle(self.available_letters) self.time_started = time.time() self.__reflect_letters() self.__update_words() @@ -154,9 +214,21 @@ self.init_game() def actionAbout_activate(self): - w_about = About() + w_about = About(icon=self.wind_icon) w_about.exec_() + def actionWordlists_activate(self): + self.config.changed = False + w_wl = Wordlists(icon = self.wind_icon, config = self.config) + w_wl.exec_() + self.config.readconfig() # Reverts any unsaved config + if self.config.changed: + self.config.changed = False + wl = self.config["wordlists"][self.config.setdefault("wordlist", 0)] + self.pynagram.read_from_file(wl) + self.pynagram.qualified = False + self.actionNew_activate() + def actionSolve_activate(self): self.available_letters.extend(self.typed) self.typed = [] diff -Nru pynagram-0.4.1/pynagram/gui/mainwindow.ui pynagram-0.5.1~lffl~lucid~ppa/pynagram/gui/mainwindow.ui --- pynagram-0.4.1/pynagram/gui/mainwindow.ui 1970-01-01 01:00:00.000000000 +0100 +++ pynagram-0.5.1~lffl~lucid~ppa/pynagram/gui/mainwindow.ui 2010-05-31 12:13:11.000000000 +0100 @@ -0,0 +1,191 @@ + + + MainWindow + + + + 0 + 0 + 437 + 205 + + + + + 0 + 0 + + + + Pynagram + + + + + + + + Sans Serif + 24 + + + + ABCDEFG + + + Qt::AlignCenter + + + + + + + Last Word: + + + Qt::AlignCenter + + + + + + + Something + + + + + + + Something + + + + + + + Something + + + + + + + Something + + + + + + + Something + + + + + + + + Sans Serif + 24 + + + + TUVWXYZ + + + Qt::AlignCenter + + + + + + + + + 0 + 0 + 437 + 24 + + + + + &Game + + + + + + + + + + + + &Help + + + + + + + + + + About + + + + + New + + + Ctrl+N + + + + + Solve + + + Ctrl+L + + + + + Quit + + + Ctrl+Q + + + + + Word Lists + + + Ctrl+O + + + + + + + actionQuit + activated() + MainWindow + close() + + + -1 + -1 + + + 233 + 133 + + + + + diff -Nru pynagram-0.4.1/pynagram/gui/qt_about.py pynagram-0.5.1~lffl~lucid~ppa/pynagram/gui/qt_about.py --- pynagram-0.4.1/pynagram/gui/qt_about.py 2010-05-11 07:18:05.000000000 +0100 +++ pynagram-0.5.1~lffl~lucid~ppa/pynagram/gui/qt_about.py 2010-05-31 14:20:12.000000000 +0100 @@ -1,9 +1,9 @@ # -*- coding: utf-8 -*- -# Form implementation generated from reading ui file 'About.ui' +# Form implementation generated from reading ui file 'about.ui' # -# Created: Tue May 11 11:48:05 2010 -# by: PyQt4 UI code generator 4.6 +# Created: Mon May 31 18:50:12 2010 +# by: PyQt4 UI code generator 4.7.3 # # WARNING! All changes made in this file will be lost! @@ -31,7 +31,7 @@ "\n" -"

Pynagram 0.4.1 (r52)

\n" +"

Pynagram 0.5.1 (r58)

\n" "

\n" "

Copyright (c) 2009, 2010 Umang Varma.

\n" "

Pynagram on Launchpad

\n" diff -Nru pynagram-0.4.1/pynagram/gui/qt_struct.py pynagram-0.5.1~lffl~lucid~ppa/pynagram/gui/qt_struct.py --- pynagram-0.4.1/pynagram/gui/qt_struct.py 2009-12-15 14:12:14.000000000 +0000 +++ pynagram-0.5.1~lffl~lucid~ppa/pynagram/gui/qt_struct.py 2010-05-31 12:13:11.000000000 +0100 @@ -1,9 +1,9 @@ # -*- coding: utf-8 -*- -# Form implementation generated from reading ui file 'Qt.ui' +# Form implementation generated from reading ui file 'mainwindow.ui' # -# Created: Tue Dec 15 19:42:14 2009 -# by: PyQt4 UI code generator 4.6 +# Created: Mon May 31 16:40:59 2010 +# by: PyQt4 UI code generator 4.7.3 # # WARNING! All changes made in this file will be lost! @@ -12,7 +12,7 @@ class Ui_MainWindow(object): def setupUi(self, MainWindow): MainWindow.setObjectName("MainWindow") - MainWindow.resize(392, 198) + MainWindow.resize(437, 205) sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) @@ -59,7 +59,7 @@ self.gridLayout.addWidget(self.l_typed, 1, 0, 1, 5) MainWindow.setCentralWidget(self.centralwidget) self.menubar = QtGui.QMenuBar(MainWindow) - self.menubar.setGeometry(QtCore.QRect(0, 0, 392, 25)) + self.menubar.setGeometry(QtCore.QRect(0, 0, 437, 24)) self.menubar.setObjectName("menubar") self.menuGame = QtGui.QMenu(self.menubar) self.menuGame.setObjectName("menuGame") @@ -77,9 +77,13 @@ self.actionSolve.setObjectName("actionSolve") self.actionQuit = QtGui.QAction(MainWindow) self.actionQuit.setObjectName("actionQuit") + self.actionWordlists = QtGui.QAction(MainWindow) + self.actionWordlists.setObjectName("actionWordlists") self.menuGame.addAction(self.actionNew) self.menuGame.addAction(self.actionSolve) self.menuGame.addSeparator() + self.menuGame.addAction(self.actionWordlists) + self.menuGame.addSeparator() self.menuGame.addAction(self.actionQuit) self.menuGame.addSeparator() self.menuHelp.addAction(self.actionAbout) @@ -109,4 +113,6 @@ self.actionSolve.setShortcut(QtGui.QApplication.translate("MainWindow", "Ctrl+L", None, QtGui.QApplication.UnicodeUTF8)) self.actionQuit.setText(QtGui.QApplication.translate("MainWindow", "Quit", None, QtGui.QApplication.UnicodeUTF8)) self.actionQuit.setShortcut(QtGui.QApplication.translate("MainWindow", "Ctrl+Q", None, QtGui.QApplication.UnicodeUTF8)) + self.actionWordlists.setText(QtGui.QApplication.translate("MainWindow", "Word Lists", None, QtGui.QApplication.UnicodeUTF8)) + self.actionWordlists.setShortcut(QtGui.QApplication.translate("MainWindow", "Ctrl+O", None, QtGui.QApplication.UnicodeUTF8)) diff -Nru pynagram-0.4.1/pynagram/gui/Qt.ui pynagram-0.5.1~lffl~lucid~ppa/pynagram/gui/Qt.ui --- pynagram-0.4.1/pynagram/gui/Qt.ui 2009-12-15 14:11:33.000000000 +0000 +++ pynagram-0.5.1~lffl~lucid~ppa/pynagram/gui/Qt.ui 1970-01-01 01:00:00.000000000 +0100 @@ -1,181 +0,0 @@ - - - MainWindow - - - - 0 - 0 - 392 - 198 - - - - - 0 - 0 - - - - Pynagram - - - - - - - - Sans Serif - 24 - - - - ABCDEFG - - - Qt::AlignCenter - - - - - - - Last Word: - - - Qt::AlignCenter - - - - - - - Something - - - - - - - Something - - - - - - - Something - - - - - - - Something - - - - - - - Something - - - - - - - - Sans Serif - 24 - - - - TUVWXYZ - - - Qt::AlignCenter - - - - - - - - - 0 - 0 - 392 - 25 - - - - - &Game - - - - - - - - - - &Help - - - - - - - - - - About - - - - - New - - - Ctrl+N - - - - - Solve - - - Ctrl+L - - - - - Quit - - - Ctrl+Q - - - - - - - actionQuit - activated() - MainWindow - close() - - - -1 - -1 - - - 233 - 133 - - - - - diff -Nru pynagram-0.4.1/pynagram/gui/qt_wl.py pynagram-0.5.1~lffl~lucid~ppa/pynagram/gui/qt_wl.py --- pynagram-0.4.1/pynagram/gui/qt_wl.py 1970-01-01 01:00:00.000000000 +0100 +++ pynagram-0.5.1~lffl~lucid~ppa/pynagram/gui/qt_wl.py 2010-05-31 13:01:22.000000000 +0100 @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- + +# Form implementation generated from reading ui file 'wordlists.ui' +# +# Created: Mon May 31 17:31:22 2010 +# by: PyQt4 UI code generator 4.7.3 +# +# WARNING! All changes made in this file will be lost! + +from PyQt4 import QtCore, QtGui + +class Ui_Wordlists(object): + def setupUi(self, Wordlists): + Wordlists.setObjectName("Wordlists") + Wordlists.setWindowModality(QtCore.Qt.ApplicationModal) + Wordlists.resize(535, 358) + Wordlists.setModal(True) + self.verticalLayoutWidget = QtGui.QWidget(Wordlists) + self.verticalLayoutWidget.setGeometry(QtCore.QRect(10, 10, 511, 331)) + self.verticalLayoutWidget.setObjectName("verticalLayoutWidget") + self.verticalLayout = QtGui.QVBoxLayout(self.verticalLayoutWidget) + self.verticalLayout.setObjectName("verticalLayout") + self.horizontalLayout = QtGui.QHBoxLayout() + self.horizontalLayout.setObjectName("horizontalLayout") + self.wls = QtGui.QListWidget(self.verticalLayoutWidget) + self.wls.setAcceptDrops(True) + self.wls.setObjectName("wls") + self.horizontalLayout.addWidget(self.wls) + self.buttonBox = QtGui.QDialogButtonBox(self.verticalLayoutWidget) + self.buttonBox.setOrientation(QtCore.Qt.Vertical) + self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Save) + self.buttonBox.setCenterButtons(True) + self.buttonBox.setObjectName("buttonBox") + self.horizontalLayout.addWidget(self.buttonBox) + self.verticalLayout.addLayout(self.horizontalLayout) + self.label = QtGui.QLabel(self.verticalLayoutWidget) + self.label.setWordWrap(True) + self.label.setObjectName("label") + self.verticalLayout.addWidget(self.label) + + self.retranslateUi(Wordlists) + QtCore.QMetaObject.connectSlotsByName(Wordlists) + + def retranslateUi(self, Wordlists): + Wordlists.setWindowTitle(QtGui.QApplication.translate("Wordlists", "Word Lists", None, QtGui.QApplication.UnicodeUTF8)) + self.label.setText(QtGui.QApplication.translate("Wordlists", "\n" +"\n" +"

You may drag and drop text from a text-editor or file(s) from a file browser onto the word list selector above to add word lists.

\n" +"

\n" +"

Click \'Save\' to save your settings and start a new game.

", None, QtGui.QApplication.UnicodeUTF8)) + diff -Nru pynagram-0.4.1/pynagram/gui/wordlists.ui pynagram-0.5.1~lffl~lucid~ppa/pynagram/gui/wordlists.ui --- pynagram-0.4.1/pynagram/gui/wordlists.ui 1970-01-01 01:00:00.000000000 +0100 +++ pynagram-0.5.1~lffl~lucid~ppa/pynagram/gui/wordlists.ui 2010-05-31 13:01:15.000000000 +0100 @@ -0,0 +1,77 @@ + + + Wordlists + + + Qt::ApplicationModal + + + + 0 + 0 + 535 + 358 + + + + Word Lists + + + true + + + + + 10 + 10 + 511 + 331 + + + + + + + + + true + + + + + + + Qt::Vertical + + + QDialogButtonBox::Cancel|QDialogButtonBox::Save + + + true + + + + + + + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'Sans'; font-size:10pt; font-weight:400; font-style:normal;"> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">You may drag and drop text from a <span style=" font-style:italic;">text-editor</span> or file(s) from a <span style=" font-style:italic;">file browser</span> onto the word list selector above to add word lists.</p> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Click '<span style=" text-decoration: underline;">S</span>ave' to save your settings and start a new game.</p></body></html> + + + true + + + + + + + + + diff -Nru pynagram-0.4.1/pynagram.sh pynagram-0.5.1~lffl~lucid~ppa/pynagram.sh --- pynagram-0.4.1/pynagram.sh 2010-02-03 14:30:29.000000000 +0000 +++ pynagram-0.5.1~lffl~lucid~ppa/pynagram.sh 2010-05-31 12:13:11.000000000 +0100 @@ -1,3 +1,3 @@ #!/bin/sh APPPATH=`dirname $0` -PYTHONPATH="$PYTHONPATH:$APPPATH" exec $APPPATH/bin/pynagram $* +PYTHONPATH="$PYTHONPATH:$APPPATH" exec python2.6 $APPPATH/bin/pynagram $* diff -Nru pynagram-0.4.1/setup.py pynagram-0.5.1~lffl~lucid~ppa/setup.py --- pynagram-0.4.1/setup.py 2010-05-11 07:10:09.000000000 +0100 +++ pynagram-0.5.1~lffl~lucid~ppa/setup.py 2010-05-31 14:18:51.000000000 +0100 @@ -24,7 +24,7 @@ #import py2exe r = setup(name= "pynagram", - version= "0.4.1", + version= "0.5.1", description= "Pynagram - Unjumble the letters and get addicted!", author= "Umang Varma", author_email= "umang.me@gmail.com",