|
59 | 59 | import os |
60 | 60 | import sys |
61 | 61 | import random |
62 | | -import genutil |
63 | 62 | from cdms2.grid import AbstractRectGrid |
64 | 63 | import shutil, inspect |
65 | 64 | import VCS_validation_functions |
@@ -735,13 +734,16 @@ def _reconstruct_tv(self, arglist, keyargs): |
735 | 734 | _process_keyword(tv, 'name', 'name', keyargs, default=tv.id) |
736 | 735 | time = keyargs.get('time') |
737 | 736 | if time is not None: |
738 | | - ctime = time.tocomp() |
739 | | - ar.date = str(ctime) |
| 737 | + if isinstance(time,(str,unicode)): |
| 738 | + ctime = cdtime.s2c(str(time)) |
| 739 | + else: |
| 740 | + ctime = time.tocomp() |
| 741 | + tv.user_date = str(ctime) |
740 | 742 | _process_keyword(tv, 'units', 'units', keyargs) |
741 | 743 | _process_keyword(tv, 'date', 'ymd', keyargs) |
742 | 744 | # If date has still not been set, try to get it from the first |
743 | 745 | # time value if present |
744 | | - if not hasattr(tv, 'date') and not hasattr(tv, 'time'): |
| 746 | + if not hasattr(tv, 'user_date') and not hasattr(tv, 'date') and not hasattr(tv, 'time'): |
745 | 747 | change_date_time(tv, 0) |
746 | 748 |
|
747 | 749 | # Draw continental outlines if specified. |
@@ -885,8 +887,10 @@ def __init__(self, gui = 0, mode = 1, pause_time=0, call_from_gui=0, size=None, |
885 | 887 |
|
886 | 888 | is_canvas = len(vcs.return_display_names()[0]) |
887 | 889 |
|
| 890 | + ## TODO get rid of all these gui_canvas_closed I think the code is not even here anymore |
| 891 | + ## I believe it was for the old editor style |
888 | 892 | if gui_canvas_closed == 1: |
889 | | - showerror( "Error Message to User", "There can only be one VCS Canvas GUI opened at any given time and the VCS Canvas GUI cannot operate with other VCS Canvases.") |
| 893 | + raise RuntimeError("There can only be one VCS Canvas GUI opened at any given time and the VCS Canvas GUI cannot operate with other VCS Canvases.") |
890 | 894 | return |
891 | 895 |
|
892 | 896 | self.winfo_id = -99 |
|
0 commit comments