style
authorNathan Binkert <binkertn@umich.edu>
Tue, 22 Mar 2005 19:51:31 +0000 (14:51 -0500)
committerNathan Binkert <binkertn@umich.edu>
Tue, 22 Mar 2005 19:51:31 +0000 (14:51 -0500)
python/m5/convert.py:
python/m5/smartdict.py:
    follow our naming convention

--HG--
extra : convert_revision : d57a103dfbad1fb6a076bfacdca226c4b1893fb8

python/m5/convert.py
python/m5/smartdict.py

index b3f34e4ab6c62c820126fe08dd2437f1d4ed89f1..2ebe9388944f233db8e852dfe9cfde2f2515c2e6 100644 (file)
@@ -22,7 +22,7 @@ pebi = tebi * 1024
 exbi = pebi * 1024
 
 # memory size configuration stuff
-def to_integer(value):
+def toInteger(value):
     if not isinstance(value, str):
         result = int(value)
     elif value.endswith('Ei'):
@@ -64,7 +64,7 @@ def to_integer(value):
 
     return result
 
-def to_bool(val):
+def toBool(val):
     t = type(val)
     if t == bool:
         return val
@@ -82,9 +82,9 @@ def to_bool(val):
         elif val == "false" or val == "f" or val == "no" or val == "n":
             return False
 
-    return to_integer(val) != 0
+    return toInteger(val) != 0
 
-def to_frequency(value):
+def toFrequency(value):
     if not isinstance(value, str):
         result = float(value)
     elif value.endswith('THz'):
@@ -102,7 +102,7 @@ def to_frequency(value):
 
     return result
 
-def to_latency(value):
+def toLatency(value):
     if not isinstance(value, str):
         result = float(value)
     elif value.endswith('c'):
@@ -122,7 +122,7 @@ def to_latency(value):
 
     return result;
 
-def to_network_bandwidth(value):
+def toNetworkBandwidth(value):
     if not isinstance(value, str):
         result = float(value)
     elif value.endswith('Tbps'):
@@ -140,7 +140,7 @@ def to_network_bandwidth(value):
 
     return result
 
-def to_memory_bandwidth(value):
+def toMemoryBandwidth(value):
     if not isinstance(value, str):
         result = int(value)
     elif value.endswith('PB/s'):
@@ -160,7 +160,7 @@ def to_memory_bandwidth(value):
 
     return result
 
-def to_memory_size(value):
+def toMemorySize(value):
     if not isinstance(value, str):
         result = int(value)
     elif value.endswith('PB'):
index 1ba5d8410b773b30afd2cb7ea8254d3347b35ca4..0dbcc50b07d129a0583af3a88e222d648395ea41 100644 (file)
@@ -20,13 +20,13 @@ class SmartDict(dict):
 
     class Proxy(str):
         def __int__(self):
-            return int(to_integer(str(self)))
+            return int(toInteger(str(self)))
         def __long__(self):
-            return long(to_integer(str(self)))
+            return long(toInteger(str(self)))
         def __float__(self):
-            return float(to_integer(str(self)))
+            return float(toInteger(str(self)))
         def __nonzero__(self):
-            return to_bool(str(self))
+            return toBool(str(self))
         def convert(self, other):
             t = type(other)
             if t == bool: