| 688 | |
| 689 | |
| 690 | def start_customshape(self, args): |
| 691 | #loads one |
| 692 | path = self._arg('customshape',args,'path') |
| 693 | if path=='None': |
| 694 | path = [] |
| 695 | else: |
| 696 | path=[path] |
| 697 | |
| 698 | # add package root folder and input file's folder to path |
| 699 | path.append(os.path.dirname(self.sourceFilename)) |
| 700 | path.append(os.path.dirname(pythonpoint.__file__)) |
| 701 | |
| 702 | modulename = self._arg('customshape',args,'module') |
| 703 | funcname = self._arg('customshape',args,'class') |
| 704 | try: |
| 705 | found = imp.find_module(modulename, path) |
| 706 | (file, pathname, description) = found |
| 707 | mod = imp.load_module(modulename, file, pathname, description) |
| 708 | except ImportError: |
| 709 | mod = getModule(modulename) |
| 710 | |
| 711 | #now get the function |
| 712 | |
| 713 | func = getattr(mod, funcname) |
| 714 | initargs = self.ceval('customshape',args,'initargs') |
| 715 | self._curCustomShape = apply(func, initargs) |
| 716 | |
| 717 | def end_customshape(self): |
| 718 | if self._curSlide: |