archive-com.com » COM » T » TELECOMMUNITY.COM

Total: 388

Choose link from "Titles, links and description words view":

Or switch to "Titles and links view".
  • query - The PEAK Developers' Center
    HelpContents Create this page Alternatively use one of these templates HelpTemplate HomepageTemplate To create you own templates add a page with a name ending in Template EditText of this page FindPage by browsing title search text search or an index

    Original URL path: http://peak.telecommunity.com/DevCenter/query (2016-04-24)
    Open archived version from archive


  • GettingStartedWithPeak - The PEAK Developers' Center
    class library classes reference other classes and modules as part of code A method of a class might create an instance of another class or refer to a module level variable The same thing really These references are impossible to customize without changing source code or massive subclassing and overriding of the methods involved Further if an option is controlled by a module level variable the module can t be shared by components that need different settings for that variable In other words the typical Python class library is not a component It is not configurable and composable with other components because it is a single instance and its connection points are hidden rather than exposed peak binding however makes it ridiculously easy to isolate and expose any dependency as an object attribute that can then be overridden in a variety of ways ranging from simple setattr to constructor keywords to configuration declarations And it introduces the idea of components having context from which they can obtain configuration variables rather than using globals Thus each instance of a component class obtains its configuration and connects to collaborator components via its unique context Since the typical Python library is not usable as a component PEAK s non core frameworks do their best to wrap existing Python facilities up as useful components or offer alternative implementations when there s no way to componentize existing frameworks or tools or existing tools don t meet PEAK requirements Q I have read and understand the concepts in the tutorial Can somebody point me in some direction to start grokking PEAK in it s entirety A Good because the concepts in the tutorial are the most important basics Component hierarchy and bindings are key to nearly every other package in PEAK The key packages to understand

    Original URL path: http://peak.telecommunity.com/DevCenter/GettingStartedWithPeak (2016-04-24)
    Open archived version from archive

  • IntroToPeak - The PEAK Developers' Center
    you re not using a Unix like shell e g Cygwin Bash you ll need to change the command lines used here For example peak foo bar will become something like c Python22 Python exe c Python22 peak foo bar None of the lines will work for you either and to set environment variables like PYTHONPATH you ll need to use SET instead of export and so on Note however that there s nothing Unix specific about the framework or examples and your applications will still run on Windows It s just that the standard Windows shell doesn t offer as many conveniences in these areas If you have trouble running the examples on Windows write up your question on the PEAK mailing list and we ll try to get the examples updated with more Windows specific command lines Non BSD Unix users The lines in this tutorial are written for BSD like Unixes that treat lines as having space separated arguments On other unixes you will need to rewrite the lines to use the invoke program included with PEAK Build and install the invoke program according to the instructions in PEAK s INSTALL txt file and make note of its path You will need to change lines that look like usr bin env peak runIni to read usr local bin invoke peak runIni instead Substituting the correct path to invoke of course invoke doesn t support setting the environment like env does so you ll need to use something like usr local bin invoke env WHATEVER whatever peak whatever if a line needs to set something in the environment Unfortunately some operating systems have extremely limited lengths for lines and you may have to create a shell script and invoke it via invoke in order to get all of the arguments you need For more on this see PEAK s INSTALL txt under Scripts Batch Files and The Lessons LessonOne Commands and Configuration LessonTwo Domain Models and Data Retrieval LessonThree Subcommands and Storing Data LessonFour SQL N2 and peak naming LessonFive Using Logs ToDo Not a lesson just thoughts on future topics open issues etc Changes Also not a lesson a record of changes made to the tutorial Exploring the rest of PEAK One important topic we haven t covered in the lessons above is the component hierarchy although we ve alluded to it on occasion by talking about parent and child components Generally speaking a component contained within another component is a child component of the container and PEAK provides mechanisms for components to access their containers to obtain configuration or other components It s also possible to treat the component hierarchy like a kind of file system using paths to navigate from one component to another As you begin to build more sophisticated applications you ll probably want to have more understanding of how components are attached to their parent components and how they can receive notification that they ve been attached And if you want to

    Original URL path: http://peak.telecommunity.com/DevCenter/IntroToPeak (2016-04-24)
    Open archived version from archive

  • PeakDatabaseApplications - The PEAK Developers' Center
    21 app Application root 22 app run As subclasses of binding Component the Application and Worker classes are capable of taking part in a component hierarchy Such a hierarchy needs a root object at its base we use config makeRoot to create a component root object on line 20 On line 21 we instantiate an Application object specifying that root will be its parent When creating binding Component based objects by hand like this one must always pass a parent object as the first parameter When using bindings within a class definition as done on lines 4 10 and 11 the parent object for the new component will be supplied automatically if needed This small example is already a working database application It opens a connection to a SQLite database file runs a query against a table and prints the results It also demonstrates one of the most useful aspects of the binding package the ability to create an object once and make use of it in another part of the application In database applications you usually want a single connection to a database server which will be shared throughout the application Without binding one would have to either create the connection object and pass it to every new object that needed it or provide it to the rest of the application using a singleton mechanism of some kind The former technique is highly error prone and forces the application to be tightly coupled that is objects need to know quite a bit about each other and are usually highly dependent on each other s interfaces and structure Changing one object in a tightly coupled application often requires changes to a number of other objects and in large applications these inter dependencies are not always known by every programmer or

    Original URL path: http://peak.telecommunity.com/DevCenter/PeakDatabaseApplications (2016-04-24)
    Open archived version from archive

  • ComposingHierarchies - The PEAK Developers' Center
    string 47 48 class ChildCmp binding Component 49 acquired from SimpleCmp 50 cSpam binding Obtain ISpam 51 cStr binding Obtain sc string 52 overrides IEggs provided by SimpleCmp 53 cEggs binding Obtain IEggs 54 eggs binding Make OtherEggs offerAs IEggs 55 56 make a GrandChild child of this component 57 grandChild binding Make GrandChildCmp 58 59 class SimpleCmp binding Component 60 simple component variable Child components can look up directly by name 61 sc string simple c 62 eggs and spam are registered as Interfaces and properties 63 They can be bound either using binding Obtain InterfaceName 64 or binding Obtain PropertyName property name 65 eggs binding Make Eggs offerAs IEggs EGGS PROPERTY 66 spam binding Make Spam offerAs ISpam SPAM PROPERTY 67 color is a Constant bound to a property 68 color binding Make lambda red offerAs COLOR PROPERTY 69 70 make a ChildCmp child of this component 71 child binding Make ChildCmp 72 73 74 if name main 75 76 sc SimpleCmp 77 c sc child 78 gc c grandChild 79 80 81 print c eggs c cEggs eggs 82 print c spam c cSpam spam 83 print c cStr c cStr 84 print gc spam gc gcSpam spam 85 print gc eggs gc gcEggs eggs 86 print gcOther eggs gc gcOtherEggs eggs 87 print gc myColor gc gcColor 88 print gc gcStr gc gcStr 89 print done 3 Running the example Running this example should produce output similar to below joel banzai playground1 python components1 py c eggs othereggs c spam spam c cStr simple c gc spam spam gc eggs eggs gcOther eggs othereggs gc myColor red gc gcStr simple c done Joel Boehland 4 Discussion So it seems to me 1 class SimpleCmp binding Component 2 eggs binding Make Eggs offerAs IEggs EGGS PROPERTY This

    Original URL path: http://peak.telecommunity.com/DevCenter/ComposingHierarchies (2016-04-24)
    Open archived version from archive

  • TwistedPeak - The PEAK Developers' Center
    binding Make lambda 7080 reactor binding Obtain running ITwistedReactor onStart binding Make lambda self self reactor listenTCP self port self server uponAssembly True The Example class is lifted verbatim from the HOWTO Note how the Twisted reactor is obtained in the App class and how the onStart method tells the reactor to listen with the given server object and port number If saved in a file called twistedpeak py this code can be run as follows on Unix Linux systems PYTHONPATH peak import twistedpeak App The example client code from the HOWTO works exactly the same import xmlrpclib s xmlrpclib Server http localhost 7080 s echo lala lala s add 1 2 3 This code can be used as a starting point for any kind of Twisted application Configuration and Binding The code above is slightly longer than the example shown in the HOWTO but because of PEAK s component oriented features especially its configuration and binding facilities it is much more flexible Since commands EventDriven is a descendent of PEAK s base component class the App class is also a component class This primarily means two things instances of it can be located in a hierarchy of other components components can find each other in various ways without needing to know anything about the structure of the application as a whole This promotes loose coupling which can lead to more flexible applications and more reusable code Components can optionally offer their properties for use by other components in the system component objects are easily configurable by various means including external configuration files ini style ZConfig internally via property names and through keyword parameters when directly instantiated A component hierarchy always has a root object In our example the root object is created by the peak script which is installed

    Original URL path: http://peak.telecommunity.com/DevCenter/TwistedPeak (2016-04-24)
    Open archived version from archive

  • ZopePageTemplates - The PEAK Developers' Center
    a PageTemplate adapt to IWebMethod and therefore you can create an attribute on a class and assign it s value a PageTemplateFile you can then use this attribute as view of the WebLocation you currently are This demo is based on the trivial web example from the peak sources It replaces the def index html with a pagetemplate python source zpttest py cgi script zpttest cgi pagetemplate index zpt Ulrich

    Original URL path: http://peak.telecommunity.com/DevCenter/ZopePageTemplates (2016-04-24)
    Open archived version from archive

  • PeakFromBasics - The PEAK Developers' Center
    will be developing is a system monitoring framework It will run on a central server and check a number of other systems for availability At the end of the run a summary report will be produced This description is deliberately vague At this point we don t have all the details of what is required We ll refine the requirements as we go along Also in the longer term there

    Original URL path: http://peak.telecommunity.com/DevCenter/PeakFromBasics (2016-04-24)
    Open archived version from archive



  •