Back to index

python-biopython  1.60
Public Member Functions
Bio.Restriction._Update.Update.RebaseUpdate Class Reference
Inheritance diagram for Bio.Restriction._Update.Update.RebaseUpdate:
Inheritance graph
[legend]
Collaboration diagram for Bio.Restriction._Update.Update.RebaseUpdate:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def __init__
def prompt_user_passwd
def openRebase
def getfiles
def localtime
def update
def __del__

Detailed Description

Definition at line 24 of file Update.py.


Constructor & Destructor Documentation

def Bio.Restriction._Update.Update.RebaseUpdate.__init__ (   self,
  e_mail = '',
  ftpproxy = '' 
)
RebaseUpdate([e_mail[, ftpproxy]]) -> new RebaseUpdate instance.

if e_mail and ftpproxy are not given RebaseUpdate uses the corresponding
variable from RanaConfig.

e_mail is the password for the anonymous ftp connection to Rebase.
ftpproxy is the proxy to use if any.

Definition at line 26 of file Update.py.

00026 
00027     def __init__(self, e_mail='', ftpproxy=''):
00028         """RebaseUpdate([e_mail[, ftpproxy]]) -> new RebaseUpdate instance.
00029 
00030         if e_mail and ftpproxy are not given RebaseUpdate uses the corresponding
00031         variable from RanaConfig.
00032 
00033         e_mail is the password for the anonymous ftp connection to Rebase.
00034         ftpproxy is the proxy to use if any."""
00035         proxy = {'ftp' : ftpproxy or ftp_proxy}
00036         global Rebase_password
00037         Rebase_password = e_mail or Rebase_password
00038         if not Rebase_password:
00039             raise FtpPasswordError('Rebase')
00040         if not Rebase_name:
00041             raise FtpNameError('Rebase')
00042         FancyURLopener.__init__(self, proxy)

Definition at line 78 of file Update.py.

00078 
00079     def __del__(self):
00080         if hasattr(self, 'tmpcache') : self.close()
00081         #
00082         #   self.tmpcache is created by URLopener.__init__ method.
00083         #
00084         return
00085 

Here is the call graph for this function:


Member Function Documentation

Definition at line 54 of file Update.py.

00054 
00055     def getfiles(self, *files):
00056         print '\n',
00057         for file in self.update(*files):
00058             print 'copying', file
00059             fn = os.path.basename(file)
00060             #filename = os.path.join(Rebase, fn)
00061             filename = os.path.join(os.getcwd(), fn)
00062             print 'to', filename
00063             self.retrieve(file, filename)
00064         self.close()
00065         return

Here is the call graph for this function:

Definition at line 66 of file Update.py.

00066 
00067     def localtime(self):
00068         t = time.gmtime()
00069         year = str(t.tm_year)[-1]
00070         month = str(t.tm_mon)
00071         if len(month) == 1 : month = '0'+month
00072         return year+month

Here is the caller graph for this function:

def Bio.Restriction._Update.Update.RebaseUpdate.openRebase (   self,
  name = ftp_Rebase 
)

Definition at line 46 of file Update.py.

00046 
00047     def openRebase(self, name = ftp_Rebase):
00048         print '\n Please wait, trying to connect to Rebase\n'
00049         try:
00050             self.open(name)
00051         except:
00052             raise ConnectionError('Rebase')
00053         return

Here is the call graph for this function:

Definition at line 43 of file Update.py.

00043 
00044     def prompt_user_passwd(self, host, realm):
00045         return (Rebase_name, Rebase_password)

Definition at line 73 of file Update.py.

00073 
00074     def update(self, *files):
00075         if not files:
00076             files = [ftp_emb_e, ftp_emb_s, ftp_emb_r]
00077         return [x.replace('###', self.localtime()) for x in files]

Here is the call graph for this function:

Here is the caller graph for this function:


The documentation for this class was generated from the following file: