From 8d7a1a6f242a3b341c2799936e476b9b487159b3 Mon Sep 17 00:00:00 2001
From: "Silas S. Brown" <ssb22@cam.ac.uk>
Date: Wed, 13 Jan 2010 10:22:27 +0000
Subject: [PATCH] Gradint update

git-svn-id: http://svn.code.sf.net/p/e-guidedog/code/ssb22/gradint@522 29193198-4895-4776-b068-10539e920549
---
 gradint-build/Makefile          |  2 +-
 gradint-build/src/booktime.py   |  2 +-
 gradint-build/src/filescan.py   |  2 +-
 gradint-build/src/frontend.py   |  2 +-
 gradint-build/src/lessonplan.py |  2 +-
 gradint-build/src/loop.py       |  2 +-
 gradint-build/src/makeevent.py  | 12 +++++++-----
 gradint-build/src/play.py       |  2 +-
 gradint-build/src/recording.py  |  2 +-
 gradint-build/src/sequence.py   |  2 +-
 gradint-build/src/synth.py      |  2 +-
 gradint-build/src/system.py     |  2 +-
 gradint-build/src/top.py        |  2 +-
 gradint-build/thindown.py       |  2 +-
 14 files changed, 20 insertions(+), 18 deletions(-)

diff --git a/gradint-build/Makefile b/gradint-build/Makefile
index d2e4ece..d78d4a3 100644
--- a/gradint-build/Makefile
+++ b/gradint-build/Makefile
@@ -1,5 +1,5 @@
 # This file is part of the source code of
-# gradint v0.9948 (c) 2002-2010 Silas S. Brown. GPL v3+.
+# gradint v0.9949 (c) 2002-2010 Silas S. Brown. GPL v3+.
 #    This program is free software; you can redistribute it and/or modify
 #    it under the terms of the GNU General Public License as published by
 #    the Free Software Foundation; either version 3 of the License, or
diff --git a/gradint-build/src/booktime.py b/gradint-build/src/booktime.py
index a2fa96e..402c93d 100644
--- a/gradint-build/src/booktime.py
+++ b/gradint-build/src/booktime.py
@@ -1,5 +1,5 @@
 # This file is part of the source code of
-# gradint v0.9948 (c) 2002-2010 Silas S. Brown. GPL v3+.
+# gradint v0.9949 (c) 2002-2010 Silas S. Brown. GPL v3+.
 #    This program is free software; you can redistribute it and/or modify
 #    it under the terms of the GNU General Public License as published by
 #    the Free Software Foundation; either version 3 of the License, or
diff --git a/gradint-build/src/filescan.py b/gradint-build/src/filescan.py
index bf87caa..0417aa2 100644
--- a/gradint-build/src/filescan.py
+++ b/gradint-build/src/filescan.py
@@ -1,5 +1,5 @@
 # This file is part of the source code of
-# gradint v0.9948 (c) 2002-2010 Silas S. Brown. GPL v3+.
+# gradint v0.9949 (c) 2002-2010 Silas S. Brown. GPL v3+.
 #    This program is free software; you can redistribute it and/or modify
 #    it under the terms of the GNU General Public License as published by
 #    the Free Software Foundation; either version 3 of the License, or
diff --git a/gradint-build/src/frontend.py b/gradint-build/src/frontend.py
index ca06899..4d03ebb 100644
--- a/gradint-build/src/frontend.py
+++ b/gradint-build/src/frontend.py
@@ -1,5 +1,5 @@
 # This file is part of the source code of
-# gradint v0.9948 (c) 2002-2010 Silas S. Brown. GPL v3+.
+# gradint v0.9949 (c) 2002-2010 Silas S. Brown. GPL v3+.
 #    This program is free software; you can redistribute it and/or modify
 #    it under the terms of the GNU General Public License as published by
 #    the Free Software Foundation; either version 3 of the License, or
