GithubHelp home page GithubHelp logo

tldr-pages / tldr-python-client Goto Github PK

View Code? Open in Web Editor NEW
570.0 18.0 92.0 204 KB

Python command-line client for tldr pages

Home Page: https://pypi.org/project/tldr/

License: MIT License

Python 100.00%
tldr python tldr-pages tldr-python-client hacktoberfest

tldr-python-client's People

Contributors

anakimluke avatar anmol-singh-jaggi avatar bl-ue avatar bwh1te avatar cleanmachine1 avatar columbarius avatar dadav avatar dependabot[bot] avatar felixonmars avatar frenzymadness avatar gotlougit avatar iliakonnov avatar kbdharun avatar lots0logs avatar masterodin avatar mdshw5 avatar mohammad7t avatar nebnola avatar owenvoke avatar pacohh avatar ramwin avatar samuel-w avatar shrayasr avatar soumyadghosh avatar stevejbrown avatar torsava avatar uunnxx avatar vitorhcl avatar waldyrious avatar zlatanvasovic 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

tldr-python-client's Issues

Not able to install using pip

This is strange. I'm able to find the package in https://pypi.python.org/ , but if I try to install it using pip or easy_install, it fails saying it can't be found.
I'm under Ubuntu 13.04.

Commands output:

⮀ sudo pip install tldr
Downloading/unpacking tldr
  Could not find any downloads that satisfy the requirement tldr
No distributions at all found for tldr
Storing complete log in /home/fisa/.pip/pip.log

⮀ sudo easy_install tldr
Searching for tldr
Reading https://pypi.python.org/simple/tldr/
No local packages or download links found for tldr
error: Could not find suitable distribution for Requirement.parse('tldr')

ImportError: No module named urllib.parse

Hi,

I just installed your tldr client with sudo pip install tldr. This is what happens when I run it:

foo@bar ~ $ tldr ssh
Traceback (most recent call last):
  File "/usr/local/bin/tldr", line 9, in <module>
    load_entry_point('tldr==0.1.1', 'console_scripts', 'tldr')()
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 343, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2309, in load_entry_point
    return ep.load()
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2015, in load
    entry = __import__(self.module_name, globals(),globals(), ['__name__'])
  File "/usr/local/bin/tldr.py", line 7, in <module>
    from six.moves.urllib.parse import quote
ImportError: No module named urllib.parse

Kind regards,
Arne

tldr tar shows no output

Any other command I've attempted appears to work as expected, but there may be others failing. Maybe we should change the tests to attempt a wider sample of the pages (or even an exhaustive scan), to capture potential syntax issues?

By the way, three empty lines are added to the output of any command, including tar, not sure why. Probably something to look at as well.

Don't drop color when piping

Colorama (by default, appears to be) dropping colors whenever the content is piped (e.g into a pager, as in tldr tar | less -R).

However, if initialized with strip=False, it doesn't do that.

I don't expect tldr to be used to pipe into a file or anything of the sort, while people piping (especially multiple tldrs!) into a pager will likely want their colors.

to reproduce:

  1. install tldr-python-client
  2. run tldr tar | less -R

expected behavior:
less shows colors

actual behavior:
all ansi escape sequences have been stripped

Grey color instead of white

I tried to set the output of tldr to white but it shows a grey color instead.

Default:
Selection_001

export TLDR_COLOR_EXAMPLE="white"
Selection_002

I bet it's a problem related to my system (not a bug), I'm just wondering what's the cause.

no internet connection detected when invalid color

On Arch Linux, when i set a invalid color e.g.
export TLDR_COLOR_PARAMETER="black"
and then do tldr tar, it stops as soon as the color would be used, but with the confusing message:
No internet connection detected. Please reconnect and try again.
Tested with the repo package and the git version.

ImportError: No module named cli

Hi, I installed tldr as pip install tldr and pip install tldr.py.
When I used it ,show the errors as follows:

$tldr ssh
Traceback (most recent call last):
File "/usr/bin/tldr", line 7, in
from tldr.cli import cli
ImportError: No module named cli

What shoud I install?

Drop python2 support

