[conduit: 103/138] Oh dear. I knew string_to_unique_file would hurt me one day...
- From: John Carr <johncarr src gnome org>
- To: svn-commits-list gnome org
- Subject: [conduit: 103/138] Oh dear. I knew string_to_unique_file would hurt me one day...
- Date: Thu, 21 May 2009 03:35:34 -0400 (EDT)
commit cf2005f096185d5a571cd37017487128f942cfad
Author: John Carr <john carr unrouted co uk>
Date: Tue May 5 13:51:12 2009 -0700
Oh dear. I knew string_to_unique_file would hurt me one day...
---
conduit/modules/iPodModule/iPodModule.py | 10 ++--------
1 files changed, 2 insertions(+), 8 deletions(-)
diff --git a/conduit/modules/iPodModule/iPodModule.py b/conduit/modules/iPodModule/iPodModule.py
index 06f4c72..3ae5067 100644
--- a/conduit/modules/iPodModule/iPodModule.py
+++ b/conduit/modules/iPodModule/iPodModule.py
@@ -60,16 +60,10 @@ if errormsg:
ITDB_MEDIATYPE_PODCAST = 4
def _string_to_unqiue_file(txt, base_uri, prefix, postfix=''):
- for i in range(1, 10000):
- filename = prefix + str(i) + postfix
- uri = os.path.join(base_uri, filename)
- f = File.File(uri)
- if not f.exists():
- break
-
temp = Utils.new_tempfile(txt)
+ uri = os.path.join(base_uri, prefix+temp.get_filename()+postfix)
temp.transfer(uri, True)
- temp.set_UID(filename)
+ temp.set_UID(uri)
return temp.get_rid()
class iPodFactory(VolumeFactory.VolumeFactory):
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]