hallo,
hier eine nachbildung in der python idle,
Code: Alles auswählen
#!/usr/bin/env python
# -*- coding: utf-8 -*-
##general import
import pp
class ImportFiles():
def __init__(self, parent,
argKonfiguration
):
self.MainApp = parent
self.DebugLevel=12
self.Konfiguration = argKonfiguration
self.PvLst = []
self.IOLst = []
def create_path_list(self):
job_server = pp.Server()
job_server.submit((self.write_path), (self, 0, len(self.IOLst)))
job_server.wait()
def write_path(self, start, end):
print 'writepath'
for k in range(start, end):
for Pv in self.PvLst:
if Pv[0] == self.IOLst[k][0]:
print 'extend IO: ' + self.IOLst[k][0]
self.IOLst[k].append(Pv[1])
############################################################################
# Local call for testing
############################################################################
if __name__ == "__main__":
print 'start tc'
konfig=[12,1,2]
importedfiles=ImportFiles('none', konfig)
importedfiles.IOLst = [['IO-Name1','Typ','DescLong', 'DescShort'],
['IO-Name2','Typ','DescLong', 'DescShort'],
['IO-Name3','Typ','DescLong', 'DescShort'],
['IO-Name4','Typ','DescLong', 'DescShort']]
importedfiles.PvLst = [['IO-Name1', 'Parameter1', 'Parameter2'],
['IO-Name2', 'Parameter1', 'Parameter2'],
['IO-Name3', 'Parameter1', 'Parameter2'],
['IO-Name4', 'Parameter1', 'Parameter2'],
['IO-Name5', 'Parameter1', 'Parameter2']]
print 'start create_path_list'
importedfiles.create_path_list()
print importedfiles.IOLst
print 'done tc'
und der traceback dazu:
Code: Alles auswählen
start tc
start create_path_list
Traceback (most recent call last):
File "C:\Grillo\parallelpython.py", line 49, in <module>
importedfiles.create_path_list()
File "C:\Grillo\parallelpython.py", line 20, in create_path_list
job_server.submit((self.write_path), (self, 0, len(self.IOLst)))
File "C:\Python25\Lib\site-packages\pp.py", line 395, in submit
sfunc = self.__dumpsfunc((func,)+depfuncs, modules)
File "C:\Python25\Lib\site-packages\pp.py", line 582, in __dumpsfunc
sources = [self.__get_source(func) for func in funcs]
File "C:\Python25\Lib\site-packages\pp.py", line 660, in __get_source
sourcelines = inspect.getsourcelines(func)[0]
File "C:\Python25\lib\inspect.py", line 618, in getsourcelines
lines, lnum = findsource(object)
File "C:\Python25\lib\inspect.py", line 494, in findsource
raise IOError('could not find class definition')
IOError: could not find class definition