Your english is very poor, at a guess, you're looking for something
that will give you a database dump (backup).

        @turbogears.expose()
        def retrieve_backup(self, key):
                """ Retrieves a database backup if the key provided is
correct """
                if key != '8dj3jjfhd8':
                        return

                fh = os.popen("pg_dump my_database | gzip","r")
                now = datetime.now()
                cherrypy.response.headerMap["Content-Type"] =
"application/x-download"
                cherrypy.response.headerMap["Content-disposition"] =
"attachment; filename=my-database-export_%d-%02d-%02d.psql.gz" %
(now.year, now.month, now.day)
                data = fh.read(4096)
                while data:
                        yield data
                        data = fh.read(4069)
                fh.close()
                return


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears" 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/turbogears
-~----------~----~----~----~------~----~------~--~---

Reply via email to