1 |
#Author: Harald Holzer |
2 |
(harald.holzer@eunet.at) |
3 |
#5.4.2000: initial release |
4 |
|
5 |
import hfaxlib |
6 |
import string |
7 |
|
8 |
class hylafaxutil: |
9 |
_public_methods_ = ["connect","job_new","job_select","job_kill","job_delete","job_param_getall","job_param_get","job_param_set","getfolder","storefile","retrfile","deletefile","jobparam","submitjob","docmd","close","setdebuginfo"] |
10 |
_reg_progid_ = "pythonutils.hylafaxutil" |
11 |
_reg_clsid_ = "{243E9E30-0702-11D4-8088-005004EFAAEE}" |
12 |
faxserv=hfaxlib.hfax() |
13 |
|
14 |
def connect(self,host,user,pw): |
15 |
return self.faxserv.connect(str(host),str(user),str(pw)) |
16 |
|
17 |
def job_new(self): |
18 |
return self.faxserv.job_new() |
19 |
def job_select(self,jobid): |
20 |
self.faxserv.job_select(jobid) |
21 |
def job_kill(self): |
22 |
self.faxserv.job_kill() |
23 |
def job_delete(self): |
24 |
self.faxserv.job_delete() |
25 |
def job_param_getall(self): |
26 |
return self.faxserv.job_param_getall() |
27 |
def job_param_get(self,pname): |
28 |
return self.faxserv.job_param_get(str(pname)) |
29 |
def job_param_set(self,pname,pvalue): |
30 |
self.faxserv.job_param_set(str(pname),str(pvalue)) |
31 |
|
32 |
def getfolder(self,folder): |
33 |
folder=str(folder) |
34 |
data=self.faxserv.getfolder(folder) |
35 |
if not data: data="None" |
36 |
return data |
37 |
|
38 |
def storefile(self,filename): |
39 |
return self.faxserv.storefile(str(filename)) |
40 |
|
41 |
def retrfile(self,filename,tmpfilename): |
42 |
self.faxserv.retrfile(str(filename),str(tmpfilename)) |
43 |
|
44 |
def deletefile(self,filename): |
45 |
self.faxserv.deletefile(str(filename)) |
46 |
|
47 |
def jobparam(self,param): |
48 |
return self.faxserv.jobparam(str(param)) |
49 |
|
50 |
def submitjob(self): |
51 |
return self.faxserv.submitjob() |
52 |
|
53 |
def docmd(self,cmd): |
54 |
return self.faxserv.docmd(str(cmd)) |
55 |
|
56 |
def close(self): |
57 |
self.faxserv.close() |
58 |
|
59 |
def setdebuginfo(self,dbglevel,logfile): |
60 |
self.faxserv.setdebuginfo(dbglevel,str(logfile)) |
61 |
|
62 |
if __name__=="__main__": |
63 |
print "Registering COM Server..." |
64 |
import win32com.server.register |
65 |
win32com.server.register.UseCommandLine(hylafaxutil) |
66 |
|