38 |
38 |
39 @param path path of the module to be analyzed |
39 @param path path of the module to be analyzed |
40 @type str |
40 @type str |
41 @return qualified name of the module |
41 @return qualified name of the module |
42 @rtype str |
42 @rtype str |
43 @exception InvalidModulePath raised to indicate an invalid module path |
43 @exception InvalidModulePathError raised to indicate an invalid module path |
44 """ |
44 """ |
45 (head, tail) = os.path.split(path) |
45 (head, tail) = os.path.split(path) |
46 if head == "" or tail == "": |
46 if head == "" or tail == "": |
47 raise InvalidModulePath( |
47 raise InvalidModulePathError( |
48 'Invalid python file path: "{0}"' " Missing path or file name".format(path) |
48 'Invalid python file path: "{0}"' " Missing path or file name".format(path) |
49 ) |
49 ) |
50 |
50 |
51 qname = [os.path.splitext(tail)[0]] |
51 qname = [os.path.splitext(tail)[0]] |
52 while head not in ["/", ".", ""]: |
52 while head not in ["/", ".", ""]: |