diff --git a/gradint-build/src/lessonplan.py b/gradint-build/src/lessonplan.py
index 432c9d8..04048ba 100644
--- a/gradint-build/src/lessonplan.py
+++ b/gradint-build/src/lessonplan.py
@@ -1,5 +1,5 @@
 # This file is part of the source code of
-# gradint v0.9948 (c) 2002-2010 Silas S. Brown. GPL v3+.
+# gradint v0.9949 (c) 2002-2010 Silas S. Brown. GPL v3+.
 #    This program is free software; you can redistribute it and/or modify
 #    it under the terms of the GNU General Public License as published by
 #    the Free Software Foundation; either version 3 of the License, or
diff --git a/gradint-build/src/loop.py b/gradint-build/src/loop.py
index 6470df2..3dca397 100644
--- a/gradint-build/src/loop.py
+++ b/gradint-build/src/loop.py
@@ -1,5 +1,5 @@
 # This file is part of the source code of
-# gradint v0.9948 (c) 2002-2010 Silas S. Brown. GPL v3+.
+# gradint v0.9949 (c) 2002-2010 Silas S. Brown. GPL v3+.
 #    This program is free software; you can redistribute it and/or modify
 #    it under the terms of the GNU General Public License as published by
 #    the Free Software Foundation; either version 3 of the License, or
diff --git a/gradint-build/src/makeevent.py b/gradint-build/src/makeevent.py
index 25d97c4..ce9f089 100644
--- a/gradint-build/src/makeevent.py
+++ b/gradint-build/src/makeevent.py
@@ -1,5 +1,5 @@
 # This file is part of the source code of
-# gradint v0.9948 (c) 2002-2010 Silas S. Brown. GPL v3+.
+# gradint v0.9949 (c) 2002-2010 Silas S. Brown. GPL v3+.
 #    This program is free software; you can redistribute it and/or modify
 #    it under the terms of the GNU General Public License as published by
 #    the Free Software Foundation; either version 3 of the License, or
@@ -243,16 +243,18 @@ if partialsDirectory:
                     ff=open(partialsDirectory+os.sep+f,"rb")
                     amend = []
                     while True:
+                        fftell = ff.tell()
                         char = ff.read(1)
                         if not "0"<=char<="9": break
-                        size,fname = (char+ff.readline()).strip(wsp).split(None,1)
+                        size,fname = (char+ff.readline(256)).strip(wsp).split(None,1)
+                        try: size=int(size)
+                        except: break # binary just happened to start with "0"-"9"
                         addFile(fname)
-                        size=int(size)
                         amend.append(l+os.sep+v+os.sep+fname)
                         audioDataPartials[l+os.sep+v+os.sep+fname] = (f,offset,size)
                         offset += size
-                    for k in amend: audioDataPartials[k]=(audioDataPartials[k][0],audioDataPartials[k][1]+ff.tell()-1,audioDataPartials[k][2])
-                    del ff, amend, offset
+                    for k in amend: audioDataPartials[k]=(audioDataPartials[k][0],audioDataPartials[k][1]+fftell,audioDataPartials[k][2])
+                    del ff,amend,offset
                 if partials_raw_mode:
                     if not f.endswith(extsep+"raw"): return
                 elif not f.endswith(dotwav) or f.endswith(dotmp3): return
diff --git a/gradint-build/src/play.py b/gradint-build/src/play.py
index 44eaa1b..ff38f77 100644
--- a/gradint-build/src/play.py
+++ b/gradint-build/src/play.py
@@ -1,5 +1,5 @@
 # This file is part of the source code of
-# gradint v0.9948 (c) 2002-2010 Silas S. Brown. GPL v3+.
+# gradint v0.9949 (c) 2002-2010 Silas S. Brown. GPL v3+.
 #    This program is free software; you can redistribute it and/or modify
 #    it under the terms of the GNU General Public License as published by
 #    the Free Software Foundation; either version 3 of the License, or
