New way of checking for new versions

master
Salvo 'LtWorf' Tomaselli 2013-12-27 00:16:12 +07:00
parent c637890795
commit 5e4a703f56
6 changed files with 105 additions and 83 deletions

@ -2,6 +2,8 @@
- Better tokenizer, gives more indicative errors
- Parser gives more indicative errors
- Improved select_union_intersect_subtract optimization to avoid parenthesis whenever possible
- Moved feedback service, and added the code for it
- Different way of checking the latest version
1.1
- Incorrect relational operations now raise an exception instead of returning None

@ -1,7 +1,7 @@
application: feedback-ltworf
version: 2
version: 1
runtime: python27
api_version: 1
api_version: 3
threadsafe: true
handlers:

@ -9,6 +9,12 @@ application = micro_webapp2.WSGIApplication()
def m(request, *args, **kwargs):
return ""
@application.route("/version/<id>")
def show_version(request, *args, **kwargs):
if kwargs["id"] == "relational":
return "1.2"
return "No version"
@application.route('/feedback/<id>')
def mail_sender(request, *args, **kwargs):

@ -48,21 +48,16 @@ def check_latest_version():
'''Returns the latest version available.
Heavely dependent on server and server configurations
not granted to work forever.'''
connection = httplib.HTTPConnection('galileo.dmi.unict.it')
connection.request("GET","/svn/relational/tags/")
connection = httplib.HTTPConnection('feedback-ltworf.appspot.com')
connection.request("GET","/version/relational")
r=connection.getresponse()
#html
s=r.read()
if len(s)==0:
return None
return s.strip()
l= s[s.find('<ul>')+4:s.find('</ul>')].split('\n')
l.sort()
a=l[len(l)-1]
s=a.find('"')+1
return a[s:a.find('"',s)-1]
class interface (object):
'''It is used to provide services to the user interfaces, in order to
@ -98,4 +93,3 @@ class interface (object):
relname is not None, adds the result to the
dictionary, with the name given in relname.'''
pass

@ -112,6 +112,8 @@ if __name__ == "__main__":
guihandler.version=version
app = QtGui.QApplication(sys.argv)
app.setOrganizationName('None');
app.setApplicationName('relational');
ui = maingui.Ui_MainWindow()
Form = guihandler.relForm(ui)
@ -120,6 +122,7 @@ if __name__ == "__main__":
Form.setFont(QtGui.QFont("Dejavu Sans Bold"))
ui.setupUi(Form)
Form.restore_settings()
for i in range(len(files)):
if not os.path.isfile(files[i]):

@ -16,21 +16,26 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# author Salvo "LtWorf" Tomaselli <tiposchi@tiscali.it>
import sys
import os
import pickle
try:
from PyQt4 import QtCore, QtGui
except:
from PySide import QtCore, QtGui
from relational import relation, parser, optimizer,rtypes
import sys
import about
import survey
import os
import surveyForm
import maingui
import compatibility
class relForm(QtGui.QMainWindow):
def __init__(self,ui):
@ -42,6 +47,9 @@ class relForm(QtGui.QMainWindow):
self.selectedRelation=None
self.ui=ui
self.qcounter=1 #Query counter
self.settings = QtCore.QSettings()
def checkVersion(self):
from relational import maintenance
online=maintenance.check_latest_version()
@ -204,7 +212,16 @@ class relForm(QtGui.QMainWindow):
self.updateRelations()
def closeEvent(self, event):
self.save_settings()
event.accept()
def save_settings(self):
#self.settings.setValue("width",)
pass
def restore_settings(self):
#self.settings.value('session_name','default').toString()
pass
def showSurvey(self):
if self.Survey==None:
@ -214,6 +231,7 @@ class relForm(QtGui.QMainWindow):
ui.setupUi(self.Survey)
self.Survey.setDefaultValues()
self.Survey.show()
def showAbout(self):
if self.About==None:
self.About = QtGui.QDialog()
@ -294,4 +312,3 @@ class relForm(QtGui.QMainWindow):
def addSymbolInQuery(self,symbol):
self.ui.txtQuery.insert(symbol)
self.ui.txtQuery.setFocus()