~ubuntu-branches/ubuntu/maverick/freecad/maverick

« back to all changes in this revision

Viewing changes to src/Tools/generateTemplates/templateClassPyExport.py

  • Committer: Bazaar Package Importer
  • Author(s): Adam C. Powell, IV
  • Date: 2010-01-11 08:48:33 UTC
  • mfrom: (3.1.3 sid)
  • Revision ID: james.westby@ubuntu.com-20100111084833-4g9vgdqbkw8u34zb
Tags: 0.9.2646.5-1
* New upstream version (closes: #561696).
* Added swig to Build-Depends (closes: #563523, #563772).
* Removed python-opencv from Build-Depends and Recommends (closes: #560768).

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
 
31
31
#include <@self.export.FatherInclude@>
32
32
#include <@self.export.Include@>
 
33
#include <string>
33
34
 
34
35
namespace @self.export.Namespace@
35
36
{
62
63
    typedef @self.export.TwinPointer@* PointerType ;
63
64
 
64
65
    virtual PyObject *_repr(void);        // the representation
65
 
    const char *representation(void) const;
 
66
    std::string representation(void) const;
66
67
 
67
68
    /** @name callbacks and implementers for the python object methods */
68
69
    //@{
431
432
//--------------------------------------------------------------------------
432
433
PyObject *@self.export.Name@::_repr(void)
433
434
{
434
 
    return Py_BuildValue("s", representation());
 
435
    return Py_BuildValue("s", representation().c_str());
435
436
}
436
437
 
437
438
+ if(self.export.CustomAttributes != None):
582
583
-
583
584
 
584
585
// returns a string which represents the object e.g. when printed in python
585
 
const char *@self.export.Name@::representation(void) const
 
586
std::string @self.export.Name@::representation(void) const
586
587
{
587
 
    return "<@self.export.Twin@ object>";
 
588
    return std::string("<@self.export.Twin@ object>");
588
589
}
589
590
+ for i in self.export.Methode:
590
591
 
618
619
 
619
620
Py::@i.Parameter.Type@ @self.export.Name@::get@i.Name@(void) const
620
621
{
621
 
    return Py::@i.Parameter.Type@();
 
622
    //return Py::@i.Parameter.Type@();
 
623
    throw Py::AttributeError("Not yet implemented");
622
624
}
623
625
+ if (i.ReadOnly):
624
626
= else:
625
627
 
626
628
void  @self.export.Name@::set@i.Name@(Py::@i.Parameter.Type@ arg)
627
629
{
628
 
 
 
630
    throw Py::AttributeError("Not yet implemented");
629
631
}
630
632
-
631
633
-
659
661
using namespace @self.export.Namespace@;
660
662
 
661
663
// returns a string which represents the object e.g. when printed in python
662
 
const char *@self.export.Name@::representation(void) const
 
664
std::string @self.export.Name@::representation(void) const
663
665
{
664
 
    return "<@self.export.Twin@ object>";
 
666
    return std::string("<@self.export.Twin@ object>");
665
667
}
666
668
 
667
669
+ if (self.export.Constructor):
711
713
 
712
714
Py::@i.Parameter.Type@ @self.export.Name@::get@i.Name@(void) const
713
715
{
714
 
    return Py::@i.Parameter.Type@();
 
716
    //return Py::@i.Parameter.Type@();
 
717
    throw Py::AttributeError("Not yet implemented");
715
718
}
716
719
+ if (i.ReadOnly):
717
720
= else:
718
721
 
719
722
void @self.export.Name@::set@i.Name@(Py::@i.Parameter.Type@ /*arg*/)
720
723
{
721
 
 
 
724
    throw Py::AttributeError("Not yet implemented");
722
725
}
723
726
-
724
727
-