Git Product home page Git Product logo

gautamkrishnar / socli Goto Github PK

View Code? Open in Web Editor NEW
1.1K 26.0 218.0 817 KB

Stack overflow command line client. Search and browse stack overflow without leaving the terminal :computer:

Home Page: https://pypi.python.org/pypi/socli

License: BSD 3-Clause "New" or "Revised" License

Python 94.86% Roff 5.01% Dockerfile 0.13%
python stackoverflow commandline commandline-interface terminal-app pypi hacktoberfest

socli's Introduction

SoCLI PyPI PyPI Downloads Build Status Gitter Chat

Stack Overflow command line written in python. Using SoCLI you can search and browse Stack Overflow without leaving the terminal. Just use the socli command:

SoCLI in action

Installation

Supported platforms
  • Linux
  • Windows
  • Mac
Requirements
  • Python 3.5 or higher
For Linux

Install python and just use pip command to install socli:

sudo apt-get install python3 python3-pip
pip install socli
For Windows

Download and install Python. Don't forget to check the option "Add to path".

Open a command prompt with administrative privileges and use pip command to install socli:

pip install socli

Use easy_install if your python path has a space in it. Read more: "Failed to create process":

easy_install socli
For Mac/Linux (via homebrew)

Install socli:

brew tap gautamkrishnar/socli
brew install socli
Enabling the shell autocompletion

If you installed socli via pyPi you may need to enable the shell autocompletion. Add the following to your .bashrc file to enable it:

socli --register

Updating

Use the command below to update your existing version of socli to the newest version so that you won't miss any features:

pip install --upgrade socli

If you installed via homebrew:

brew upgrade socli

Usage

Quick Search

Use the socli command followed by the search query:

socli for loop in python syntax

The above command will search for the query "for loop in python syntax" and displays the first most voted question in Stack Overflow with its most voted answer. Pretty quick, right?

Interactive Search

You can search Stack Overflow interactively by using the command below:

socli -iq html error 404

This will display a list of questions from Stack Overflow for the query "html error 404" and it will allow you to choose any of the questions you like interactively. When you choose a question, it will display the complete description of the chosen question with its most voted answer. You can also browse through the other answers to that question using the up and down arrow keys as well as go back to the list of questions using the left arrow key.

Manual Search

This will allow you to specify a requested question number for your query. For example, consider the following command:

socli -r 2 -q javascript prototype function

This command searches for "javascript prototype function" in Stack Overflow and displays the second question that contains it.

Topic-Based Search

Stack Overflow supports topic by using tags. socli allows you to query Stack Overflow based on specific tags. Just specify the tag via the following command:

socli -t javascript -q window.open

You can also specify multiple tags, Just separate them with a comma:

socli -t javascript,node.js -q window.open

See the complete list of tags here.

User Profile Browsing

Just use the command below to set your user ID in socli. When you execute the command next time, it will automatically fetch the data.

socli -u

if your are an extensive user of StackOverflow, socli allows you to set your own API key to overcome the StackOverflow API Limitations. Just use the command below:

socli --api

You can get an API Key here by registering as a new app. Please don't use SoCLI as app name.

Posting a New Question

If you can't find an answer for your question in Stack Overflow, socli allows you to create a new question via the web browser. Just type the command below and socli will open the new question page of Stack Overflow in the web browser for you:

socli -n
Opening a url directly

If you have the url of the Stack Overflow post then you can pass it using --open-url or -o. For example socli --open-url https://stackoverflow.com/questions/20639180/explanation-of-how-nested-list-comprehension-works

Syntax:

socli has the following syntax

Usage: socli [ Arguments] < Search Query >
Arguments (optional)
Short Long Description Example
-q --query Used to specify the query when arguments are used. A query value must be passed to it. If it is used alone (socli -q query) then it will display the same result as socli query. socli -q query
-i --interactive Used to search interactively. It doesn't take any values. It must be followed by a -q or --query after it. socli -i -q query
-r --res Used for manual search. It takes the question number as the argument and it must be followed by a -q or --query after it. socli -r 4 -q query
-t --tag Specifies the tag to search for the query on Stack Overflow. It must be followed by a -q or --query after it. socli -t js -q query
-n --new Opens the web browser to create a new question on Stack Overflow. socli --new
-u --user Displays the user profile informations. If no argument is given, it will display your profile. socli -u 22656
-a --api Sets a custom API key. socli --api
-d --del Deletes the configuration file generated by socli -u manually. socli -d
-s --sosearch SoCLI uses Google search by default to search for questions. To override this and use stackoverflow's default search instead. socli -s -q for loop python
-h --help Displays the help text. socli --help
-o --open-url Displays the given url in socli if possible if not opens in browser. socli -o https://stackoverflow.com/questions/20639180/explanation-of-how-nested-list-comprehension-works
-j --json-output Gives output to stdout as json socli -jq for loop python
-g --register Registers socli's shell autocompletion socli -g
-v --version Displays the version of socli. socli -v
Query

