-
Notifications
You must be signed in to change notification settings - Fork 3
/
bpworker.py
61 lines (55 loc) · 1.72 KB
/
bpworker.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#!/usr/bin/env python
# bpworker.py
#
# Copyright (C) 2008 Veselin Penev, https://bitdust.io
#
# This file (bpworker.py) is part of BitDust Software.
#
# BitDust is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# BitDust Software is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with BitDust Software. If not, see <http://www.gnu.org/licenses/>.
#
# Please contact us if you have any questions at bitdust.io@gmail.com
#
#
#
#
from __future__ import absolute_import
import sys
import os
import six
import platform
_Debug = False
ostype = platform.uname()[0]
if ostype == 'Windows':
if six.PY3:
sys.stdout = sys.stdout.buffer
else:
try:
import msvcrt
msvcrt.setmode(1, os.O_BINARY) # @UndefinedVariable
msvcrt.setmode(2, os.O_BINARY) # @UndefinedVariable
except:
pass
else:
if six.PY3:
sys.stdout = sys.stdout.buffer
if __name__ == '__main__':
try:
sys.path.append(os.path.abspath(os.path.join('.', 'parallelp', 'pp')))
from bitdust_forks.parallelp.pp.ppworker import _WorkerProcess
wp = _WorkerProcess()
wp.run()
except Exception as exc:
if _Debug:
import traceback
open('/tmp/raid.log', 'a').write(traceback.format_exc())