diff --git a/gradint-build/src/recording.py b/gradint-build/src/recording.py
index 9f0f28b..1591734 100644
--- a/gradint-build/src/recording.py
+++ b/gradint-build/src/recording.py
@@ -1,5 +1,5 @@
 # This file is part of the source code of
-# gradint v0.9948 (c) 2002-2010 Silas S. Brown. GPL v3+.
+# gradint v0.9949 (c) 2002-2010 Silas S. Brown. GPL v3+.
 #    This program is free software; you can redistribute it and/or modify
 #    it under the terms of the GNU General Public License as published by
 #    the Free Software Foundation; either version 3 of the License, or
diff --git a/gradint-build/src/sequence.py b/gradint-build/src/sequence.py
index 7f6054c..ceb2794 100644
--- a/gradint-build/src/sequence.py
+++ b/gradint-build/src/sequence.py
@@ -1,5 +1,5 @@
 # This file is part of the source code of
-# gradint v0.9948 (c) 2002-2010 Silas S. Brown. GPL v3+.
+# gradint v0.9949 (c) 2002-2010 Silas S. Brown. GPL v3+.
 #    This program is free software; you can redistribute it and/or modify
 #    it under the terms of the GNU General Public License as published by
 #    the Free Software Foundation; either version 3 of the License, or
diff --git a/gradint-build/src/synth.py b/gradint-build/src/synth.py
index 2d5f1dc..eb80706 100644
--- a/gradint-build/src/synth.py
+++ b/gradint-build/src/synth.py
@@ -1,5 +1,5 @@
 # This file is part of the source code of
-# gradint v0.9948 (c) 2002-2010 Silas S. Brown. GPL v3+.
+# gradint v0.9949 (c) 2002-2010 Silas S. Brown. GPL v3+.
 #    This program is free software; you can redistribute it and/or modify
 #    it under the terms of the GNU General Public License as published by
 #    the Free Software Foundation; either version 3 of the License, or
diff --git a/gradint-build/src/system.py b/gradint-build/src/system.py
index 4aaeebe..d796c40 100644
--- a/gradint-build/src/system.py
+++ b/gradint-build/src/system.py
@@ -1,5 +1,5 @@
 # This file is part of the source code of
-# gradint v0.9948 (c) 2002-2010 Silas S. Brown. GPL v3+.
+# gradint v0.9949 (c) 2002-2010 Silas S. Brown. GPL v3+.
 #    This program is free software; you can redistribute it and/or modify
 #    it under the terms of the GNU General Public License as published by
 #    the Free Software Foundation; either version 3 of the License, or
diff --git a/gradint-build/src/top.py b/gradint-build/src/top.py
index fe1af77..170f1d4 100644
--- a/gradint-build/src/top.py
+++ b/gradint-build/src/top.py
@@ -1,7 +1,7 @@
 #!/usr/bin/env python
 # -*- coding: utf-8 -*-
 
-program_name = "gradint v0.9948 (c) 2002-2010 Silas S. Brown. GPL v3+."
+program_name = "gradint v0.9949 (c) 2002-2010 Silas S. Brown. GPL v3+."
 
 #    This program is free software; you can redistribute it and/or modify
 #    it under the terms of the GNU General Public License as published by
diff --git a/gradint-build/thindown.py b/gradint-build/thindown.py
index 7b99836..e4620f1 100644
--- a/gradint-build/thindown.py
+++ b/gradint-build/thindown.py
@@ -1,5 +1,5 @@
 # This file is part of the source code of
-# gradint v0.9948 (c) 2002-2010 Silas S. Brown. GPL v3+.
+# gradint v0.9949 (c) 2002-2010 Silas S. Brown. GPL v3+.
 #    This program is free software; you can redistribute it and/or modify
 #    it under the terms of the GNU General Public License as published by
 #    the Free Software Foundation; either version 3 of the License, or
-- 
GitLab