Ignore:
Timestamp:
Apr 22, 2010 11:00:36 AM (15 years ago)
Author:
Gervaise Alina <gervyh@…>
Branches:
master, ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc, costrafo411, magnetic_scatt, release-4.1.1, release-4.1.2, release-4.2.2, release_4.0.1, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
Children:
2b0443f
Parents:
e56869f
Message:

allow htlm file to show in mac too

File:
1 edited

Legend:

Unmodified
Added
Removed
  • calculatorview/perspectives/calculator/__init__.py

    r698a734 r85a24d9  
    1212    if os.path.isdir(path): 
    1313        return path 
    14  
    1514    # Check for data path next to exe/zip file. 
    1615    # If we are inside a py2exe zip file, we need to go up 
     
    1817    # We will check if the exe and the xsf are in the same 
    1918    # directory. 
    20     path= os.path.dirname(__file__) 
    21     n_dir = 4 
     19    path = os.path.dirname(__file__) 
     20    #Look for maximum n_dir up of the current dir to find media 
     21    n_dir = 12 
    2222    for i in range(n_dir): 
    23         path,_ = os.path.split(path) 
    24  
    25     path = os.path.join(path, '', media,'calculator_media' ) 
    26     if os.path.isdir(path): 
    27         return path 
    28     path = os.path.join(path, '', media) 
    29     if os.path.isdir(path): 
    30         return path 
     23        path, _ = os.path.split(path) 
     24        media_path = os.path.join(path, media) 
     25        if os.path.isdir(media_path): 
     26             module_media_path = os.path.join(media_path,'calculator_media') 
     27             if os.path.isdir(module_media_path): 
     28                 return module_media_path 
     29             return media_path 
     30    
    3131    raise RuntimeError('Could not find calculator media files') 
    3232 
Note: See TracChangeset for help on using the changeset viewer.