Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
cloudooo
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ivan Tyagov
cloudooo
Commits
a5157949
Commit
a5157949
authored
Mar 13, 2019
by
Yusei Tahara
2
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Retry connection. NoConnectException sometimes occurs.
parent
3ff2d0a7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
1 deletion
+9
-1
cloudooo/handler/ooo/helper/helper_util.py
cloudooo/handler/ooo/helper/helper_util.py
+9
-1
No files found.
cloudooo/handler/ooo/helper/helper_util.py
View file @
a5157949
import
sys
import
os
import
time
def
getServiceManager
(
host
,
port
,
uno_path
,
office_binary_path
):
"""Get the ServiceManager from the running OpenOffice.org.
...
...
@@ -20,6 +21,13 @@ def getServiceManager(host, port, uno_path, office_binary_path):
uno_context
)
# Connect to the running OpenOffice.org and get its
# context.
uno_connection
=
resolver
.
resolve
(
"uno:socket,host=%s,port=%s;urp;StarOffice.ComponentContext"
%
(
host
,
port
))
# Retry 10 times if needed.
for
i
in
range
(
10
):
try
:
uno_connection
=
resolver
.
resolve
(
"uno:socket,host=%s,port=%s;urp;StarOffice.ComponentContext"
%
(
host
,
port
))
break
except
:
# I don't know how to import com.sun.star.connection.NoConnectException
time
.
sleep
(
1
)
# Get the ServiceManager object
return
uno_connection
.
ServiceManager
Ivan Tyagov
@Tyagov
mentioned in commit
f4d62067
·
Dec 27, 2019
mentioned in commit
f4d62067
mentioned in commit f4d62067727b66b5373d1486b58d69b6c89a45a3
Toggle commit list
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment