Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cloudooo
Commits
a5157949
Commit
a5157949
authored
Mar 13, 2019
by
Yusei Tahara
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Retry connection. NoConnectException sometimes occurs.
parent
3ff2d0a7
Changes
1
Show 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.
# 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
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