### The Opus Magnum of platform strings :-)
-_platform_cache = None
-_platform_aliased_cache = None
+_platform_cache = {True:None, False:None}
+_platform_aliased_cache = {True:None, False:None}
def platform(aliased=0, terse=0):
"""
global _platform_cache,_platform_aliased_cache
- if not aliased and (_platform_cache is not None):
- return _platform_cache
- elif _platform_aliased_cache is not None:
- return _platform_aliased_cache
+ if not aliased and (_platform_cache[bool(terse)] is not None):
+ return _platform_cache[bool(terse)]
+ elif _platform_aliased_cache[bool(terse)] is not None:
+ return _platform_aliased_cache[bool(terse)]
# Get uname information and then apply platform specific cosmetics
# to it...
platform = _platform(system,release,machine,processor,bits,linkage)
if aliased:
- _platform_aliased_cache = platform
+ _platform_aliased_cache[bool(terse)] = platform
elif terse:
pass
else:
- _platform_cache = platform
+ _platform_cache[bool(terse)] = platform
return platform
### Command line interface
into groups sharing the same key (as determined by a key function).
It offers some of functionality of SQL's groupby keyword and of
the Unix uniq filter.
-
+
- itertools now has a new function, tee() which produces two independent
iterators from a single iterable.
Library
-------
+- Fixed a caching bug in platform.platform() where the argument of 'terse' was
+ not taken into consideration when caching value.
+
- Added two new command-line arguments for profile (output file and
default sort).