Given that Python2 was deprecated on January 1st, 2020, and its last version was released a few days ago, I would like to propose removing support in this client for python2, and only focus on python3. Python2 is also being phased out increasingly from various Linux distros to be harder and harder to install. Principally, this would just involve:

  • changing the shebang to be #!/usr/bin/env python3 instead of #!/usr/bin/env python
  • remove usage of __future__
  • remove six as dependency

Syntax for listing multiple commands is ambiguous

The python client allows one to specify multiple commands to show their pages at the same time, for example tldr wget curl, which will show you both wget and curl.

Additionally, it allows you to specify a command without specifying its hyphen, for example tldr ansible galaxy is equivalent to tldr ansible-galaxy.

If trying to specify multiple commands, you cannot look at commands that have hyphens and use the above syntax (you must specify the hyphen).

Example: tldr ansible ansible galaxy or tldr ansible galaxy ansible

I'd expect to see the ansible-galaxy page and the ansible page. Instead, it shows the ansible page twice and a warning about how the galaxy page does not exist and I should consider creating one.

It looks like if you wish to use spaces for a command's name, you must use the hyphen. Would it make sense to allow one to always be able to specify the space?


edit (04/23/2020):

For a better example of confusing behavior, typing tldr git grep returns git-grep but did the user mean that or to get back both git and grep separately?

Add new collaborators to the repo

Following tldr-pages/tldr#1878, I'm inviting all contributors to this repo that meet the criteria specified in tldr-pages/tldr#1839 for being added as collaborators. They are:

Welcome aboard!

Note: all contributors above were invited with write permissions. @felixonmars, as the creator and main author of this repo, retains admin permissions.

This issue will remain open until the invitations are either accepted or declined.

403 forbidden on --download_cache

The regular use case works fine, but --download_cache doesn't:

$ tldr --download_cache
Error: Unable to update cache from tldr site

I checked the code, and the error is hidden behind a very general except:

def download_cache():
    cache_path = get_cache_dir()
    if not os.path.exists(cache_path):
        return
    try:
        req = urlopen(DOWNLOAD_CACHE_LOCATION)
        zipfile = ZipFile(BytesIO(req.read()))
        pattern = re.compile(r'pages/(.+)/(.+)\.md')
        cached = 0
        for entry in zipfile.namelist():
            match = pattern.match(entry)
            if match:
                store_page_to_cache(zipfile.read(entry), match.group(2), match.group(1))
                cached += 1
        print("Updated cache for {:d} entries".format(cached))
    except Exception:
        sys.exit("Error: Unable to update cache from tldr site")

Removing the try/except:

python3.6 /home/user/.local/lib/python3.6/site-packages/tldr.py --download_cache
Traceback (most recent call last):
  File "/home/user/.local/lib/python3.6/site-packages/tldr.py", line 368, in <module>
    main()
  File "/home/user/.local/lib/python3.6/site-packages/tldr.py", line 326, in main
    download_cache()
  File "/home/user/.local/lib/python3.6/site-packages/tldr.py", line 274, in download_cache
    req = urlopen(DOWNLOAD_CACHE_LOCATION)
  File "/usr/lib/python3.6/urllib/request.py", line 223, in urlopen
    return opener.open(url, data, timeout)
  File "/usr/lib/python3.6/urllib/request.py", line 532, in open
    response = meth(req, response)
  File "/usr/lib/python3.6/urllib/request.py", line 642, in http_response
    'http', request, response, code, msg, hdrs)
  File "/usr/lib/python3.6/urllib/request.py", line 564, in error
    result = self._call_chain(*args)
  File "/usr/lib/python3.6/urllib/request.py", line 504, in _call_chain
    result = func(*args)
  File "/usr/lib/python3.6/urllib/request.py", line 756, in http_error_302
    return self.parent.open(new, timeout=req.timeout)
  File "/usr/lib/python3.6/urllib/request.py", line 532, in open
    response = meth(req, response)
  File "/usr/lib/python3.6/urllib/request.py", line 642, in http_response
    'http', request, response, code, msg, hdrs)
  File "/usr/lib/python3.6/urllib/request.py", line 570, in error
    return self._call_chain(*args)
  File "/usr/lib/python3.6/urllib/request.py", line 504, in _call_chain
    result = func(*args)
  File "/usr/lib/python3.6/urllib/request.py", line 650, in http_error_default
    raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 403: Forbidden

I replaced the call to urlopen with request.get, and I get a 200 instead of the 403, so I'm sure my configuration is not causing this. I'm on Ubuntu 16.04, using Python3.6.