This term refers to what you're searching for in Stack Overflow.

Features

These are the amazing features of SoCLI:

  • Manual Search
  • Interactively browse Stack Overflow using the interactive mode
  • Coloured interface
  • Question stats view
  • Tag support
  • Can open the page in a browser
  • Can view user profiles
  • Can create a new question via the web browser
  • Can open a Stack Overflow page on the terminal directly from a url

To Do

Command line interface for:

  • Stack Overflow authentication
  • Posting to Stack Overflow
  • Upvote answer
  • Comment on an answer
  • Browsing stackoverflow home page

Please check out the list of issues.

Testing

Automated tests are setup by using pytest, the tests can be run locally by invoking a python setup.py test.

All tests are in the socli/tests/ subdirectory of this repository.

TravisCI is supposed to run the test-suite on build.

💥 How to Contribute ?

If you are willing to contribute to SoCLI project, you are awesome! Just follow the steps given in CONTRIBUTING.md 😃

Maintainers

Please reach out to any of the following people if you have any queries:


Gautam krishna R

💻

Hedy Li

💻

Contributors ✨

Thanks goes to these wonderful people (emoji key):

aaxu
aaxu

💻
kilbee
kilbee

💻
Sam Dean
Sam Dean

📖
mwwynne
mwwynne

💻
Carlos J. Puga Medina
Carlos J. Puga Medina

🐛
Jon Ericson
Jon Ericson

💻
Ankit Kr. Singh
Ankit Kr. Singh

💻
Harsha Alva
Harsha Alva

💻
Pia Mancini
Pia Mancini

📖
Aditya Tandon
Aditya Tandon

🐛
Akshatha Nayak
Akshatha Nayak

💻
Liam Hawkins
Liam Hawkins

💻
Arount
Arount

💻
Cédric Picard
Cédric Picard

🐛
Amartya Chaudhuri
Amartya Chaudhuri

💻
Elliott Beach
Elliott Beach

💻
Prashant Chahal
Prashant Chahal

💻
Insiyah Hajoori
Insiyah Hajoori

💻
C
C

💻
Liam Byrne
Liam Byrne

💻
Tran Chi Khang
Tran Chi Khang

💻
Alix Poulsen
Alix Poulsen

📖
albalitz
albalitz

💻
Aniruddha Bhattacharjee
Aniruddha Bhattacharjee

💻
Daniel St.Jacques
Daniel St.Jacques

💻
Donnell Muse
Donnell Muse

💻
JM Lopez
JM Lopez

💻
JOBIN PHILIP ABRAHAM
JOBIN PHILIP ABRAHAM

📖
Jakub Kukul
Jakub Kukul

💻
Pigeon
Pigeon

📖
Rajdeep Biswas
Rajdeep Biswas

💻
Sachin Kukreja
Sachin Kukreja

💻
Simon Reap
Simon Reap

💻
Srisaila
Srisaila

💻
agarwalnishtha
agarwalnishtha

💻
Frederick Kozlowski
Frederick Kozlowski

💻
Esha Lath
Esha Lath

💻
thumpri
thumpri

💻
Adam Zhang
Adam Zhang

💻
prathampowar2001
prathampowar2001

💻
Subhankar Hotta
Subhankar Hotta

💻
ankushduacodes
ankushduacodes

💻
Shriram Bhat
Shriram Bhat

💻
Vjs Pranav
Vjs Pranav

💻
Saif Kazi
Saif Kazi

💻
pstreff
pstreff

💻
anshik1998
anshik1998

💻
abstanton
abstanton

💻
Sabu Siyad
Sabu Siyad

💻
pspiagicw
pspiagicw

💻
Ryan Hertz
Ryan Hertz

💻
tharunc
tharunc

📖
Ananthakrishnan Nair RS
Ananthakrishnan Nair RS

📖
Muthu Annamalai.V
Muthu Annamalai.V

📖
Ayushman
Ayushman

💻
Tushar Nankani
Tushar Nankani

💻
Ikko Ashimine
Ikko Ashimine

