Commit Graph

961 Commits

Author SHA1 Message Date
Tomas Korbar
12e8059025 Edit appdirs site_config_dir function
This change causes site_config_dir function to return
/etc/cheat on linux systems. This is right because most
linux distributions follow FHS where /etc is a directory
which contains system-wide configuration files.
2019-07-24 14:23:46 +02:00
Tomas Korbar
fdc414ede3 Fix import of appdirs in Configuration class
Import of appdirs without reference to cheat module caused
ModuleNotFoundError
2019-03-21 16:47:51 +01:00
Chris Lane
c1fceb5f0d Merge branch 'installation-issues' of github.com:cheat/cheat into installation-issues 2019-02-13 12:55:30 -05:00
Chris Lane
d0faf1a3e3 Included appdirs in project
The prior attempt to resolve #420 and #431 relied on `appdirs` to
determine the appropriate directories into which to install files.
Previously, `setup.py` dynamically attempted to install `appdirs` via
`pip` during installation if necessary.

This attempt to failed on multiple platforms, however, due to
backwards-incompatible `pip` interfaces.

As a workaround, I have now directly included `appdirs` (a small module)
within `cheat` itself. This approach is explicitly supported per the
`appdirs` documentation:

https://pypi.org/project/appdirs/
2019-02-13 12:53:19 -05:00
Chris Lane
fdddedb8bd Installation issues
Resolves the following:

- #351 (use of `sudo` when installing)
- #420 (failure to install on Windows)
- #431 (failure to install on MacOS)

Application now relies on `appdirs` module to identify the appropriate
locations for storing configuration and data, both during installation
and runtime.
2019-02-13 12:51:18 -05:00
Chris Lane
5487314676 Version bump: 2.5.1 2019-02-13 12:42:58 -05:00
Chris Allen Lane
ec360ccddd
Merge pull request #435 from roachsinai/master
Expand ~ for 'CHEAT_USER_DIR', 'CHEAT_DEFAULT_DIR' and 'DEFAULT_CHEAT…
2019-02-13 12:40:25 -05:00
Chris Allen Lane
bb7dfd1028
Merge pull request #436 from avsej/patch-1
Fix typo in gcc sheet
2019-02-13 12:31:31 -05:00
Sergey Avseyev
b348724082
Update gcc 2019-02-13 13:52:33 +00:00
raochsinai
5053f07fd8 Expand ~ for 'CHEAT_USER_DIR', 'CHEAT_DEFAULT_DIR' and 'DEFAULT_CHEAT_DIR'. 2019-02-12 15:16:59 +08:00
Chris Lane
f692c8e1d8 Addressing cross-platform installation issues
Attempted to address various cross-platform installation issues:

- Removed all hard-coded references to file-paths, and replaced them
  with paths provided by `appdirs`.

- Removed (erroneously inserted) default file paths which would never be
  checked due to application logic.

- Modified `setup.py` to no longer install a configuration file. The
  mechanics are still in place to **read** a configuration file, but
  after examination, I've concluded that the installation of that file
  is best left to package maintainers rather than `cheat` itself.
2019-02-09 13:27:58 -05:00
Chris Lane
89bb9aaf13 Included appdirs in project
The prior attempt to resolve #420 and #431 relied on `appdirs` to
determine the appropriate directories into which to install files.
Previously, `setup.py` dynamically attempted to install `appdirs` via
`pip` during installation if necessary.

This attempt to failed on multiple platforms, however, due to
backwards-incompatible `pip` interfaces.

As a workaround, I have now directly included `appdirs` (a small module)
within `cheat` itself. This approach is explicitly supported per the
`appdirs` documentation:

https://pypi.org/project/appdirs/
2019-02-08 11:21:09 -05:00
Chris Lane
482161f8e9 Installation issues
Resolves the following:

- #351 (use of `sudo` when installing)
- #420 (failure to install on Windows)
- #431 (failure to install on MacOS)

Application now relies on `appdirs` module to identify the appropriate
locations for storing configuration and data, both during installation
and runtime.
2019-02-07 13:34:20 -05:00
Chris Allen Lane
4dd55105d2
Merge pull request #361 from aroonav/master
Enable starting the cheat python script on windows.
2019-02-06 10:25:29 -05:00
Chris Allen Lane
6148d64599
Merge pull request #430 from movd/rename
Update rename
2019-02-05 08:59:06 -05:00
Moritz
cde8bcaa1d
Update rename
Add cheat for mass rename with search and replace
2019-02-05 10:57:43 +01:00
Aroonav Mishra
fcb82778e4 * Corrected the logic to execute the cheat script.
* Check VISUAL, CHEAT_EDITOR, EDITOR environment variables before falling
back to wordpad as the default editor.
2019-02-05 12:18:26 +05:30
Aroonav Mishra
da92421948 Merge remote-tracking branch 'upstream/master' 2019-02-05 10:14:39 +05:30
Chris Allen Lane
d6c7863573
Merge pull request #428 from dufferzafar/patch-2
ssh: Improve SOCKS command
2019-02-04 14:54:52 -05:00
Shadab Zafar
5812bca6b7
ssh: Improve SOCKS command
This doesn't give an SSH shell, but just forwards the ports - which is what one usually requires when setting up a SOCKS proxy.