Suggestion:

  • Change the exception for something more accurate. General Exception hide bugs.
  • Put a log so that we can read the exception in a file instead of having to edit the code. Reporting bug would be easier.
  • replace urlopen() with requests.get(), adding requests it to the setup.py "install_requires".

I provided a proof of concept for the quick fix using requests in the following PR.

Cache saving empty file and then displaying empty pages

First of all my environment:
Kubuntu 17.04
python3.6
None of the env variables in the man is set.

Installing the client and running it for the first time fetches the pages correctly and creates s $HOME/.tldr_cache page with the cached command. However the saved file is empty and running the tldr command again with the same parameter yields an empty response.
tldr -u says it is updating cache but does not seem to work.

Workaround for this is to delete the $HOME/.tldr_cache folder

Oh and by the way it does not seem to take into consideration env variables at all. Whether they are in ~/.bashrc; /etc/environment or other similar place, not taken into consideration.

support offline pages

As of now, all tldr pages are ~370KB. Instead of being saved all at once, they are cached for each command when the client runs and it doesn't use the same folder structure as tldr (common, linux, etc), but adds a suffix for each one (e.g. awk_common.md).

Pages that are only in common, always force an https connection

common vs specific platform

Take for example the command: tldr tldr on linux (Let's assume I already have the file common/tldr.md in my cache directory and it is newer than TLDR_CACHE_MAX_AGE).

One might reasonably assume that no https requests will be made. But in fact, the program first looks for linux/tldr.md, since it's not in the cache, it first requests it from
PAGES_SOURCE_LOCATION/linux/tldr.md
which returns a 404. then after all this, it looks for common/tldr.md and shows the contents.

Solution

I suggest checking the common cache directory before making an https connection for platform specific files. Or to avoid changing default behavior, at least put this behavior behind an option like
--common-before-net

tldr package in Fedora

Hello.

tldr will be available as a package for Fedora Linux soon. Could I add it as an option for installation? Just asking before creating PR.

Thanks and have a nice day.

Parameters in command line are not parsed and not painted

What I expect to see (picture from tldr main page)
tldr-expectations

What I actually see
bwh1te bwh1te-peka _005

As we can see on this screenshot, param pattern {{user_param}} is not parsing by python client. Since it doesn't parse, it can't be painted like it does on first pic.

What we should do:

  1. Add new DEFAULT_COLORS entry (parameter for example)
  2. Parse command lines for {{param}} patterns and paint in parameter color
  3. Another parts of the line should be painted in command color
  4. Except the first two spaces (as we can see on first pic)

tldr tldr shows invalid command examples

Running tldr tldr shows an invalid tldr command:

user@host:~$ ./tldr.py tldr  
# tldr                                                                                                                                                
                                                                     
  Simplified man pages.                                                  
                                                                     
- Get typical usages of a command (hint: this is how you got here!): 
                                                                            
  tldr command                                          
                                                               
- Show the tar tldr page for linux:                      
                                                                      
  tldr -p linux tar                                                  
                                                                   
- Get help for a git subcommand:                                              
                                                                             
  tldr git checkout

Then if the user tries the second example:

tldr -p linux tar

he is greeted with the following:

user@host:~$./tldr.py -p linux tar
usage: tldr.py [-h] [-u] [-o {linux,osx,sunos}] [-s SOURCE] [-c]
               command [command ...]
tldr.py: error: unrecognized arguments: -p

Tested both the python-pip, python3-pip versions on a Debian machine, and by directly cloning the repo, with identical results.

Add ability to omit background color option

Now we can't specify font as dark (or bold, underline, blink, reverse, concealed) without changing background color. Meanwhile we can't specify background color to black (due to termcolor library limitations).

DEFAULT_COLORS = {
    'command': 'red on_grey dark',
    'parameter': 'green dark',
}

In [11]: colors_of('command')
Out[11]: ('red', 'on_grey', ['dark'])  # Correct!

In [12]: colors_of('parameter')
Out[12]: ('green', 'dark', [])  # Not correct!

So I think we should to improve colors_of method.

Allow to turn ssl_verify off?

Otherwise this would often fail behind corporate proxies like so:

urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:600)>

Cache file could be better documented in the readme file

