As a web programmer I have a local copy of files and the same files,
stored on server. So I made a button, that allows to upload the files
to server from leo:
from ftplib import FTP
ftp = FTP('host.ru') # connect to host, default port
ftp.login('user', 'pass')
files = [
['d:/www/dubai/modules/file1.pm', 'host.ru/cgi-bin/modules/file1.pm'],
['d:/www/dubai/modules/file2.pm', 'host.ru/cgi-bin/modules/file2.pm'],
]
for file in files:
FH = open(file[0],"rb")
ftp.storbinary('STOR ' + file[1], FH)
FH.close()
ftp.quit()
g.es("Upload complete")
------------------------------------------------------------------------
There is one enhancement, that I don't know how to do myself: I don't
what to upload the files, that weren't changed since the last upload,
so I need some kind of DB table, that will have this structure:
| local file name | server file name | last modify date time |
If last modify has changed, then upload. Now I have this simple DB as
a matrix in code - files array. What is the best way to implement this
feature in python inside leo? I don't think, that Mysql or Oracle
would be good choice for this. :)))
--
You received this message because you are subscribed to the Google Groups
"leo-editor" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/leo-editor?hl=en.