Luflosi
5f855ce547
Use context managers to open files
...
Inspired by d50a6ddc1b .
2019-08-01 13:21:26 -05:00
Luflosi
2b095f720e
Use "with suppress()" to suppress python exceptions
...
Using
```Python
with suppress(OSError):
os.remove('somefile.tmp')
```
instead of
```Python
try:
os.remove('somefile.tmp')
except OSError:
pass
```
makes the code more compact and more readable IMO.
This pattern was recommended by Raymond Hettinger, a Python Core
Developer in his talk "Transforming Code into Beautiful, Idiomatic Python" at https://www.youtube.com/watch?v=OSGv2VnC0go . The transcript is available at https://github.com/JeffPaine/beautiful_idiomatic_python
2019-06-03 12:27:43 +02:00
Luflosi
a792c94ccf
Use python3 shebang for all python scripts
...
Fixes #1624 .
Use python3 shebang for all python scripts as python still defaults to python2 on many systems.
2019-05-20 14:44:24 +02:00
Kovid Goyal
1c4f5b471d
Fix #1575
2019-04-27 07:58:07 +05:30
Kovid Goyal
8d20dbe81d
Use the ! modifier when resizing images via ImageMagick
...
Should hopefully make ImageMagick respect the specified width and height
exactly.
2018-08-01 12:03:36 +05:30
Kovid Goyal
97c317b735
Make screen_size handling in tui cleaner
...
Now screen size is fetched only for output_fd rather than sys.stdout
2018-06-06 11:20:55 +05:30
Kovid Goyal
fa3e173c18
diff kitten: Report errors converting images
2018-05-20 15:01:25 +05:30
Kovid Goyal
ee3b052a50
tui: Preserve cursor position when placing images
2018-05-10 15:27:35 +05:30
Kovid Goyal
a6bce0b221
diff: More work on showing images
2018-05-10 14:33:09 +05:30
Kovid Goyal
d571ee0d01
diff: More work on displaying images
2018-05-10 11:50:46 +05:30
Kovid Goyal
5d7ed67316
diff: More work on displaying images
2018-05-10 10:36:50 +05:30
Kovid Goyal
2e313fbdd2
Better exception for image conversion failure
2018-05-09 20:50:56 +05:30
Kovid Goyal
5c3e4db05f
DRYer
2018-05-09 20:36:53 +05:30
Kovid Goyal
2be2f6aa0c
Make icat a kitten
...
The kittens framework did not exist when icat was first written.
2018-05-09 20:26:30 +05:30
Kovid Goyal
27feccba39
diff: More work on image support
2018-05-09 19:41:37 +05:30
Kovid Goyal
2e69b904da
diff: More work on images
2018-05-09 14:06:15 +05:30