It might be a good idea to briefly mention in the readme file something about what's going on with the cache file; that it's an automated process: data is pulled from the tldr repo, zipped, commited to the tldr webpage repo, downloaded to the client and then unzipped.

I think it should be more clear to the user what's the source of the data the client downloads. I had to look at the source of this python client, at the tldr website repo, at this code and then at this other script to figure where's the file coming from.

.tldr_cache prevents any meaningful output

Hi, I just installed tldr via the python client on Xubuntu 16. Apart from serious issues with colours that make the text unreadable on every colour scheme, which I have also seen an issue regarding, I have found that the .tldr_cache directory is causing issues for reading tldr pages.

I am not great at explaining in words, so I will just show a few screenshots.

Let's say I run the command $ tldr nano. Yes, it comes up with the tldr page for nano.

However, now if I were to run the same command a second, third, fourth or even 100th time, I will not get any output anymore. I just get three lines of my console coloured with no text.

image

This is only for tldr pages that I have previously read. If I run tldr with a different page I have not yet read, it is fine.

The fix seems to be to run rm -R ~/.tldr_cache. Once I do this, everything is fine. However, it is annoying to have to keep doing this every single time I want to view a tldr page again.

image

Please excuse the text being unreadable. None of the console colour schemes included with the Xubuntu terminal are any better, and I have other stuff which works well with these console colours, so I wont change my console theme just to get tldr to be readable.

(Sorry if this is a bit vague, this is my first issue on another project).

Thanks

New collaborators

Continues the tradition of #55. (@waldyrious if you think any of the previous names should still be on the list, just add them here)

An organization member should invite the following people to be repository collaborattors, as they qualify for the repository collaborator status:

"Documentation is not available." for all commands

I installed this CLI using pacman, and recently it's not finding any documentation for any command.

$ tldr ls
`ls` documentation is not available. Consider contributing Pull Request to https://github.com/tldr-pages/tldr
 $ tldr tar
`tar` documentation is not available. Consider contributing Pull Request to https://github.com/tldr-pages/tldr

How can we fix this?

Fix handling for pt_BR and pt_PT

While most languages only use the ll bit of the ll_CC language specification, Portuguese is split using the full code to differentiate between Brazilian and Portugal Portuguese, which is currently not supported by the client.

Windows: ValueError: need more than 0 values to unpack

Python tldr isn't working for me under Windows 7 native command prompt:

C:\>python --version
Python 2.7.8

C:\>pip install tldr
Collecting tldr
  Downloading tldr-0.1.1.tar.gz
Requirement already satisfied (use --upgrade to upgrade): six in c:\python27\lib\site-packages (from tldr)
Requirement already satisfied (use --upgrade to upgrade): termcolor in c:\python27\lib\site-packages (from tldr)
Installing collected packages: tldr
  Running setup.py install for tldr
    Installing tldr-script.py script to C:\Python27\Scripts
    Installing tldr.exe script to C:\Python27\Scripts
Successfully installed tldr-0.1.1

C:\>pip freeze | grep tldr
tldr==0.1.1

C:\>tldr tldr
Traceback (most recent call last):
  File "C:\Python27\Scripts\tldr-script.py", line 9, in <module>
    load_entry_point('tldr==0.1.1', 'console_scripts', 'tldr')()
  File "C:\Python27\lib\site-packages\pkg_resources\__init__.py", line 521, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "C:\Python27\lib\site-packages\pkg_resources\__init__.py", line 2632, in load_entry_point
    return ep.load()
  File "C:\Python27\lib\site-packages\pkg_resources\__init__.py", line 2312, in load
    return self.resolve()
  File "C:\Python27\lib\site-packages\pkg_resources\__init__.py", line 2318, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "C:\Python27\Scripts\tldr.py", line 13, in <module>
    rows, columns = map(int, os.popen('stty size', 'r').read().split())
ValueError: need more than 0 values to unpack

Similarly under Git Bash on Windows 7:

$ python --version
Python 2.7.8

$ pip install tldr
Requirement already satisfied (use --upgrade to upgrade): tldr in c:\python27\lib\site-packages
Requirement already satisfied (use --upgrade to upgrade): six in c:\python27\lib\site-packages (from tldr)
Requirement already satisfied (use --upgrade to upgrade): termcolor in c:\python27\lib\site-packages (from tldr)

