Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/src/sugar/util.py
diff options
context:
space:
mode:
authorSascha Silbe <sascha@silbe.org>2009-08-25 17:55:48 (GMT)
committer Sascha Silbe <sascha@silbe.org>2009-08-25 17:55:48 (GMT)
commitecdaf6b795550158273ba3a0d582f7ff2bec3187 (patch)
tree11e289d68827c2db1851482efaa7f64da5af93cb /src/sugar/util.py
parent6c3fd0346c1876ad501c3c91d50cdf42f7e0a9dc (diff)
trim EOL (end-of-line) spaces on source files
Diffstat (limited to 'src/sugar/util.py')
-rw-r--r--src/sugar/util.py20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/sugar/util.py b/src/sugar/util.py
index c35d366..99092ee 100644
--- a/src/sugar/util.py
+++ b/src/sugar/util.py
@@ -48,16 +48,16 @@ def sha_data(data):
def unique_id(data = ''):
"""Generate a likely-unique ID for whatever purpose
-
+
data -- suffix appended to working data before hashing
-
+
Returns a 40-character string with hexidecimal digits
- representing an SHA hash of the time, a random digit
+ representing an SHA hash of the time, a random digit
within a constrained range and the data passed.
-
- Note: these are *not* crypotographically secure or
- globally unique identifiers. While they are likely
- to be unique-enough, no attempt is made to make
+
+ Note: these are *not* crypotographically secure or
+ globally unique identifiers. While they are likely
+ to be unique-enough, no attempt is made to make
perfectly unique values.
"""
data_string = "%s%s%s" % (time.time(), random.randint(10000, 100000), data)
@@ -72,7 +72,7 @@ def is_hex(s):
except ValueError:
return False
- return True
+ return True
def validate_activity_id(actid):
"""Validate an activity ID."""
@@ -90,7 +90,7 @@ def set_proc_title(title):
and only the first 15 characters will be shown.
title -- the title you wish to change the process
- title to
+ title to
Returns True on success. We don't raise exceptions
because if something goes wrong here it is not a big
@@ -284,7 +284,7 @@ class TempFilePath(str):
def __del__(self):
if _tracked_paths[self] == 1:
del _tracked_paths[self]
-
+
if os.path.exists(self):
os.unlink(self)
logging.debug('TempFilePath deleted %r', self)