From 2f044b44bdd3e4f39c5138478808319a668b7c0e Mon Sep 17 00:00:00 2001 From: derAnfaenger Date: Tue, 12 Sep 2017 18:08:35 +0200 Subject: [PATCH] zulip: Move examples to zulip/examples. --- zulip/MANIFEST.in | 18 ++++++------- zulip/README.md | 2 +- zulip/setup.py | 26 +++++++++---------- zulip/zulip/__init__.py | 18 ++++++------- zulip/{ => zulip}/examples/create-user | 0 zulip/{ => zulip}/examples/edit-message | 0 zulip/{ => zulip}/examples/get-presence | 0 zulip/{ => zulip}/examples/get-public-streams | 0 zulip/{ => zulip}/examples/list-members | 0 zulip/{ => zulip}/examples/list-subscriptions | 0 zulip/{ => zulip}/examples/print-events | 0 zulip/{ => zulip}/examples/print-messages | 0 zulip/{ => zulip}/examples/recent-messages | 0 zulip/{ => zulip}/examples/send-message | 0 zulip/{ => zulip}/examples/subscribe | 0 zulip/{ => zulip}/examples/unsubscribe | 0 zulip/{ => zulip}/examples/upload-file | 0 zulip/{ => zulip}/examples/zuliprc | 0 18 files changed, 32 insertions(+), 32 deletions(-) rename zulip/{ => zulip}/examples/create-user (100%) rename zulip/{ => zulip}/examples/edit-message (100%) rename zulip/{ => zulip}/examples/get-presence (100%) rename zulip/{ => zulip}/examples/get-public-streams (100%) rename zulip/{ => zulip}/examples/list-members (100%) rename zulip/{ => zulip}/examples/list-subscriptions (100%) rename zulip/{ => zulip}/examples/print-events (100%) rename zulip/{ => zulip}/examples/print-messages (100%) rename zulip/{ => zulip}/examples/recent-messages (100%) rename zulip/{ => zulip}/examples/send-message (100%) rename zulip/{ => zulip}/examples/subscribe (100%) rename zulip/{ => zulip}/examples/unsubscribe (100%) rename zulip/{ => zulip}/examples/upload-file (100%) rename zulip/{ => zulip}/examples/zuliprc (100%) diff --git a/zulip/MANIFEST.in b/zulip/MANIFEST.in index fca2900..92e4b52 100644 --- a/zulip/MANIFEST.in +++ b/zulip/MANIFEST.in @@ -1,11 +1,11 @@ recursive-include integrations * include README.md -include examples/zuliprc -include examples/send-message -include examples/subscribe -include examples/get-public-streams -include examples/unsubscribe -include examples/list-members -include examples/list-subscriptions -include examples/print-messages -include examples/recent-messages +include zulip/examples/zuliprc +include zulip/examples/send-message +include zulip/examples/subscribe +include zulip/examples/get-public-streams +include zulip/examples/unsubscribe +include zulip/examples/list-members +include zulip/examples/list-subscriptions +include zulip/examples/print-messages +include zulip/examples/recent-messages diff --git a/zulip/README.md b/zulip/README.md index cffd204..3331c97 100644 --- a/zulip/README.md +++ b/zulip/README.md @@ -21,7 +21,7 @@ please make sure we know you're using them so that we can notify you as we make any changes to them. The easiest way to use these API bindings is to base your tools off -of the example tools under examples/ in this distribution. +of the example tools under zulip/examples/ in this distribution. If you place your API key in the config file `~/.zuliprc` the Python API bindings will automatically read it in. The format of the config diff --git a/zulip/setup.py b/zulip/setup.py index c8b860f..8fccfba 100755 --- a/zulip/setup.py +++ b/zulip/setup.py @@ -42,19 +42,19 @@ package_info = dict( ], url='https://www.zulip.org/', data_files=[('examples', - ["examples/zuliprc", - "examples/create-user", - "examples/edit-message", - "examples/get-presence", - "examples/get-public-streams", - "examples/list-members", - "examples/list-subscriptions", - "examples/print-events", - "examples/print-messages", - "examples/recent-messages", - "examples/send-message", - "examples/subscribe", - "examples/unsubscribe", + ["zulip/examples/zuliprc", + "zulip/examples/create-user", + "zulip/examples/edit-message", + "zulip/examples/get-presence", + "zulip/examples/get-public-streams", + "zulip/examples/list-members", + "zulip/examples/list-subscriptions", + "zulip/examples/print-events", + "zulip/examples/print-messages", + "zulip/examples/recent-messages", + "zulip/examples/send-message", + "zulip/examples/subscribe", + "zulip/examples/unsubscribe", ])] + list(recur_expand('share/zulip', 'integrations')), entry_points={ 'console_scripts': [ diff --git a/zulip/zulip/__init__.py b/zulip/zulip/__init__.py index 2b4d6fd..350ab02 100644 --- a/zulip/zulip/__init__.py +++ b/zulip/zulip/__init__.py @@ -612,7 +612,7 @@ class Client(object): def send_message(self, message_data): # type: (Dict[str, Any]) -> Dict[str, Any] ''' - See api/examples/send-message for example usage. + See examples/send-message for example usage. ''' return self.call_endpoint( url='messages', @@ -622,7 +622,7 @@ class Client(object): def upload_file(self, file): # type: (IO) -> Dict[str, Any] ''' - See api/examples/upload-file for example usage. + See examples/upload-file for example usage. ''' return self.call_endpoint( url='user_uploads', @@ -632,7 +632,7 @@ class Client(object): def update_message(self, message_data): # type: (Dict[str, Any]) -> Dict[str, Any] ''' - See api/examples/edit-message for example usage. + See examples/edit-message for example usage. ''' return self.call_endpoint( url='messages/%d' % (message_data['message_id'],), @@ -728,7 +728,7 @@ class Client(object): def get_streams(self, **request): # type: (**Any) -> Dict[str, Any] ''' - See api/examples/get-public-streams for example usage. + See examples/get-public-streams for example usage. ''' return self.call_endpoint( url='streams', @@ -739,7 +739,7 @@ class Client(object): def get_members(self, request=None): # type: (Dict[str, Any]) -> Dict[str, Any] ''' - See api/examples/list-members for example usage. + See examples/list-members for example usage. ''' return self.call_endpoint( url='users', @@ -750,7 +750,7 @@ class Client(object): def list_subscriptions(self, request=None): # type: (Dict[str, Any]) -> Dict[str, Any] ''' - See api/examples/list-subscriptions for example usage. + See examples/list-subscriptions for example usage. ''' return self.call_endpoint( url='users/me/subscriptions', @@ -761,7 +761,7 @@ class Client(object): def add_subscriptions(self, streams, **kwargs): # type: (Iterable[Dict[str, Any]], **Any) -> Dict[str, Any] ''' - See api/examples/subscribe for example usage. + See examples/subscribe for example usage. ''' request = dict( subscriptions=streams, @@ -776,7 +776,7 @@ class Client(object): def remove_subscriptions(self, streams): # type: (Iterable[str]) -> Dict[str, Any] ''' - See api/examples/unsubscribe for example usage. + See examples/unsubscribe for example usage. ''' request = dict(delete=streams) return self.call_endpoint( @@ -832,7 +832,7 @@ class Client(object): def create_user(self, request=None): # type: (Dict[str, Any]) -> Dict[str, Any] ''' - See api/examples/create-user for example usage. + See examples/create-user for example usage. ''' return self.call_endpoint( method='POST', diff --git a/zulip/examples/create-user b/zulip/zulip/examples/create-user similarity index 100% rename from zulip/examples/create-user rename to zulip/zulip/examples/create-user diff --git a/zulip/examples/edit-message b/zulip/zulip/examples/edit-message similarity index 100% rename from zulip/examples/edit-message rename to zulip/zulip/examples/edit-message diff --git a/zulip/examples/get-presence b/zulip/zulip/examples/get-presence similarity index 100% rename from zulip/examples/get-presence rename to zulip/zulip/examples/get-presence diff --git a/zulip/examples/get-public-streams b/zulip/zulip/examples/get-public-streams similarity index 100% rename from zulip/examples/get-public-streams rename to zulip/zulip/examples/get-public-streams diff --git a/zulip/examples/list-members b/zulip/zulip/examples/list-members similarity index 100% rename from zulip/examples/list-members rename to zulip/zulip/examples/list-members diff --git a/zulip/examples/list-subscriptions b/zulip/zulip/examples/list-subscriptions similarity index 100% rename from zulip/examples/list-subscriptions rename to zulip/zulip/examples/list-subscriptions diff --git a/zulip/examples/print-events b/zulip/zulip/examples/print-events similarity index 100% rename from zulip/examples/print-events rename to zulip/zulip/examples/print-events diff --git a/zulip/examples/print-messages b/zulip/zulip/examples/print-messages similarity index 100% rename from zulip/examples/print-messages rename to zulip/zulip/examples/print-messages diff --git a/zulip/examples/recent-messages b/zulip/zulip/examples/recent-messages similarity index 100% rename from zulip/examples/recent-messages rename to zulip/zulip/examples/recent-messages diff --git a/zulip/examples/send-message b/zulip/zulip/examples/send-message similarity index 100% rename from zulip/examples/send-message rename to zulip/zulip/examples/send-message diff --git a/zulip/examples/subscribe b/zulip/zulip/examples/subscribe similarity index 100% rename from zulip/examples/subscribe rename to zulip/zulip/examples/subscribe diff --git a/zulip/examples/unsubscribe b/zulip/zulip/examples/unsubscribe similarity index 100% rename from zulip/examples/unsubscribe rename to zulip/zulip/examples/unsubscribe diff --git a/zulip/examples/upload-file b/zulip/zulip/examples/upload-file similarity index 100% rename from zulip/examples/upload-file rename to zulip/zulip/examples/upload-file diff --git a/zulip/examples/zuliprc b/zulip/zulip/examples/zuliprc similarity index 100% rename from zulip/examples/zuliprc rename to zulip/zulip/examples/zuliprc