[C++-sig] Two Pyste suggestions

Niall Douglas s_sourceforge at nedprod.com
Mon Sep 29 18:52:14 CEST 2003


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Yeah, more ideas!

The first is a bit radical. I've organised the policies for my 
project into a python package called "Policies". Within it is a .py 
file for every class in my library and within each of those is an 
apply() method.

In the pyste files, each class imports its policy from 
Policies.<classname> and calls Policies.<classname>.apply(). This in 
turn imports the policy .py files for each of the base classes the 
class inherits from and calls their apply() methods first before 
setting its own policies for its own local class. Thus you see a 
change to a base class automatically propagates through the policy 
hierarchy.

Now my suggestion is that since pyste knows what classes any class 
inherits, it could spit out the import's and apply()'s for each 
policy for class. It would save some work (I've already done it 
manually, wish I'd thought of it sooner).

The second suggestion was as I made last time, a --files parameter to 
specify a file from which to read the list of pyste files as Win2k 
has a 2Kb limit. I've attached the pyste.py file for an example.

Cheers,
Niall





-----BEGIN PGP SIGNATURE-----
Version: idw's PGP-Frontend 4.9.6.1 / 9-2003 + PGP 8.0.2

iQA/AwUBP3hjPsEcvDLFGKbPEQJanACg8exEBe66enOWYGcMeMEAh1bXbF4An1QO
BYYW2KwFEC8mV+ITYUtJAKxz
=4Y4o
-----END PGP SIGNATURE-----




More information about the Cplusplus-sig mailing list