diff options
Diffstat (limited to 'src/Data/Torrent/Progress.hs')
-rw-r--r-- | src/Data/Torrent/Progress.hs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/Data/Torrent/Progress.hs b/src/Data/Torrent/Progress.hs index 18a9cd7d..d0aa75c6 100644 --- a/src/Data/Torrent/Progress.hs +++ b/src/Data/Torrent/Progress.hs | |||
@@ -43,6 +43,8 @@ import Data.Serialize as S | |||
43 | import Data.Ratio | 43 | import Data.Ratio |
44 | import Data.URLEncoded | 44 | import Data.URLEncoded |
45 | import Data.Word | 45 | import Data.Word |
46 | import Text.PrettyPrint as PP | ||
47 | import Text.PrettyPrint.Class | ||
46 | 48 | ||
47 | 49 | ||
48 | -- | Progress data is considered as dynamic within one client | 50 | -- | Progress data is considered as dynamic within one client |
@@ -100,6 +102,12 @@ instance URLEncode Progress where | |||
100 | ] | 102 | ] |
101 | where s :: String -> String; s = id; {-# INLINE s #-} | 103 | where s :: String -> String; s = id; {-# INLINE s #-} |
102 | 104 | ||
105 | instance Pretty Progress where | ||
106 | pretty Progress {..} = | ||
107 | "/\\" <+> PP.text (show _uploaded) $$ | ||
108 | "\\/" <+> PP.text (show _downloaded) $$ | ||
109 | "left" <+> PP.text (show _left) | ||
110 | |||
103 | -- | Initial progress is used when there are no session before. | 111 | -- | Initial progress is used when there are no session before. |
104 | -- | 112 | -- |
105 | -- Please note that tracker might penalize client some way if the do | 113 | -- Please note that tracker might penalize client some way if the do |