Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/taproject.py
diff options
context:
space:
mode:
authorWalter Bender <walter@walter-laptop.(none)>2009-09-18 16:27:20 (GMT)
committer Walter Bender <walter@walter-laptop.(none)>2009-09-18 16:27:20 (GMT)
commiteafb5ae741681d8eb4f091721735f6ccf1b951f2 (patch)
tree0c5e9e89bd805c30d4ff8e7c797185200d795062 /taproject.py
parent18492832959aadd494f9f4c897c92963d6757b73 (diff)
merge of walters-clone
Diffstat (limited to 'taproject.py')
-rw-r--r--taproject.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/taproject.py b/taproject.py
index 8e0f6cf..b3663ef 100644
--- a/taproject.py
+++ b/taproject.py
@@ -59,14 +59,15 @@ def new_project(tw):
clearscreen(tw.turtle)
tw.save_file_name = None
-def load_file(tw):
+def load_file(tw, create_new_project=True):
fname = get_load_name(tw)
if fname==None: return
if fname[-3:]=='.ta': fname=fname[0:-3]
- load_files(tw,fname+'.ta', fname+'.png')
- tw.save_file_name = os.path.basename(fname)
+ load_files(tw,fname+'.ta', create_new_project)
+ if create_new_project is True:
+ tw.save_file_name = os.path.basename(fname)
-def load_files(tw,ta_file, png_file=''):
+def load_files(tw, ta_file, create_new_project=True):
# ignoring the png_file even if it is present
f = open(ta_file, "r")
try:
@@ -84,7 +85,8 @@ def load_files(tw,ta_file, png_file=''):
# listdata = jdecode(text)
data = tuplify(listdata) # json converts tuples to lists
f.close()
- new_project(tw)
+ if create_new_project is True:
+ new_project(tw)
read_data(tw,data)
def get_load_name(tw):