Permalink
Browse files

First steps towards switch to Python3.6+Virtualenv and PyQt5

  • Loading branch information...
cederom committed Feb 6, 2017
1 parent 2d88d2f commit b2304dfc317d387034304437bce08410fd54576e
Showing with 138 additions and 23 deletions.
  1. +50 −23 README.md
  2. +78 −0 doc/virtualenv.md
  3. +3 −0 iCeDeROM.sh
  4. +3 −0 requirements.txt
  5. +4 −0 venv.sh
View
@@ -13,45 +13,72 @@ iCeDeROM was started by Tomasz Bolesław CEDRO (http://www.tomek.cedro.info) in
# Features
## Available Features
* Qt4 GUI: MDI (Multiple Document Interface) for modules windows, Panels for configuration, etc.
* Logging: loglevels, file output, QtWidget output.
* Python Console: buil-it python interpreter with access to all modules, QtWidget CLI.
* Interface: various hardware interface infrastructure, QtWidget configuration.
* Terminal: Serial Console Port terminal, QtWidget CLI.
[X] Python 2.7
[ ] Switch to Python 3.6.
[ ] Run all from Virtualenv.
[ ] Automate Python+Virtualenv+Dependencies setup.
[X] Qt4 GUI: MDI (Multiple Document Interface) for modules windows, Panels for configuration, etc.
[ ] Switch to PyQt5.
[X] Logging: loglevels, file output, QtWidget output.
[X] Python Console: buil-it python interpreter with access to all modules, QtWidget CLI.
[X] Interface: various hardware interface infrastructure, QtWidget configuration.
[X] Terminal: Serial Console Port terminal, QtWidget CLI.
## Planned Features
* Common iCeDeROM API.
* No GUI operaitons (i.e. shell only).
* Python scripts automation.
* Interface Bitbang.
* Transport Layer between Target Device and Interface Layer.
* Various Hardware Interfaces support.
* Memory buffer, chunk-based.
* Hex Editor.
* JTAG Support.
* SWD Support.
* MIPS CPU Support.
* ARM CPU Support.
* Intel CPU Support.
* Debugging.
* Memory Analysis.
[ ] Common iCeDeROM API.
[ ] No GUI operaitons (i.e. shell only).
[ ] Python scripts automation.
[ ] Interface Bitbang.
[ ] Transport Layer between Target Device and Interface Layer.
[ ] Various Hardware Interfaces support.
[ ] Memory buffer, chunk-based.
[ ] Hex Editor.
[ ] JTAG Support.
[ ] SWD Support.
[ ] MIPS CPU Support.
[ ] ARM CPU Support.
[ ] Intel CPU Support.
[ ] Debugging.
[ ] Memory Analysis.
# Requirements, Dependencies, Hardware
## Python Virtual Environment
Soon, a switch from Python2.7 to Python3.6 is planned. That would help
keeping all dependencies coherent and independent from underlying
operating system packages. See [Virtualenv](doc/virtualenv.md) manual
for more information.
* Python Virtualenv location is assumed to be `../venv/default/bin/python`
* `venv.sh` script will bring you inside virtualenv for testing.
* `iCeDeROM.sh` script will launch application using virtualenv.
## Software Dependencies
* Python 2.7
* PyQt4
* Python 2.7 (soon switching to Python3.6)
* PyQt4 (soon switching to PyQt5)
* GitPython (download with pip)
* pyLibFTDI (download with pip)
A dedicated [requirements.txt](requirements.txt) file has been provided
that will help you install dependencies with `pip`:
```
pip install -r requirements.txt
```
## Supported Hardware
* FTDI USB Dongles - using LibFTDI wrapper
* Serial Console Port
* Manual and Preset Configuration (presets available for <a href="http://shop.kristech.pl/p/24/257/kt-link-.html" target="_blank">KT-LINK</a>)
## Documentation
* [Virtualenv](doc/virtualenv.md): Python Virtual Environment Reference Manual.
## Developer's Scratchpad
@@ -267,5 +294,5 @@ class module(QtGui.QWidget):
3. Mordechai Guri, Yuri Poliak , Bracha Shapira, Yuval Elovici, ["JoKER: Trusted Detection of Kernel Rootkits in Android Devices via JTAG Interface"](http://arxiv.org/ftp/arxiv/papers/1512/1512.04116.pdf), Trustcom/BigDataSE/ISPA, 2015 IEEE (Volume:1), 20-22 Aug. 2015, 65 - 73, INSPEC Accession Number: 15635781. DOI: 10.1109/Trustcom.2015.358.
*iCeDeROM (C) 2014-2015 CeDeROM, Tomasz Bolesław CEDRO (http://www.tomek.cedro.info), All rights reserved! :-)*
*iCeDeROM (C) 2014-2017 CeDeROM, Tomasz Bolesław CEDRO (http://www.tomek.cedro.info), All rights reserved! :-)*
View
@@ -0,0 +1,78 @@
# Python Virtual Environment Reference Manual
This short document presents virtualenv setup guide for iCeDeROM project.
In short words **Virtualenv** is a dedicated and independent **container**
for **Python Application** along with its **Dependencies**.
Different Operating Systems may be bundled with different versions of
Python and different set of available packages by default.
This makes project **deployment** and **maintenance** difficult,
if possible at all.
This is why we want to create from scratch dedicated environment
that we can control.
**Virtualenv** is here to make it happen in an **automated** way.
## Using Virtualenv
iCeDeROM project contains several scripts that will make it easier
for you develop, test, and deploy it using provided Virtualenv.
Assuming that you already did a successful setup of Virtualenv:
* `venv.sh` script will take you inside `bash` shell with target python
environment in path, so you can test some code.
* `iCeDeROM.sh` script will launch the application using virtualenv.
## Creating Virtualenv
* We are using the `Python 3.6` interpreter and so `python3.6 -m venv`.
* You can get Python [directly
from the Python Project Website]
(https://www.python.org/downloads/) or using your
Operating System Package Management.
* iCeDeROM assumes virtualenv location at `../venv/default/` from the
project root (that is where `venv.sh` is located). This location is important!
* If you work with [PyCharm IDE](https://www.jetbrains.com/pycharm/) go to `Preferences / Project / Interpreter`
and use creator to make all work for you.
* You can create Virtualenv from a Terminal:
```
$ mkdir ../venv
$ python3.6 -m venv ../venv/macos-python-3.6
$ ln -s macos-python-3.6 ../venv/default
```
* You can have multiple instances of virtualenv in `../venv` directory,
for instance when you develop on [MacOS](https://en.wikipedia.org/wiki/MacOS)
and deploy on [FreeBSD](https://en.wikipedia.org/wiki/FreeBSD),
just remember to link the one you need as `default`.
* Virtualenv shell requires `bash` to run.
* You can test your setup with:
```
$ pwd
/(...)/iCeDeROM/iCeDeROM.git
$ ./venv.sh
(macos-python-3.6) pwd
/(...)/iCeDeROM/iCeDeROM.git
(macos-python-3.6) which python
/(...)/iCeDeROM/venv/macos-python-3.6/bin/python
(macos-python-3.6) python
Python 3.6.0 (default, Dec 23 2016, 12:50:55)
[GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.38)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>>
```
## Installing dependencies
After you have installed the virtualenv you need to install project
dependencies, that is libraries and modules that the project depends on.
Here is an example:
```
$ ./venv.sh
(macos-python-3.6) pip install -r requirements.txt
...
```
<hr/>
<sup>(C) 2017 [CeDeROM Tomasz CEDRO](http://www.tomek.cedro.info), All rights reserved! :-)</sup>
View
@@ -0,0 +1,3 @@
#!/bin/sh
source ../venv/default/bin/activate
python iCeDeROM.py
View
@@ -0,0 +1,3 @@
PyQt5
gitpython
pylibftdi
View
@@ -0,0 +1,4 @@
#!/usr/bin/env bash
#MAKE SURE BELOW SCRIPT MATCHES YOUR ENVIRONMENT SETUP!
source ../venv/default/bin/activate
/usr/bin/env bash

0 comments on commit b2304df

Please sign in to comment.