diff -r e24793fae424 -r 1b734faab67a mod_util.py --- a/mod_util.py Tue Aug 11 19:12:30 2015 +0300 +++ b/mod_util.py Sun Aug 16 10:59:22 2015 +0300 @@ -29,7 +29,6 @@ from __future__ import print_function import math import json -import subprocess import re from modulecore import command_error import modulecore as ModuleCore @@ -210,28 +209,6 @@ def cmd_calc (bot, reply, args, **rest): reply (calc.Calculator().calc (args['expression'])) - # expr = args['expression'] - # try: - # Substitute some mathematical constants - # expr = mathsubstitute (expr, 'pi' , 3.14159265358979323846264338327950288419716939937510) - # expr = mathsubstitute (expr, 'e' , 2.71828182845904523536028747135266249775724709369995) - # expr = mathsubstitute (expr, 'phi', 1.6180339887498948482) # golden ratio - - # result = subprocess.check_output (['calc', '--', expr], stderr=subprocess.STDOUT) \ - # .replace ('\t', '') \ - # .replace ('\n', '') - - # errmatch = re.compile (r'^.*\bError\b.*$').match (result) - - # if errmatch: - # command_error ('math error') - # return - - # reply ('Result: %s' % result) - # except subprocess.CalledProcessError as e: - # command_error (e.output.split('\n')[0]) - # except OSError as e: - # command_error ('failed to execute calc: ' + e.strerror) def cmd_more (commandObject, **rest): ModuleCore.print_responses (commandObject)