Skip to content

Commit c1c419f

Browse files
committed
Update an outdated part in the top page
1 parent 7a04560 commit c1c419f

File tree

3 files changed

+44
-3
lines changed

3 files changed

+44
-3
lines changed

docs-src/index.rst

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,30 @@ Of course, you can always pull the source code directly into your project:
4848
.. code-block:: bash
4949
5050
git clone https://github.com/slackapi/python-slackclient.git
51-
pip install -r requirements.txt
51+
52+
And then, save a few lines of code as ``./test.py``.
53+
54+
.. code-block:: python
55+
56+
# test.py
57+
import sys
58+
# Load the local source directly
59+
sys.path.insert(1, "./python-slackclient")
60+
# Enable debug logging
61+
import logging
62+
logging.basicConfig(level=logging.DEBUG)
63+
# Verify it works
64+
from slack import WebClient
65+
client = WebClient()
66+
api_response = client.api_test()
67+
68+
You can run the code this way.
69+
70+
.. code-block:: bash
71+
72+
python test.py
73+
74+
It's also good to try on the Python REPL.
5275

5376
Getting Help
5477
************

docs/index.html

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,9 +258,27 @@ <h2>Installation<a class="headerlink" href="#installation" title="Permalink to t
258258
</div>
259259
<p>Of course, you can always pull the source code directly into your project:</p>
260260
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>git clone https://github.com/slackapi/python-slackclient.git
261-
pip install -r requirements.txt
262261
</pre></div>
263262
</div>
263+
<p>And then, save a few lines of code as <code class="docutils literal notranslate"><span class="pre">./test.py</span></code>.</p>
264+
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="c1"># test.py</span>
265+
<span class="kn">import</span> <span class="nn">sys</span>
266+
<span class="c1"># Load the local source directly</span>
267+
<span class="n">sys</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">insert</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="s2">&quot;./python-slackclient&quot;</span><span class="p">)</span>
268+
<span class="c1"># Enable debug logging</span>
269+
<span class="kn">import</span> <span class="nn">logging</span>
270+
<span class="n">logging</span><span class="o">.</span><span class="n">basicConfig</span><span class="p">(</span><span class="n">level</span><span class="o">=</span><span class="n">logging</span><span class="o">.</span><span class="n">DEBUG</span><span class="p">)</span>
271+
<span class="c1"># Verify it works</span>
272+
<span class="kn">from</span> <span class="nn">slack</span> <span class="kn">import</span> <span class="n">WebClient</span>
273+
<span class="n">client</span> <span class="o">=</span> <span class="n">WebClient</span><span class="p">()</span>
274+
<span class="n">api_response</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="n">api_test</span><span class="p">()</span>
275+
</pre></div>
276+
</div>
277+
<p>You can run the code this way.</p>
278+
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>python test.py
279+
</pre></div>
280+
</div>
281+
<p>It’s also good to try on the Python REPL.</p>
264282
</div>
265283
<div class="section" id="getting-help">
266284
<h2>Getting Help<a class="headerlink" href="#getting-help" title="Permalink to this headline"></a></h2>

0 commit comments

Comments
 (0)