★ wanayoo — archive 1999 http://noframes.linuxjournal.com/lj-issues/issue73/3882l4.htmlNouvelle recherche | Portail wanayoo
Linux Journal
Main menu  |  Frames site  |  2000 Reader's Choice: vote now!
Linux Journal Home  >  Magazine  >  #73 May 2000  >  Why Python?  >  Listing 4. Code that Calls Metaclass Function
Wednesday, May 10, 2000 | Last Updated 02:58:12 PM


  O'Reilly & Associates

Listing 4. Code that Calls Metaclass Function

# The tricky part--initializing objects from the
# configuration global
# `Configuration' is the top level of the object
# tree we're going to mung
Configuration = Controls()
copy_instance(Configuration, configuration)
Configuration.servers = [];
for server in configuration[`servers']:
Newsite = Server()
copy_instance(Newsite, server)
Configuration.servers.append(Newsite)
Newsite.users = [];
for user in server['users']:
Newuser = User()
copy_instance(Newuser, user)
Newsite.users.append(Newuser)



LINUX JOURNAL: Magazine  |  Free Trial Issue  |  Subscribe!  |  Advertising  |  LJ Store
ABOUT LINUX: How to Get Linux  |  What is Linux?  |  Linux Enterprise
RESOURCES: Help Desk  |  User Groups (GLUE)  |  Career Center  |  Speakers Bureau  |  Special Events  |  Software Wishlist  |  Discussions  |  Links
OTHER LJ SITES: Linux Journal frames site  |  Linux Journal Interactive  |  Linux Gazette  |  Linux Bazaar  |  SSC
MISC: Search  |  Contact Us  |  Top of page