Skip to content

Commit

Permalink
Make the code handle different directory structures better (if you ha…
Browse files Browse the repository at this point in the history
…d two pywinauto folders in the path - then it was taking the first to be the pywinauto root - while in fact it should be the last one)
  • Loading branch information
markm committed Dec 19, 2010
1 parent 2e789bb commit 121d843
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions doc_src/build_autodoc_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,12 @@

filepath = os.path.join(root, filename)

modulename = filepath.split("\\")
modulename = modulename[modulename.index('pywinauto'):]

# remove extension
modulename[-1] = modulename[-1][:-3]
# find the last instance of 'pywinauto'
modulename = 'pywinauto' + filepath.rsplit("pywinauto", 1)[1]
modulename = os.path.splitext(modulename)[0]
modulename = modulename.replace('\\', '.')

modulename = ".".join(modulename)


out = open(doc_source_filename, "w")

Expand Down

0 comments on commit 121d843

Please sign in to comment.