log2zulip: use a Zulip virtualenv if available.
This makes it easier to use log2zulip in a Zulip server environment.
This commit is contained in:
parent
515471549e
commit
ede820c9e3
|
@ -1,16 +1,25 @@
|
|||
#!/usr/bin/env python
|
||||
from __future__ import print_function
|
||||
import subprocess
|
||||
import os
|
||||
import sys
|
||||
import shutil
|
||||
|
||||
import errno
|
||||
import json
|
||||
import ujson
|
||||
import os
|
||||
import platform
|
||||
import re
|
||||
import sys
|
||||
import shutil
|
||||
import subprocess
|
||||
import traceback
|
||||
|
||||
try:
|
||||
# Use the Zulip virtualenv if available
|
||||
sys.path.append(os.path.join(os.path.dirname(__file__), ".."))
|
||||
import scripts.lib.setup_path_on_import
|
||||
except ImportError:
|
||||
pass
|
||||
|
||||
import json
|
||||
import ujson
|
||||
|
||||
sys.path.insert(0, os.path.join(os.path.dirname(__file__), "../api"))
|
||||
import zulip
|
||||
|
||||
|
|
Loading…
Reference in a new issue