The -q is to suppress messages etc.
2019-02-04 23:45:16 +05:30
Chris Lane
074dba6e99 v2.5.0
`minor` version bump to `2.5.0`.
2019-02-04 12:04:52 -05:00
Chris Allen Lane
9d1dd15387
Merge pull request #427 from cheat/issue-349
Issue #349
2019-02-04 11:57:35 -05:00
Chris Lane
caf355f142 Issue #349
Implements support for terminals with light backgrounds via a new
`CHEAT_COLORSCHEME` envvar.
2019-02-04 11:56:00 -05:00
Chris Allen Lane
2728ce4757
Merge pull request #426 from cheat/vagrant
Updated Vagrantfile
2019-02-04 11:54:06 -05:00
Chris Lane
6ae76799f7 Updated Vagrantfile
Modified `Vagrantfile` to build an Ubuntu environment rather than
Alpine, after the latter exhibited weird behavior.
2019-02-04 11:50:25 -05:00
Chris Allen Lane
0b523a769f
Merge pull request #425 from cheat/vagrant
Added Vagrantfile
2019-02-04 10:41:26 -05:00
Chris Lane
f29cf03b68 Added Vagrantfile
Added a `Vagrantfile` which builds an alpine-based environment that can
be used for development and testing.
2019-02-04 10:40:10 -05:00
Chris Allen Lane
4347114e19
Merge pull request #424 from JensKorte/patch-1
link changed, added details
2019-02-04 10:05:36 -05:00
Chris Lane
edc67e7819 Updated links to README
Re-pathed links from `chrisallenlane/cheat` to `cheat/cheat` as
appropriate, following the move.
2019-02-04 10:03:19 -05:00
Chris Allen Lane
aa33a36491
Merge pull request #422 from cheat/refactor
Refactor
2019-02-04 09:58:24 -05:00
JensKorte
8aac10dd8b
link changed, added details
The table isn't available any more in the recent wiki page. The new link uses the old version of wikipedia. In my browser I have to "unhide" the box.
2019-02-03 20:56:57 +01:00
Chris Lane
9931b78c5f Lint
- Added instruction to lint `setup.py` to `ci/lint.sh`
- Updated `setup.py` per linter suggestions
2019-02-01 15:24:04 -05:00
Chris Lane
a37577ee85 Trivial: docstrings
Updated some docstring comments.
2019-02-01 15:18:23 -05:00
Chris Lane
3ad923eff0 Refactored (11)
Renamed `CHEAT_DEFAULT_DIR` to `CHEAT_USER_DIR` because the latter more
accurately describes the purpose of the variable.
2019-02-01 15:10:03 -05:00
Chris Lane
ba47dc2cbc Refactored (10)
- Added `ci/lint.sh`, which uses `flake8` to lint the relevant files
- Made changes to appease the linter.
- Bugfix in `cheat/configuration` (missing dependency)
2019-02-01 14:44:48 -05:00
Chris Lane
df21731c02 Trivial Python style corrections 2019-02-01 11:43:38 -05:00
Chris Lane
a657699a24 Refactored (9)
Moved some functionality into the `Util` class.
2019-02-01 11:43:11 -05:00
Chris Lane
5793c1845a Refactored (8)
Refactored `Sheet` class:

- Removed unnecessary indirection and extraneous methods
- Renamed some methods to conform to Pythonic conventions
- Renamed the `create_or_edit` method to `edit` to be consistent with
  subcommand name (`--edit`)
2019-02-01 11:23:38 -05:00
Chris Lane
e2b5728283 Refactored (7)
Refactored for general code-clarity, with particular focus on removing
needless abstraction within `Sheet` and `Sheets` classes.
2019-01-31 20:03:56 -05:00
Chris Lane
d61e4e7c34 Refactored (6)
Standardized (mostly) how the various classes are initialized.
2019-01-31 18:08:19 -05:00
Chris Lane
145a81dcd6 Var renames
Replaced more references to deprecated envvar names to their newer
counterparts.
2019-01-31 17:55:26 -05:00
Chris Lane
7c4fc54681 Refactored (5)
- Extracted `Colorize` class out of `Util` class. (The latter now only
  contains static methods.)
- Renamed methods in `Colorize` class for improved clarity.
- Refactored as necessary to accommodate the changes above.
2019-01-31 17:43:21 -05:00
Chris Lane
878d7e7e1b Refactored (4)
Improved handling of edge-cases in `configuration.py`.
2019-01-31 17:40:53 -05:00
Chris Lane
928637c9db Refactored (3)
Removed unnecessary `import` calls.
2019-01-31 17:14:21 -05:00
Chris Lane
ab87bb11c4 Refactored (2)
Created an `Editor` class out methods in the `Util` class to enhance
code clarity.
2019-01-31 17:03:21 -05:00
Chris Lane
8f757d7735 Refactored (1)
Performed a general refactoring, focusing on the following:

- Removing layers of abstraction in config handling
- Stubbing out proper config validator
- Updating envvar names located throughout the project
2019-01-31 16:45:28 -05:00
Chris Lane
c922ef4c8d Version bump: 2.4.2
Contains `termcolor` dependency fix.
2019-01-29 11:45:43 -05:00
Chris Allen Lane
574a7ec3c9
Merge pull request #421 from chrisallenlane/termcolor
Added termcolor dependency to setup.py
2019-01-29 11:44:22 -05:00
Chris Lane
5ae49228b7 Added termcolor dependency to setup.py
Added a missing `termcolor` dependency to `install_requires` in
`setup.py`. `termcolors` was introduced as an optional dependency when
the `CHEAT_HIGHLIGHT` envvar was implemented.
2019-01-29 11:42:14 -05:00
Chris Lane
09acdf1a69 README edits
Updated the names of the (preferred) cheat-related environment
variables, which have been changed in recent versions.
2019-01-29 11:31:03 -05:00