HCE Project Python language Distributed Tasks Manager Application, Distributed Crawler Application and client API bindings.
2.0.0-chaika
Hierarchical Cluster Engine Python language binding
Main Page
Related Pages
+
Namespaces
Namespace List
+
Namespace Members
+
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
+
Functions
_
a
b
c
d
e
f
g
i
j
l
m
o
p
r
s
t
u
v
w
+
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
+
Classes
Class List
Class Index
Class Hierarchy
+
Class Members
+
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
+
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
x
+
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
+
Files
File List
▼
HCE Project Python language Distributed Tasks Manager Application, Distributed Crawler Application and client API bindings.
►
HCE project, Python bindings, Distributed Tasks Manager application, Distributed Crawler service.
Todo List
►
Namespaces
►
Classes
▼
Files
►
File List
•
All
Classes
Namespaces
Files
Functions
Variables
Pages
processor-task.py
Go to the documentation of this file.
1
#!/usr/bin/python
2
3
4
"""
5
HCE project, Python bindings, Distributed Tasks Manager application.
6
Event objects definitions.
7
8
@package: dc
9
@file processor-task.py
10
@author Oleksii, bgv <developers.hce@gmail.com>
11
@link: http://hierarchical-cluster-engine.com/
12
@copyright: Copyright © 2013-2014 IOIX Ukraine
13
@license: http://hierarchical-cluster-engine.com/license/
14
@since: 0.1
15
"""
16
17
import
ppath
18
from
ppath
import
sys
19
20
# For profiling
21
import
app.Profiler
as
Profiler
22
23
24
# Start profiling
25
pr = Profiler.Profiler()
26
if
pr
and
pr.status > 0:
27
pr.start()
28
29
30
import
os
31
import
sys
32
from
dc_processor.ProcessorTask
import
ProcessorTask
33
from
dc_processor.Scraper
import
EXIT_SUCCESS
34
from
dc_processor.Scraper
import
EXIT_FAILURE
35
import
app.Consts
as
APP_CONSTS
36
37
38
# That script create main application
39
40
app =
None
41
exit_code = EXIT_SUCCESS
42
43
try
:
44
# create the app
45
app =
ProcessorTask
()
46
# setup the application
47
app.setup()
48
# add support command line arguments
49
app.args.add_argument(
'-c'
,
'--config'
, action=
'store'
, metavar=
'config_file'
, help=
'config ini-file'
, required=
True
)
50
# run the application
51
app.run()
52
53
exit_code = app.getExitCode()
54
55
# log message about profiler
56
if
pr.errorMsg
and
app.logger:
57
app.logger.error(pr.errorMsg)
58
59
except
Exception, err:
60
sys.stderr.write(str(err) +
'\n'
)
61
exit_code = EXIT_FAILURE
62
except
:
63
exit_code = EXIT_FAILURE
64
finally
:
65
# stop profiling
66
if
pr:
67
pr.stop()
68
# close the app
69
if
app:
70
app.close()
71
72
sys.stdout.flush()
73
os._exit(exit_code)
dc_processor.ProcessorTask
Definition:
ProcessorTask.py:1
dc_processor.Scraper
Definition:
Scraper.py:1
dc_processor.ProcessorTask.ProcessorTask
Definition:
ProcessorTask.py:126
app.Consts
Definition:
Consts.py:1
app.Profiler
Definition:
Profiler.py:1
sources
bin
processor-task.py
Generated on Fri Nov 24 2017 18:53:53 for HCE Project Python language Distributed Tasks Manager Application, Distributed Crawler Application and client API bindings. by
1.8.13