📖
Sidharth Ajithkumar
Sidharth Ajithkumar

💻
Sam Sheffres
Sam Sheffres

💻
Rushi Dolas
Rushi Dolas

💻
mostlyvirtual
mostlyvirtual

💻
Artspark
Artspark

💻
Caleb Voorhees
Caleb Voorhees

💻

This project follows the all-contributors specification. Contributions of any kind welcome!

Bugs

If you are experiencing any bugs, don’t forget to open a new issue.

Error Solving

If you encounter "AttributeError: 'module' object has no attribute 'SSL ST INIT'

sudo pip uninstall pyopenssl
sudo pip install pyopenssl or sudo easy_install pyopenssl

Thanks

Sponsors

Sponsor SoCLI on Open Collective:

Liked it?

Hope you liked this project, don't forget to give it a star ⭐

socli's People

Contributors

aaxu avatar abstanton avatar adamjyz avatar aharshac avatar aksh77 avatar alexpoulsen avatar allcontributors[bot] avatar ankushduacodes avatar arount avatar artorias111 avatar deanwombourne avatar elliott-beach avatar gautamkrishnar avatar gkr-bot avatar hedyhli avatar insiyaa avatar jericson avatar liambyrnenz avatar liamhawkins avatar prashantchahal26 avatar pspiagicw avatar rajdeep-biswas avatar saif807380 avatar samsheff avatar sk364 avatar ssiyad avatar suvhotta avatar thevirtuoso1973 avatar tranchikhang avatar uknowwhoim avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

socli's Issues

python 2 interactive mode exits automatically

from the email from @cpu82

Well, it seems that some socli features using interactive mode don't
work with python2, but they do using python3.

E.g. Options like "open in browser" fail to run: if I type 'o' then
socli exits automatically.

Windows: "Failed to create process" when running `socli` without parameters

PS C:\Users\jonas> pip install socli
Requirement already satisfied (use --upgrade to upgrade): socli in c:\program files\python35-64\lib\site-packages
Requirement already satisfied (use --upgrade to upgrade): BeautifulSoup4 in c:\program files\python35-64\lib\site-packages (from socli)
Requirement already satisfied (use --upgrade to upgrade): requests in c:\program files\python35-64\lib\site-packages (from socli)
PS C:\Users\jonas> socli
failed to create process.
PS C:\Users\jonas> ($env:Path).Replace(';',"`n")
C:\Windows\system32
C:\Windows
C:\Windows\System32\Wbem
C:\Windows\System32\WindowsPowerShell\v1.0
C:\Program Files (x86)\GNU\GnuPG\pub
C:\Users\jonas\bin
C:\Users\jonas\AppData\Local\atom\bin
C:\Program Files\Python35-64
C:\Program Files\Python35-64\Scripts
C:\ProgramData\Oracle\Java\javapath
C:\Program Files\Git\cmd
C:\Program Files\Inkscape
C:\Program Files\Rapid Environment Editor
C:\Program Files\Sublime Text 3
C:\HashiCorp\Vagrant\bin
C:\Program Files\7-Zip
C:\Program Files (x86)\Vim\vim74
C:\Users\jonas\bin\kitty
C:\Program Files\MikTex\miktex\bin\x64
C:\Program Files\ffmpeg\bin

Running python -m socli works btw.

No check of host certificate

All calls with request.get have disabled certificate verification. This puts the user in danger of a man in the middle.

While the information in those pages isn't private this opens the door to modification of the results. Those results are then printed on screen.

One possible attack scenario is to inject terminal control characters. Some terminal emulators allow things like writing a log to a file through control characters. This could therefore lead to remote code execution.

I see no good reason to disable those security features and recommend turning them on.

"socli -u" crashes if a user hasn't asked questions or if they haven't answered any

I've answered a couple of questions but not asked any, so socli -u crashes with:

$ socli -u

User: simon3270

    Reputations: 151

    Badges:
               Gold: 0
             Silver: 1
             Bronze: 3
              Total: 4

    Stats:

Traceback (most recent call last):
File "/usr/local/bin/socli", line 9, in
load_entry_point('socli==3.6', 'console_scripts', 'socli')()
File "/usr/local/lib/python2.7/dist-packages/socli/socli.py", line 1063, in main
userpage(user)
File "/usr/local/lib/python2.7/dist-packages/socli/socli.py", line 706, in userpage
except urllib.error.URLError:
AttributeError: 'module' object has no attribute 'error'

The fix is to check that the number of answers is non-zero before dividing by it.

