From 913a304d359b2e29cecec2df47886657fcbf3e08 Mon Sep 17 00:00:00 2001 From: LtWorf Date: Wed, 25 Jan 2012 15:46:11 +0000 Subject: [PATCH] - can import * - starting a common code to remove duplication in interfaces git-svn-id: http://galileo.dmi.unict.it/svn/relational/trunk@344 014f5005-505e-4b48-8d0a-63407b615a7c --- relational/__init__.py | 11 +++++++++++ relational/maintenance.py | 39 ++++++++++++++++++++++++++++++++++++++- 2 files changed, 49 insertions(+), 1 deletion(-) diff --git a/relational/__init__.py b/relational/__init__.py index e69de29..69a4487 100644 --- a/relational/__init__.py +++ b/relational/__init__.py @@ -0,0 +1,11 @@ +__all__ = ( + +"relation" +"parser" +"optimizer" +"optimizations" +"rtypes" +"parallel" + + +) diff --git a/relational/maintenance.py b/relational/maintenance.py index f55fae4..4a14194 100644 --- a/relational/maintenance.py +++ b/relational/maintenance.py @@ -21,6 +21,7 @@ import httplib import urllib +import relation def send_survey(data): '''Sends the survey. Data must be a dictionary. @@ -56,4 +57,40 @@ def check_latest_version(): a=l[len(l)-1] s=a.find('"')+1 - return a[s:a.find('"',s)-1] \ No newline at end of file + return a[s:a.find('"',s)-1] + +class interface (Object): + '''It is used to provide services to the user interfaces, in order to + reduce the amount of duplicated code present in different user interfaces. + ''' + + def __init__(self): + self.rels= {} + + def load(self,filename,name): + '''Loads a relation from file, and gives it a name to + be used in subsequent queries.''' + pass + + def unload(self,name): + '''Unloads an existing relation.''' + pass + + def store(self,filename,name): + '''Stores a relation to file.''' + pass + + def get_relation(self,name): + '''Returns the relation corresponding to name.''' + pass + + def set_relation(self,name,rel): + '''Sets the relation corresponding to name.''' + pass + + def execute(self,query,relname='last_'): + '''Executes a query, returns the result and if + relname is not None, adds the result to the + dictionary, with the name given in relname.''' + pass + \ No newline at end of file