$ pip freeze | grep tldr
tldr==0.1.1

$ tldr tldr
Traceback (most recent call last):
  File "c:\Python27\Scripts\tldr-script.py", line 9, in <module>
    load_entry_point('tldr==0.1.1', 'console_scripts', 'tldr')()
  File "C:\Python27\lib\site-packages\pkg_resources\__init__.py", line 521, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "C:\Python27\lib\site-packages\pkg_resources\__init__.py", line 2632, in load_entry_point
    return ep.load()
  File "C:\Python27\lib\site-packages\pkg_resources\__init__.py", line 2312, in load
    return self.resolve()
  File "C:\Python27\lib\site-packages\pkg_resources\__init__.py", line 2318, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "c:\Python27\Scripts\tldr.py", line 13, in <module>
    rows, columns = map(int, os.popen('stty size', 'r').read().split())
ValueError: need more than 0 values to unpack

It's working under Linux (Ubuntu virtual machine):

$ python --version
Python 2.7.3
$ pip install tldr
Requirement already satisfied (use --upgrade to upgrade): tldr in /usr/local/lib/python2.7/dist-packages
Requirement already satisfied (use --upgrade to upgrade): six in /usr/local/lib/python2.7/dist-packages (from tldr)
Requirement already satisfied (use --upgrade to upgrade): termcolor in /usr/local/lib/python2.7/dist-packages (from tldr
)
Cleaning up...
$ pip freeze | grep tldr
Warning: cannot find svn location for distribute==0.6.24dev-r0
tldr==0.1.1
$ tldr tldr
# tldr



  Simplified man pages



- get typical usages of a command (hint: this is how you got here!)



  tldr {{command}}

Add changelog

Subj. It would be clearly to see list of changes according to version numbers. It may be simply a digest of commit messages for each version.

Add new owner or maintainer to the pypi project

Hey @felixonmars

This is a follow-up on the email I sent last week. Would you be willing to add a new owner/maintainer to the PyPI project for the tldr-python-client, be it someone from the core organization or just a maintainer for this one (e.g. me or @zdroid). We'd ideally like to look to release 1.0.0, but cannot as it seems you're the only one with access to do that.

In a perfect world, I would want to just hook up an automated pipeline to release onto PyPI for any GH release as well to hopefully help alleviate the need for adding tons of people.

cc'ing @zdroid, @sbrl, @agnivade

Create GH action release workflow

A note to myself, it would be good to create a GH release workflow such that on tagged releases through the GH interface, it would then handle the aspect of pushing the new version to pypi.

Do not specify default color by default for white text

In the code, tldr defines default colors to use for all attributes:

tldr-python-client/tldr.py

Lines 183 to 190 in c10b95a

DEFAULT_COLORS = {
'blank': 'white',
'name': 'white bold',
'description': 'white',
'example': 'green',
'command': 'red',
'parameter': 'white',
}

As pointed out in #94, these look terrible on non-dark backgrounds as white does not show up well. This is due to the specifying of the white color by default for a number of elements. However, instead of specifying this white default, why not just leave it blank and use the user set text color within their editor? This is probably what the user wants anyway by default and is somewhat guaranteed to look fine for them.

The actual code change here would be to pass None back as the first argument of the tuple from of_colors.

tldr "documentation is not available"

tldr {command}
outputs
"{command}" documentation is not available. Consider contributing Pull Request to https://github.com/tldr-pages/tldr
given any command.
ping github.com works, tldr -u outputs "Updated cache for 0 entries"

Change background color formatting

The current background color formatting can clash with different terminal emulator color profiles. For example, see the output in this image, which is a screenshot from my terminal (Fedora 27, default emulator, monokai dark color profile).
https://i.imgur.com/EuJTEXL.png
If possible, don't specify a background color, or use general codes which override a user's color profile for a consistent look an all platforms.

[Linux] Cache files in $XDG_CACHE_HOME/tldr instead of ~/.tldr_cache

According to the XDG Base Directory Specification, user-specific cached files files should be stored in $XDG_CACHE_HOME/tldr, or $HOME/.cache/tldr if $XDG_CACHE_HOME is not defined.

There is a single base directory relative to which user-specific non-essential (cached) data should be written. This directory is defined by the environment variable $XDG_CACHE_HOME.

