Chapter 4
Chapter 6

5.- Executing the project.

We'll create a new file into the project -and repository- which will help to run the app.
To do so, create a new file, name it main.py, and write down the code as follows:

#!/usr/bin/python
        
from PyQt4.QtGui import QApplication
from ui.MainWindow import MainWindow

def main():
    import sys
    app = QApplication(sys.argv)
    wnd = MainWindow()
    wnd.show()
    sys.exit(app.exec_())

if __name__ == '__main__':
    main()
        

This file must be saved at root directory level.
Go to Project/Properties and set main.py as main script for the project.
Add main.py to the repository, the same way we have been doing for the other files.
To run the project, select menu Start/Run project. A dialog is shown, you must provide the working directory (C:\tmp\LogParser in my machine), the Command line (main.py) and that's pretty much all.
Clicking on the Ok button should run the application.
The next image shows the app running.

First, I opened a log file, and then applied a regexp something like UserId=xxx, as I know that there are a number of HTTP requests that send this info via GET (and therefore IIS does log it). That's a bad programming practice, I know, but we are not going to discuss it now :-).
After having filtered records this way, I applied a new regexp, something like asp.*128.128.206.11 (which is the ip address for user xxx).
This screenshot shows the result of filtering records to show only requests for asp pages that were made by the user whith this ip address.
Unfolding the elements, you find yourself being able to follow along the entire 'http conversation'. This screen solved the issue for me: in the case of the new feature for the web app I had implemented, every user was expected to start the application via the page default.asp.
But it has finally turned out that plenty of users (the ones for which the app doesn't work as expected) are starting throught noentryaccess.asp. That's why it wasn't working properly!

Chapter 4
Chapter 6