I've just checked the latest code, and there is already a check on the top_answer_tags and top_question_tags lists having any entries before indexing into them.

I'll issue a Pull request soon

Show links

When people ask or answer something they usually include some link/s for reference (source of the answer, codepen/pastebin/etc..), etc. It would be nice to have that urls displayed somehow.
Example:

$ socli banana

Question: Set Banana panel custom query

I have created a Banana custom panel, and I want to change dynamically its "custom query" by a system of "select" tag. 
In **this** [https://github.com/LucidWorks/banana/wiki/Tutorial:-How-to-Build-a-Custom-Panel] page, I can see that I can find a variable "_d" that contains custom. I can change it by a static variable which I give a value before launch Banana.                                                                             
Far in the tutorial, is a comment "Set the additional custom query", but, I am not sure of what I have to replace by my variable (or have I not to touch it?).
I decided to look at the filtering panel, because, in fact, it is what I want to do (filtering). But I don’t understand how does the module works (where does he stock its filters? and how does it apply them?). 
I looked at the filterSrv.js, but I am not sure it do something on filtering/module.js (apart from giving function to filtering/module.js and filtering/module.html).
Do you know something about it?

    Votes 0 | asked 10 months ago | viewed 133 times | active 7 months ago


Answer:

-------

To set the custom query, you have to set $scope.panel.queries.custom in module.js. This file src/app/partials/querySelect.html is responsible for the Queries tab in each panel's config, where you add custom queries through UI.

-------

That **this** has a link, which I appended under brackets.

socli -u option fails with error for python2

Error occurs because python2 does not support json.JSONDecodeError

$ socli -u
Traceback (most recent call last):
  File "/usr/local/bin/socli", line 9, in <module>
    load_entry_point('socli==3.2', 'console_scripts', 'socli')()
  File "/Library/Python/2.7/site-packages/socli/socli.py", line 573, in main
    except json.JSONDecodeError:
AttributeError: 'module' object has no attribute 'JSONDecodeError'

Solution: use this getsentry/raven-python@1f6b652
I'll open a PR in a second.

Incorrect instructions for OSX

The package python-pip does not exist in homebrew. The proper way to install pip on OSX is:

sudo easy_install pip

Please update the readme.

Formatting

Would it be possible to add some formatting support, like colors?

Randomize user agents and add tests to prevent captcha check

One of the user of reddit reported that he's receiving a captcha check error and it is showing as no result found in SOCLI
screenshot 333

Steps to fix

  • Use random user agents to prevent showing
  • Inform user to do captcha check manually by detecting it from the URL.
  • Add test functions
  • Make user manually verify captcha if possible....

cdn

CDN for socli: This issue just act as a place to store files for external linking...

BeautifulSoup findAll returning empty list of links

I repeatedly ran the command "socli python for loop" and sometimes it would come up with a "No results found..." message. I noticed that if you run multiple queries within a certain interval, it would return this message with a high percentage, but this issue is not only limited to when you run multiple queries within a certain interval. It appears as though calling findAll() on the BeautifulSoup object in the socli function is returning an empty list. Tested this issue on both Python 2.7 and 3.6

chcp 65001 Encoding Error

I found that a particular page always produces this error on my Ubuntu which is using python 2.7.12. Try socli -r 10 -q python for loop. If this doesn't produce the error, then google probably changed the order of the results. You can try socli -iq python for loop and look for the result with the question name "How do I loop through a Python list by twos?"

Here is the link of the actual post on SO for reference:

I have yet to see this encoding error occur in python 3 (I'm using python 3.5 and above on my other computer, although it could be because I'm running ArchLinux on that one and there may be some other differences other than the python version).

Use click command interface

Using the click interface would make the interface more modular. We could replace the command line parsing of inputs and delegation of commands with the click command's clean structure. Is this a change you feel is appropriate @gautamkrishnar?

Why is socli not using stackexchange's API

I just came across this project this evening (GMT + 1) and i'm really interested in it (I've already given it a star)

I've gone through the code a little, and i discovered that socli uses beautifulSoup to scrape stackoverflow directly.

Wouldn't it be better and safer (because stackoverflow might decide to change their markup anytime) to use the official API?

If this is a planned feature...i'll be glad to contribute in anyway to see a re-implementation with the official API.

Change the year in LICENSE

Reserved for first time open source contributors...

How to do

  • Edit LICENSE and change the LICENSE year to 2017
  • Submit a new pull request

Skills Required

  • GitHub

