Antoine Pitrou <solipsis <at> pitrou.net> writes:

> I don't understand why a zip file makes this easier (especially the
> "update selectively" part).

Not a zip file specifically - just a binary stream which organises scripts to be
installed. If each class in a hierarchy has access to a binary stream, then
subclasses have access to the streams for base classes as well as their own
stream, and can install selectively from base class streams and their own 
stream.

class Base:
    scripts = ... # zip stream containing scripts A, B

    def install_scripts(self, stream):
        # ...

    def setup_scripts(self):
        self.install_scripts(self.scripts)

class Derived:
    scripts = ... # zip stream containing modified script B, new script C

    def setup_scripts(self):
        self.install_scripts(Base.scripts) # adds A, B
        self.install_scripts(self.scripts) # adds C, overwrites B

I'm not saying you couldn't do this with e.g. directory trees; it just seems
neater to have the scripts in a black box once they're deployed, with a zip file
representing that black box.

Regards,

Vinay Sajip


_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to