Touch-up header and fix an alignment issue
[munter.git] / munter.py
index 47fbd6b8bcf9410a5d66fea7129f1ce6f6d6f6b3..fd5e48509b9a79d3f5ca20b30eb843a92a781c32 100755 (executable)
--- a/munter.py
+++ b/munter.py
@@ -2,9 +2,15 @@
 # -*- coding: utf-8 -*-
 
 
 # -*- coding: utf-8 -*-
 
 
-# Munter Time Calculation
-#
-# Rudimentary program written by ALV to implement the Munter time calculation
+"""
+Munter Time Calculation
+Alexander Vasarab
+Wylark Mountaineering LLC
+
+Version 1.0.2
+
+A rudimentary program which implements the Munter time calculation.
+"""
 
 import sys
 import argparse
 
 import sys
 import argparse
@@ -78,22 +84,25 @@ def main():
     hours = int(time_calc['time'])
     minutes = int((time_calc['time'] - hours) * 60)
 
     hours = int(time_calc['time'])
     minutes = int((time_calc['time'] - hours) * 60)
 
-    print "\n\t╒═══════════════════════════════╕"
-    print "\t╎▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒╎╮"
-    print "\t╎▒{:^29}▒╎│".format('')
-    print "\t╎▒{pace_readable:^31}▒╎│".format(
+    # NOTE: Below, the line with the unicode up arrow uses an alignment
+    #       value of 31. In the future, consider using e.g. wcwidth
+    #       library so that this is more elegant.
+    print("\n\t╒═══════════════════════════════╕")
+    print("\t╎▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒╎╮")
+    print("\t╎▒{:^29}▒╎│".format(''))
+    print("\t╎▒{pace_readable:^31}▒╎│".format(
             pace_readable="{units} {direction} @ {pace}".format(
                 units=round(time_calc['unit_count']),
                 direction=time_calc['direction'],
             pace_readable="{units} {direction} @ {pace}".format(
                 units=round(time_calc['unit_count']),
                 direction=time_calc['direction'],
-                pace=time_calc['pace']))
-    print "\t╎▒{human_time:^29}▒╎│".format(
+                pace=time_calc['pace'])))
+    print("\t╎▒{human_time:^29}▒╎│".format(
             human_time="{hours} hours {minutes} minutes".format(
                 hours=hours,
             human_time="{hours} hours {minutes} minutes".format(
                 hours=hours,
-                minutes=minutes))
-    print "\t╎▒{:^29}▒╎│".format('')
-    print "\t╎▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒╎│"
-    print "\t╘═══════════════════════════════╛│"
-    print "\t └───────────────────────────────┘\n"
+                minutes=minutes)))
+    print("\t╎▒{:^29}▒╎│".format(''))
+    print("\t╎▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒╎│")
+    print("\t╘═══════════════════════════════╛│")
+    print("\t └───────────────────────────────┘\n")
 
 if __name__ == "__main__":
     main()
 
 if __name__ == "__main__":
     main()