Use pydoc's pager module instead of normal print function

One of the reedit users suggested that we must use pager instead of print function:
screenshot 340

How to fix

  • Comment on this issue if you are interested
  • Use pager module (see the sample code in the screenshot)
  • Fix:
    Windows | Linux | Mac socli -q normal mode
    Windows socli -iq interactive mode
  • Open a PR to the develop branch

0:82 Execution Error when opening in browser on MacOS

When opening a question using the 'o' command on MacOS, there is an execution error thrown saying "0:82 Execution Error: "{link}" doesn't understand the "open location" message
screen shot 2017-07-02 at 10 02 52 pm

In addition to this error, the link also does not open in my default browser Safari but rather in Firefox. With some research, I've found the issues are caused by the use of the web browser module with newer iterations of the MacOS system. The reason for the error is not clear but the default browser issue is caused by the way the module opens URLs. It just has a list of possible browsers and runs through said list stopping at the first one that works. This does not find the default browser.

I've actually taken then liberty of fixing the issue by using the system to open the link. @gautamkrishnar you should see a pull request

Fix PyCharm Warnings

I opened the project with PyCharm and got many errors and warnings, there are some good stuff there that really should be fixed.

AttributeError: 'module' object has no attribute 'SSL_ST_INIT'

When I use socli, and this message occurred, how can I fixed it?

Traceback (most recent call last):
File "/usr/local/bin/socli", line 11, in
load_entry_point('socli==3.6', 'console_scripts', 'socli')()
File "/usr/local/lib/python2.7/dist-packages/pkg_resources/init.py", line 570, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/usr/local/lib/python2.7/dist-packages/pkg_resources/init.py", line 2755, in load_entry_point
return ep.load()
File "/usr/local/lib/python2.7/dist-packages/pkg_resources/init.py", line 2409, in load
return self.resolve()
File "/usr/local/lib/python2.7/dist-packages/pkg_resources/init.py", line 2415, in resolve
module = import(self.module_name, fromlist=['name'], level=0)
File "/usr/local/lib/python2.7/dist-packages/socli/socli.py", line 13, in
import requests
File "/usr/local/lib/python2.7/dist-packages/requests/init.py", line 84, in
from urllib3.contrib import pyopenssl
File "/usr/local/lib/python2.7/dist-packages/urllib3/contrib/pyopenssl.py", line 46, in
import OpenSSL.SSL
File "/usr/lib/python2.7/dist-packages/OpenSSL/init.py", line 8, in
from OpenSSL import rand, crypto, SSL
File "/usr/lib/python2.7/dist-packages/OpenSSL/SSL.py", line 118, in
SSL_ST_INIT = _lib.SSL_ST_INIT
AttributeError: 'module' object has no attribute 'SSL_ST_INIT'

Feature: automatically copy code to clipboard

Allow the user to select the code chunk (with the keyboard) and press a button to copy it to the clipboard, maybe using xclip. This way, the code can be pasted into the editor very easily.

Code Maintenance

The current code is written in a single file (1,280 lines currently), which is soon going to unmanageable and unsanitary. I think it should be modular in nature, separated out into modules for their specific purpose.

For example:

  • Separating printing to console methods in helpers.py (or, printer.py).
  • Separation of interactive mode feature into interactive.py.
  • Separation of users info feature into users.py.
  • Separation of most of the global variables in constants.py (or, config.py)
  • Moreover, keeping socli.py as for the main entry point purpose parsing the arguments and calling the necessary methods from different modules.

This will provide a cleaner approach to the developers to read, understand and debug code in the long run.

Also, the code doesn't follow any Python coding standards which is really disturbing. No offence :P.

socli doesn't work with fish shell

may be it's a dumb issue but when i'm ussing fish shell , socli doesn't show any answer . If i switch to bash it works . Any workaround for this incident ?

Implement stackoverflow homepage browsing

Make SoCLI a fully interactive stack overflow command line homepage browser.

The users must be able to select a question and view the answers for them. If the user is interested, he can post answers via browser for that question.

Please comment on the issue if you are interested ⭐️

Bug: Queries don't show the right/true results

Description of the bug:

Running the socli command on terminal doesn't display the accurate or accurate results.

People to notify:
@gautamkrishnar

Steps to recreate:
Try this in your terminal window

socli for loop in python syntax

Here is the screen shot of that command
screenshot from 2017-02-08 11-22-46

Replace argparse with docopt for describing CLI options and help

