- Upgraded manpage
- Can save relations - Better -v printout - Added comments git-svn-id: http://galileo.dmi.unict.it/svn/relational/trunk@236 014f5005-505e-4b48-8d0a-63407b615a7c
This commit is contained in:
parent
a608581a33
commit
f4d47a01e9
16
relational.1
16
relational.1
@ -3,13 +3,11 @@
|
|||||||
relational \(em Python implementation of Relational algebra.
|
relational \(em Python implementation of Relational algebra.
|
||||||
.SH "SYNOPSIS"
|
.SH "SYNOPSIS"
|
||||||
.PP
|
.PP
|
||||||
\fBrelational\fR [\-v\fR\fP]
|
\fBrelational\fR [OPTIONS\fR\fP] [ FILE .\|.\|.]
|
||||||
.br
|
|
||||||
\fBrelational\fR [ FILE .\|.\|.]
|
|
||||||
|
|
||||||
.SH "DESCRIPTION"
|
.SH "DESCRIPTION"
|
||||||
.PP
|
.PP
|
||||||
Python implementation of Relational algebra. This program provides a GUI to execute relational algebra queries. It is meant to be used for educational purposes.
|
Python implementation of Relational algebra. This program provides an UI to execute relational algebra queries. It is meant to be used for educational purposes.
|
||||||
|
|
||||||
.SH "OPTIONS"
|
.SH "OPTIONS"
|
||||||
.PP
|
.PP
|
||||||
@ -19,6 +17,15 @@ options is included below. However, the ordering is very strict \-
|
|||||||
.IP "\fB-v\fP
|
.IP "\fB-v\fP
|
||||||
Show version information.
|
Show version information.
|
||||||
|
|
||||||
|
.IP "\fB-h\fP
|
||||||
|
Shows help.
|
||||||
|
|
||||||
|
.IP "\fB-q\fP
|
||||||
|
Using the Qt4 GUI (default).
|
||||||
|
|
||||||
|
.IP "\fB-r\fP
|
||||||
|
Uses the readline UI.
|
||||||
|
|
||||||
.SH "AUTHOR"
|
.SH "AUTHOR"
|
||||||
.PP
|
.PP
|
||||||
This manual page was written by Salvo 'LtWorf' Tomaselli <tiposchi@tiscali.it> for
|
This manual page was written by Salvo 'LtWorf' Tomaselli <tiposchi@tiscali.it> for
|
||||||
@ -26,4 +33,3 @@ the \fBDebian GNU/Linux\fP system (but may be used by others). Permission is
|
|||||||
granted to copy, distribute and/or modify this document under
|
granted to copy, distribute and/or modify this document under
|
||||||
the terms of the GNU General Public License
|
the terms of the GNU General Public License
|
||||||
version 3 or any later version published by the Free Software Foundation.
|
version 3 or any later version published by the Free Software Foundation.
|
||||||
.\" created by instant / docbook-to-man, Fri 10 Oct 2008, 19:02
|
|
||||||
|
@ -27,15 +27,20 @@ from relational import relation, parser
|
|||||||
version="0.11"
|
version="0.11"
|
||||||
|
|
||||||
|
|
||||||
def printver():
|
def printver(exit=True):
|
||||||
print "Relational"
|
print "Relational %s" % version
|
||||||
|
print "Copyright (C) 2008 Salvo 'LtWorf' Tomaselli."
|
||||||
|
print
|
||||||
print "This program comes with ABSOLUTELY NO WARRANTY."
|
print "This program comes with ABSOLUTELY NO WARRANTY."
|
||||||
print "This is free software, and you are welcome to redistribute it"
|
print "This is free software, and you are welcome to redistribute it"
|
||||||
print "under certain conditions."
|
print "under certain conditions."
|
||||||
print "For details see the GPLv3 Licese."
|
print "For details see the GPLv3 Licese."
|
||||||
print
|
print
|
||||||
print "Version: %s"%version
|
print "Written by Salvo 'LtWorf' Tomaselli <tiposchi@tiscali.it>"
|
||||||
sys.exit(0)
|
print
|
||||||
|
print "http://galileo.dmi.unict.it/wiki/relational/doku.php"
|
||||||
|
if exit:
|
||||||
|
sys.exit(0)
|
||||||
|
|
||||||
def printhelp(code=0):
|
def printhelp(code=0):
|
||||||
print "Relational"
|
print "Relational"
|
||||||
@ -105,6 +110,7 @@ if __name__ == "__main__":
|
|||||||
Form.show()
|
Form.show()
|
||||||
sys.exit(app.exec_())
|
sys.exit(app.exec_())
|
||||||
else:
|
else:
|
||||||
|
printver(False)
|
||||||
import relational_readline.linegui
|
import relational_readline.linegui
|
||||||
relational_readline.linegui.main(files)
|
relational_readline.linegui.main(files)
|
||||||
|
|
||||||
|
@ -178,9 +178,25 @@ def exec_line(command):
|
|||||||
else:
|
else:
|
||||||
print "No such relation %s" % pars[1]
|
print "No such relation %s" % pars[1]
|
||||||
pass
|
pass
|
||||||
#elif command=='SAVE': //TODO
|
elif command.startswith('SAVE'):
|
||||||
|
pars=command.split(' ')
|
||||||
|
if len(pars)!=3:
|
||||||
|
print "Missing parameter"
|
||||||
|
return
|
||||||
|
|
||||||
|
filename=pars[1]
|
||||||
|
defname=pars[2]
|
||||||
|
|
||||||
|
if defname not in relations:
|
||||||
|
print "No such relation %s" % defname
|
||||||
|
return
|
||||||
|
|
||||||
|
try:
|
||||||
|
relations[defname].save(filename)
|
||||||
|
except Exception,e:
|
||||||
|
print e
|
||||||
else:
|
else:
|
||||||
exec_query( command)
|
exec_query(command)
|
||||||
|
|
||||||
def replacements(query):
|
def replacements(query):
|
||||||
'''This funcion replaces ascii easy operators with the correct ones'''
|
'''This funcion replaces ascii easy operators with the correct ones'''
|
||||||
@ -247,6 +263,8 @@ def exec_query(command):
|
|||||||
print e
|
print e
|
||||||
|
|
||||||
def main(files=[]):
|
def main(files=[]):
|
||||||
|
print "> ; Type HELP to get the HELP"
|
||||||
|
print "> ; Completion is activated using the tab"
|
||||||
|
|
||||||
for i in files:
|
for i in files:
|
||||||
load_relation(i)
|
load_relation(i)
|
||||||
@ -261,7 +279,7 @@ def main(files=[]):
|
|||||||
while True:
|
while True:
|
||||||
try:
|
try:
|
||||||
line = raw_input('> ')
|
line = raw_input('> ')
|
||||||
if isinstance(line,str) and len(line)>0:
|
if isinstance(line,str) and len(line)>0 and not line.startswith(';'):
|
||||||
exec_line(line)
|
exec_line(line)
|
||||||
except EOFError:
|
except EOFError:
|
||||||
print
|
print
|
||||||
|
Loading…
Reference in New Issue
Block a user