33
33
from tkinter import messagebox as tkMessageBox
34
34
from tkinter import filedialog as tkFileDialog
35
35
36
- import string
37
36
import os
38
37
import pickle
39
38
import time
@@ -1473,7 +1472,7 @@ def __init__(self, root, title="Save"):
1473
1472
# split the string using "." as the delimiter string and check if last entry is "pse" or "emov" if so, remove them
1474
1473
# if not, add emov to string
1475
1474
1476
- splitFileName = string .split (fileName , "." )
1475
+ splitFileName = fileName .split ("." )
1477
1476
if splitFileName [len (splitFileName ) - 1 ] == "pse" :
1478
1477
fileName = fileName [:- 4 ]
1479
1478
elif splitFileName [len (splitFileName ) - 1 ] == "emov" :
@@ -1555,7 +1554,7 @@ def apply(self):
1555
1554
# split the string using "." as the delimiter string and check if last entry is "pse" or "emov" if so, remove them
1556
1555
# if not, add emov to string
1557
1556
1558
- splitFileName = string .split (fileName , "." )
1557
+ splitFileName = fileName .split ("." )
1559
1558
if splitFileName [len (splitFileName ) - 1 ] == "pse" :
1560
1559
fileName = fileName [:- 4 ]
1561
1560
elif splitFileName [len (splitFileName ) - 1 ] == "emov" :
@@ -1649,7 +1648,7 @@ def __init__(self, root, title="Load"):
1649
1648
# if it does not have an extension of either .pse or .emov, we will use it as is
1650
1649
# if it has an extenstion of either .pse or .emov, we will strip away that extension
1651
1650
1652
- splitFileName = string .split (fileName , "." )
1651
+ splitFileName = fileName .split ("." )
1653
1652
1654
1653
if splitFileName [len (splitFileName ) - 1 ] == "emov" :
1655
1654
fileName = fileName [:- 5 ]
@@ -1745,7 +1744,7 @@ def apply(self):
1745
1744
# if it does not have an extension of either .pse or .emov, we will use it as is
1746
1745
# if it has an extenstion of either .pse or .emov, we will strip away that extension
1747
1746
1748
- splitFileName = string .split (fileName , "." )
1747
+ splitFileName = fileName .split ("." )
1749
1748
1750
1749
if splitFileName [len (splitFileName ) - 1 ] == "emov" :
1751
1750
fileName = fileName [:- 5 ]
@@ -2447,8 +2446,8 @@ def cmpStoryBoard(a, b):
2447
2446
elif b [0 ] == "-" :
2448
2447
return 1
2449
2448
2450
- x = string . split ( a [0 ], "-" )
2451
- y = string . split ( b [0 ], "-" )
2449
+ x = a [0 ]. split ( "-" )
2450
+ y = b [0 ]. split ( "-" )
2452
2451
2453
2452
xStartFrame = int (x [0 ])
2454
2453
yStartFrame = int (y [0 ])
@@ -2520,7 +2519,7 @@ def getActionValues(action):
2520
2519
2521
2520
# first we get the startFrame and the endFrame
2522
2521
frames = action [0 ]
2523
- t = string .split (frames , "-" )
2522
+ t = frames .split ("-" )
2524
2523
startFrame = t [0 ] # the first token is the start frame
2525
2524
if len (t ) == 2 :
2526
2525
endFrame = t [1 ]
@@ -2537,24 +2536,24 @@ def getActionValues(action):
2537
2536
return result
2538
2537
elif actionType == "Morph" :
2539
2538
info = action [2 ]
2540
- q = string .split (info , ";" )
2541
- p = string . split ( q [0 ], " " )
2542
- r = string . split ( q [1 ], " " )
2539
+ q = info .split (";" )
2540
+ p = q [0 ]. split ( " " )
2541
+ r = q [1 ]. split ( " " )
2543
2542
morphName = p [len (p ) - 1 ]
2544
2543
direction = r [len (r ) - 1 ]
2545
2544
2546
2545
result = (startFrame , endFrame , actionType , morphName , direction )
2547
2546
return result
2548
2547
elif actionType == "Scene Set" :
2549
2548
info = action [2 ]
2550
- q = string .split (info , " " )
2549
+ q = info .split (" " )
2551
2550
sceneName = q [len (q ) - 1 ]
2552
2551
2553
2552
result = (startFrame , endFrame , actionType , sceneName )
2554
2553
return result
2555
2554
elif actionType == "Zoom" :
2556
2555
info = action [2 ]
2557
- q = string .split (info , " " )
2556
+ q = info .split (" " )
2558
2557
if len (q ) == 2 :
2559
2558
amtZoom = q [1 ]
2560
2559
else :
@@ -2569,21 +2568,21 @@ def getActionValues(action):
2569
2568
return result
2570
2569
elif actionType == "Rotation" :
2571
2570
info = action [2 ]
2572
- q = string .split (info , ";" )
2573
- p = string . split ( q [0 ], " " )
2574
- r = string . split ( q [1 ], " " )
2571
+ q = info .split (";" )
2572
+ p = q [0 ]. split ( " " )
2573
+ r = q [1 ]. split ( " " )
2575
2574
axis = p [1 ]
2576
2575
degrees = r [2 ]
2577
2576
2578
2577
result = (startFrame , endFrame , actionType , axis , degrees )
2579
2578
return result
2580
2579
elif actionType == "Fading" :
2581
2580
info = action [2 ]
2582
- q = string .split (info , ";" )
2583
- p = string . split ( q [0 ], " " )
2584
- r = string . split ( q [1 ], " " )
2585
- s = string . split ( q [2 ], " " )
2586
- u = string . split ( q [3 ], " " )
2581
+ q = info .split (";" )
2582
+ p = q [0 ]. split ( " " )
2583
+ r = q [1 ]. split ( " " )
2584
+ s = q [2 ]. split ( " " )
2585
+ u = q [3 ]. split ( " " )
2587
2586
molecule = p [len (p ) - 1 ]
2588
2587
representation = r [len (r ) - 1 ]
2589
2588
fadeFrom = s [len (s ) - 1 ]
@@ -2596,10 +2595,10 @@ def getActionValues(action):
2596
2595
return result
2597
2596
elif actionType == "Worm" :
2598
2597
info = action [2 ]
2599
- q = string .split (info , ";" )
2600
- p = string . split ( q [0 ], " " )
2601
- r = string . split ( q [1 ], " " )
2602
- s = string . split ( r [ len ( r ) - 1 ], "-" )
2598
+ q = info .split (";" )
2599
+ p = q [0 ]. split ( " " )
2600
+ r = q [1 ]. split ( " " )
2601
+ s = r [ - 1 ]. split ( "-" )
2603
2602
molecule = p [len (p ) - 1 ]
2604
2603
startAA = s [0 ]
2605
2604
endAA = s [1 ]
@@ -2973,23 +2972,23 @@ def get_frame_states(fstring):
2973
2972
1:1-10 # this is crap, don't know what happens
2974
2973
"""
2975
2974
2976
- t = string .split (fstring , ":" )
2975
+ t = fstring .split (":" )
2977
2976
frames = t [0 ] # the first token is frame range
2978
2977
if len (t ) == 2 :
2979
2978
states = t [1 ] # the second token is state range
2980
2979
else :
2981
2980
states = '1' # only state number 1 is used
2982
2981
2983
2982
# parse frame substring
2984
- t = string .split (frames , "-" )
2983
+ t = frames .split ("-" )
2985
2984
firstFrame = int (t [0 ]) # first token is starting frame
2986
2985
if len (t ) == 2 :
2987
2986
lastFrame = int (t [1 ]) # second token is end frame
2988
2987
else :
2989
2988
lastFrame = firstFrame # only one frame is used
2990
2989
2991
2990
# parse state substring
2992
- t = string .split (states , "-" )
2991
+ t = states .split ("-" )
2993
2992
firstState = int (t [0 ]) # first token is starting state
2994
2993
if len (t ) == 2 :
2995
2994
lastState = int (t [1 ]) # second token is end state
0 commit comments