There's a great tool called docopt that simplifies the whole argument parsing and help displaying process. What one has to do is to add a POSIX compliant docstring to the file they need the help to be displayed in, and use docopt to parse it. docopt will then automatically generate all the CLI argument parsing and help displaying.

Release Version 3.7: Windows

The Recent update to the code made SoCLI incompatible with windows... We used urwind which will not work on windows terminal. We need to update the internal logic such that the SoCLI will offer minimum functionality in windows without using urwind.

The current code is at Develop branch...

Python knowledge required: Advanced

socli on windows with py2 and py3

i have both py2 and py3 on windows. I use py -2 and py -3 to open them respectively. But the socli command does not work. The command i used to install socli on cmd admin was:

py -3 -m pip install socli

Use Google search instead of default stackoverflow search

Using Google search instead of searching on StackOverflow will increase the relevancy of the search results.

Skills Required

  • BeautifulSoup
  • Python

How to do it?

  • Create a new function named gsearch
  • Replace the current search mechanism with gsearch function call

Things to remember

  • Use site:stackoverflow.com in the query while using google search
  • You must randomize user agents to prevent unwanted captcha.

SoCLI fails without X

I was trying to use SoCLI without a running X Server in interactive and single query mode. Both only show part of the result and then immediately close.

I used the following queries:

  1. socli -iq java for loop
  2. socli -q java for loop
  3. socli -q java (this one apparently works fine)
  4. socli -iq java

I am using python 3.6.2 and zsh 5.4.1.

It apparently works perfectly fine when running in xfce4-terminal.

EDIT: added version information

Use colorama instead of natively printing ASCII Color Codes

Use Colorama https://pypi.python.org/pypi/colorama to improve color support.

Currently the color is not supported by windows platform.

If you like to take up this issue, leave a comment below ⭐️

How to do

Just update the printing functions with corresponding colorama API call, Eg of a printing function:

def print_header(str):
    print(format_str(str, bcolors.HEADER))

Replace print(format_str(str, bcolors.HEADER)) with colorama API call.

Needs testers: Release Version 3.7

I am planning to release SoCLI 3.7 we need to make sure that all the features of SoCLI are working fine on the following platforms:

  • Windows : #84 Tested
  • Linux:
  • Mac:

How can you help?

We need testers to make sure that the SoCLI is working fine on the above platforms:

  • Comment on this issue and let everyone know that you are testing. 😄
  • Just clone SoCLI. You must have Git, Python and PIP installed. Type the following commands.
git clone https://github.com/gautamkrishnar/socli.git
cd socli
git checkout develop
  • Install the socli development version.
sudo pip install -r requirements.txt
sudo python setup.py install
  • Now you can use socli command on your shell.
    Just execute the sample commands in the readme: https://github.com/gautamkrishnar/socli#usage and check whether everything is working fine. If you are facing any issues, don't forget to comment here so that we can fix it 🔪 😄
  • Just comment on this thread and let me know whether it is working fine.

Throwing error in windows

SoCLI is throwing an error while it is using the interactive mode in windows...

image

Debug output:

C:\Users\Gautam krishna R\PycharmProjects\socli>python -m socli --debug -iq hello world java
Error name: Name not found globally.

Description: name 'fcntl' is not defined

Traceback (most recent call last):
  File "C:\Users\Gautam krishna R\PycharmProjects\socli\socli\socli.py", line 483, in socli_interactive
    LOOP = urwid.MainLoop(QUESTION_PAGE, palette)
  File "C:\Program Files\Python35\lib\site-packages\urwid\main_loop.py", line 111, in __init__
    screen = raw_display.Screen()
  File "C:\Program Files\Python35\lib\site-packages\urwid\raw_display.py", line 89, in __init__
    fcntl.fcntl(self._resize_pipe_rd, fcntl.F_SETFL, os.O_NONBLOCK)
NameError: name 'fcntl' is not defined
exiting...

We need to implement the standard interactive mode in windows... @e-beach

Implement Terminal Mode

Make SoCLI a REPL.
Command : socli --terminal
To Quit : Ctrl + c

Implementation :
I will be using the Python Prompt Toolkit to develop this feature.
It will use the interactive mode feature to display questions and answers.

Any kind of query on this feature will be appreciated.

Silent quit when browsing unanswered quetions in interactive mode

I'm making an issue after the PR, the goal is to track bugs / PRs if this issue come back one day, hope it is appreciated.

When browsing in interactive mode an unanswered question socli just quit without any message.
I made a PR to fix the behavior which make thinking socli is bugged, which is not.

PR: #47

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.