api: Add script to print path of examples directory.
Partially fixes #92.
This commit is contained in:
parent
ae4bf8bbf4
commit
2f62507987
|
@ -59,6 +59,7 @@ package_info = dict(
|
|||
entry_points={
|
||||
'console_scripts': [
|
||||
'zulip-send=zulip.send:main',
|
||||
'zulip-api-examples=zulip.api_examples:main'
|
||||
],
|
||||
},
|
||||
) # type: Dict[str, Any]
|
||||
|
|
15
zulip/zulip/api_examples.py
Normal file
15
zulip/zulip/api_examples.py
Normal file
|
@ -0,0 +1,15 @@
|
|||
#!/usr/bin/env python
|
||||
import os
|
||||
import zulip
|
||||
|
||||
def main():
|
||||
zulip_path = os.path.abspath(os.path.dirname(zulip.__file__))
|
||||
examples_path = os.path.abspath(os.path.join(zulip_path, 'examples'))
|
||||
if os.path.isdir(examples_path):
|
||||
print(examples_path)
|
||||
else:
|
||||
raise OSError("Examples cannot be accessed at {}: Directory does not exist!"
|
||||
.format(examples_path))
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
Loading…
Reference in a new issue