summaryrefslogtreecommitdiff
blob: ce18d7afe09d55f78caf64b77e75ec72d8e452b0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
diff -r -U2 plumbum-1.6.4.orig/plumbum/cli/image.py plumbum-1.6.4/plumbum/cli/image.py
--- plumbum-1.6.4.orig/plumbum/cli/image.py	2017-11-08 21:20:49.000000000 +0700
+++ plumbum-1.6.4/plumbum/cli/image.py	2017-12-15 15:45:16.184943092 +0700
@@ -3,5 +3,6 @@
 from plumbum import colors
 from .termsize import get_terminal_size
-import . as cli
+from .application import Application
+from .switches import switch, SwitchAttr, Flag, positional, Range, ExistingFile
 import sys
 
@@ -75,17 +76,17 @@
         print(colors.reset)
 
-class ShowImageApp(cli.Application):
+class ShowImageApp(Application):
     'Display an image on the terminal'
-    double = cli.Flag(['-d','--double'], help="Double resolution (only looks good with some fonts)")
+    double = Flag(['-d','--double'], help="Double resolution (only looks good with some fonts)")
 
-    @cli.switch(['-c','--colors'], cli.Range(1,4), help="Level of color, 1-4")
+    @switch(['-c','--colors'], Range(1,4), help="Level of color, 1-4")
     def colors_set(self, n):
         colors.use_color = n
 
-    size = cli.SwitchAttr(['-s','--size'], help="Size, should be in the form 100x150")
+    size = SwitchAttr(['-s','--size'], help="Size, should be in the form 100x150")
 
-    ratio = cli.SwitchAttr(['--ratio'], float, default=2.45, help="Aspect ratio of the font")
+    ratio = SwitchAttr(['--ratio'], float, default=2.45, help="Aspect ratio of the font")
 
-    @cli.positional(cli.ExistingFile)
+    @positional(ExistingFile)
     def main(self, filename):