This avoids cluttering the home directory and simplifies including/excluding related directories from bulk operations such as backups.

Links

Repos

Bash on Ubuntu on Windows - Internet connection error

Reproduction Rate

I could reproduce the issue each time I tried to print any TLDR page.

Steps to Reproduce

  1. Install Windows Subsystem for Linux.
  2. Install Ubuntu on Windows.
  3. Run Bash on Ubuntu on Windows.
  4. Install linuxbrew. There is installation instruction on http://linuxbrew.sh.
  5. Install Python3: brew update and brew install python3.
  6. Install TLDR Python client: pip3 install tldr.
  7. Try to print any TLDR page.

Result

$ tldr tldr
No internet connection detected. Please reconnect and try again.
$ tldr apt
No internet connection detected. Please reconnect and try again.

Expected Result

TLDR pages

Additional Information

Windows Subsystem for Linux, Bash on Ubuntu on Windows

I have reproduced the issue on AIX 7.1, Python 2.7.12.

Cannot use most CLI options

Cannot use most of the options (like os or source), due to:

tldr-python-client/tldr.py

Lines 286 to 295 in 06ac37a

options, other_options = parser.parse_known_args()
if options.update_cache:
update_cache(remote=options.source)
return
parser.add_argument(
'command', type=str, nargs='+', help="command to lookup")
options = parser.parse_args(other_options)

line 295 overwrites the option array set on line 286 (which did contain os, source, etc.) and replaces it with the defaults for those options.

Test command:

./tldr -s sunos svcs
`svcs` documentation is not availableConsider contributing Pull Request to https://github.com/tldr-pages/tldr

The namespace before and after the pointed out line:

Before: Namespace(os=['sunos'], source='http://raw.github.com/tldr-pages/tldr/master/pages', update_cache=False)
After: Namespace(command=['svcs'], os=None, source='http://raw.github.com/tldr-pages/tldr/master/pages', update_cache=False)

ValueError: need more than 0 values to unpack while running manage.status

Hello,

I have a salt-master. I also have a minion, running not on the same machine with the master, but instead, it is a separate box sitting on the same network. I have not accepted the key of that minion on salt-master side. Here are the keys on the master side:

salt-key -l all
Accepted Keys:
Denied Keys:
Unaccepted Keys:
BL1706002
Rejected Keys:

Minion-id of my minion is BL1706002.

When I run the manage.status command on the master side I get the following error:

salt-run manage.status
No minions matched the target. No command was sent, no jid was assigned.
Exception occurred in runner manage.status: Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/salt/client/mixins.py", line 395, in _low
    data['return'] = self.functions[fun](*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/salt/runners/manage.py", line 73, in status
    ret['up'], ret['down'] = _ping(tgt, expr_form, __opts__['timeout'])
ValueError: need more than 0 values to unpack

This used to work. But I recently started getting this error and this error is breaking the UI of the application that I am developing. I can make my code to catch this error, digest it and gracefully continue as if there were no problems, but it didn't sound a correct solution to go with to me. So, instead, I wanted to ask you guys, what your opinions are.

Is this the normal behavior? Am I missing something ? What do you guys suggest?

Thank you very much

PS: Extra information

salt-master --version
salt-master 2016.11.2 (Carbon)
uname -a
Linux xxxxxxxxxxxx 4.9.0-3-amd64 #1 SMP Debian 4.9.30-2+deb9u2 (2017-06-26) x86_64 GNU/Linux

tldr displays traceback on ctrl-c

When one hits ctrl-c during execution of tldr command it displays a traceback caused by KeyboardInterrupt. We should consider catching that exception.

Respect default terminal colours

Hi! I'm a big believer in sane defaults, and the default colour scheme of tldr seems to me anything but.

Would it be possible to use the default background/text/hightlight/... colors from the terminal instead of forcing users to configure it?

Reduce empty lines in output

Current python-client has 2 empty lines at the beginning of output, 3 empty lines at the end of the output.

How about reduce both empty line to 1 empty line (1 at the beginning, 1 at the end)? Because those extra empty lines look unnecessary/not practical when we use tldr in the terminal.

Though I agree the current version's screenshot in README.md looks beautiful, but it's not that beautiful in the terminal. (Of course we can still use that screenshot, but change this behavior in actual use).

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.