|
From: Kevin A. <al...@se...> - 2001-12-27 23:01:51
|
I managed to introduce a bug last night in the code for loading the default
resource file, but I've fixed it in cvs. If you try and use the samples
launcher with release 0.6 it won't work unless you change the __init__
method from PythonCardApp (model.py)
if aFileName == None:
base, ext = os.path.splitext(sys.argv[0])
aFileName = base + ".rsrc.py"
to
if aFileName == None:
filename = os.path.split(sys.argv[0])[-1]
base, ext = os.path.splitext(filename)
aFileName = base + ".rsrc.py"
ka
> -----Original Message-----
> From: pyt...@li...
> [mailto:pyt...@li...]On Behalf Of Kevin
> Altis
> Sent: Wednesday, December 26, 2001 7:19 PM
> To: pythoncard-Users
> Subject: [Pythoncard-users] alternative resource file loading fixed,
> plus an example
>
>
> I fixed the path handling in the __init__ method of PythonCardApp
> (model.py)
> for loading resource files other than the default and I added an
> example of
> this using an alternative resource file to the SourceForgeTracker sample:
>
> app = model.PythonCardApp(Tracker, 'SourceForgeTracker.original.rsrc.py')
>
> If the default layout for the SourceForgeTracker doesn't look good on your
> system, then you can uncomment the line above in the sample and use the
> alternative resource. Remember, that the normal behavior is to
> take the base
> name of the main app such as "SourceForgeTracker" and append a
> ".rsrc.py" to
> find the default resource file, but there is flexibility in how
> the loading
> is handled.
>
> Here's an example of how you could load different resource files based on
> the OS platform.
>
> if os.sys.platform[:3] == 'win':
> app = model.PythonCardApp(Tracker)
> else:
> # Linux, Mac, etc.
> app = model.PythonCardApp(Tracker,
> 'SourceForgeTracker.original.rsrc.py')
>
> You could even have different main classes for different
> platforms or to use
> while you're experimenting with different versions of your code.
>
> ka
>
>
> _______________________________________________
> Pythoncard-users mailing list
> Pyt...@li...
> https://lists.sourceforge.net/lists/listinfo/pythoncard-users
>
|