qgis/QGIS — pull request #1345 by NathanW2 (2014-05-11 11:06:02+00:00)
Title: Rename Python modules to qgis._core, qgis._gui etc.

- Add normal Python files for modules
- Import * from new _ modules

These modules just really import * from the underlying _ modules which maintains API.

Having normal Python modules here allows us to add some convenience methods to the Python API that would be harder do in SIP. An example is moving `qgsfunction` from `qgis.utils` as it really belongs in `qgis.core`

Another example is a Python context manager to create a QgsApplication instance, this will go in `qgis.core`

```
@contextmanager
def qgisapp(args=None, guienabled=True, configpath=None):
import sys
if not args:
args = []
app = QgsApplication(args, guienabled, configpath)
QgsApplication.initQgis()
yield app
if guienabled:
exitcode = app.exec_()
else:
exitcode = 0
QgsApplication.exitQgis()
sys.exit(exitcode)
```

Example usage

```
with qgisapp() as app:
dlg = QMainWindow()
dlg.show()
```