Hot-keys on this page

r m x p   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

import os 

import sys 

 

 

def get(): 

    """ Returns the path for the resources. """ 

    launch_path = os.path.realpath(sys.path[0]) 

    if launch_path.startswith("/usr/local"): 

        data_path = '/usr/local/share/lutris' 

    elif launch_path.startswith("/usr"): 

        data_path = '/usr/share/lutris' 

    elif os.path.exists(os.path.normpath(os.path.join(sys.path[0], 'data'))): 

        data_path = os.path.normpath(os.path.join(sys.path[0], 'data')) 

    else: 

        import lutris 

        data_path = os.path.dirname(lutris.__file__) 

    if not os.path.exists(data_path): 

        print("data_path can't be found at : %s" % data_path) 

        exit() 

    return data_path