api: Add script to print path of examples directory.
Partially fixes
MODIFY
zulip/setup.py
zulip/setup.py
@@ -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]

ADD
zulip/zulip/api_examples.py
+#!/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()

api: Add script to print path of examples directory.

Partially fixes #92.