Skip to content

Commit 6b81b53

Browse files
authored
Merge pull request #96 from javaTheHutts/Develop
Merging into Master. This is the start of something new.
2 parents f10d016 + fc95c93 commit 6b81b53

File tree

98 files changed

+5937
-271
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

98 files changed

+5937
-271
lines changed

.gitignore

Lines changed: 67 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,4 +277,70 @@ ENV/
277277
/site
278278

279279
# mypy
280-
.mypy_cache/
280+
.mypy_cache/
281+
282+
### PyCharm ###
283+
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm
284+
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
285+
286+
# User-specific stuff:
287+
.idea/**/workspace.xml
288+
.idea/**/tasks.xml
289+
.idea/dictionaries
290+
291+
# Sensitive or high-churn files:
292+
.idea/**/dataSources/
293+
.idea/**/dataSources.ids
294+
.idea/**/dataSources.xml
295+
.idea/**/dataSources.local.xml
296+
.idea/**/sqlDataSources.xml
297+
.idea/**/dynamic.xml
298+
.idea/**/uiDesigner.xml
299+
300+
# Gradle:
301+
.idea/**/gradle.xml
302+
.idea/**/libraries
303+
304+
# CMake
305+
cmake-build-debug/
306+
307+
# Mongo Explorer plugin:
308+
.idea/**/mongoSettings.xml
309+
310+
## File-based project format:
311+
*.iws
312+
313+
## Plugin-specific files:
314+
315+
# IntelliJ
316+
/out/
317+
318+
# mpeltonen/sbt-idea plugin
319+
.idea_modules/
320+
321+
# JIRA plugin
322+
atlassian-ide-plugin.xml
323+
324+
# Cursive Clojure plugin
325+
.idea/replstate.xml
326+
327+
# Crashlytics plugin (for Android Studio and IntelliJ)
328+
com_crashlytics_export_strings.xml
329+
crashlytics.properties
330+
crashlytics-build.properties
331+
fabric.properties
332+
333+
### PyCharm Patch ###
334+
# Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721
335+
336+
# *.iml
337+
# modules.xml
338+
# .idea/misc.xml
339+
# *.ipr
340+
341+
# Sonarlint plugin
342+
.idea/sonarlint
343+
344+
### Editor specific
345+
.idea
346+
.vscode

.travis.yml

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,24 @@
11
language: python
22
python:
33
- "3.5"
4-
# command to install dependencies
5-
install: "pip install -r requirements.txt"
6-
# command to run tests
7-
script: pytest
4+
dist: "trusty"
5+
# packages to install before anything else
6+
before_install:
7+
- sudo apt-get -qq update
8+
- sudo apt-get install -y build-essential cmake pkg-config
9+
- sudo apt-get install -y libjpeg8-dev libtiff4-dev libjasper-dev libpng12-dev
10+
- sudo apt-get install -y libatlas-base-dev gfortran
11+
- sudo apt-get install -y libboost-all-dev
12+
- sudo apt-get install -y tesseract-ocr
13+
- pip3.5 install pybuilder
14+
# commands to install dependencies
15+
install:
16+
- pip3.5 install -r requirements.txt
17+
- sudo apt-get install -y libzbar0
18+
- sudo apt-get install -y libzbar-dev
19+
- pip3.5 install pyzbar==0.1.4
20+
- pip3.5 install pyzbar[scripts]
21+
- pip3.5 install zbar-py==1.0.4
22+
- pyb install_dependencies
23+
# command to build project
24+
script: pyb analyze publish

LICENSE.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
BSD 3-Clause License
2+
3+
Copyright (c) 2017, Java The Hutts
4+
All rights reserved.
5+
6+
Redistribution and use in source and binary forms, with or without
7+
modification, are permitted provided that the following conditions are met:
8+
9+
* Redistributions of source code must retain the above copyright notice, this
10+
list of conditions and the following disclaimer.
11+
12+
* Redistributions in binary form must reproduce the above copyright notice,
13+
this list of conditions and the following disclaimer in the documentation
14+
and/or other materials provided with the distribution.
15+
16+
* Neither the name of the copyright holder nor the names of its
17+
contributors may be used to endorse or promote products derived from
18+
this software without specific prior written permission.
19+
20+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
23+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
24+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
26+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
27+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
28+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

README.md

Lines changed: 71 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,77 @@
11
# Java-the-Hutts
22

33
<a href="https://zenhub.com"><img src="https://raw.githubusercontent.com/ZenHubIO/support/master/zenhub-badge.png"></a>
4+
[![Build Status](https://travis-ci.org/javaTheHutts/Java-the-Hutts.svg?branch=Develop)](https://travis-ci.org/javaTheHutts/Java-the-Hutts)
5+
![](https://reposs.herokuapp.com/?path=javaTheHutts/Java-the-Hutts&style=flat)
6+
[![PyPI](https://img.shields.io/pypi/l/Django.svg)]()
47

5-
[![Build Status](https://travis-ci.org/javaTheHutts/Java-the-Hutts.svg?branch=master)](https://travis-ci.org/javaTheHutts/Java-the-Hutts)
8+
Repository for the Java the Hutts team for COS301.
69

7-
[![PyPI](https://img.shields.io/pypi/l/Django.svg)]()
10+
## Setup of development environment
11+
You will need to install the following pacakges:
12+
13+
- `virtualenv`
14+
- `pip3.5`
15+
- `python3.5`
16+
17+
To set up the development environment and be able to use `pybuilder`, execute the following commands:
18+
19+
1. `cd` into this repository.
20+
2. `virtualenv -p python3.5 venv` (this creates a virtual environment to work in)
21+
3. `source venv/bin/activate` (this activates the virtual environment in order to use the commands available to it, specifically **PyBuilder**)
22+
4. `pip3.5 install pybuilder` (installs `pybuilder`).
23+
5. `pyb install_dependencies` (installs the necessary dependencies for pybuilder)
24+
6. `pyb` (builds the python project)
25+
26+
When you are finished developing in this environment, simply call `deactivate` in order to exit the virtual environment.
27+
28+
## Building and installing the project
29+
1. Execute `source venv/bin/activate` (you need only do this once in order to enter your virtual environment).
30+
2. Execute `make` in the root folder (the folder where `build.py` and `makefile` is located). This builds the project, runs the unit tests, runs the integration tests, lints the files and creates a portable distribution of the project ready for installation, and installs it in the Python environment.
31+
32+
### Extra tasks
33+
- If you only want to lint the project, run `make lint`.
34+
- If you only want to run the unit tests, run `make utest`.
35+
- For only integration testing, run `make itest`.
36+
- To run both sets of tests only, run `make test`.
37+
- To skip the linting, run `make build`. This will build and run the tests without linting the files.
38+
39+
Once you are finished, execute the command `deactivate` in order to exit your virtual environment.
40+
41+
## Starting the server
42+
1. After building and installing the project, run the script `run.py` in the scripts directory to start the server hosting the API.
43+
2. Requests can then be sent to `http://127.0.0.1:5000/` to use the API.
44+
3. Refer to the User Manual under `documentation/user-manual` for detailed instructions regarding requests, parameters and return types.
45+
46+
## Directory structure
47+
```
48+
.
49+
├── documentation
50+
├── src
51+
│   ├── integrationtest
52+
│   │   └── python
53+
│   ├── main
54+
│   │   ├── python
55+
│   │   └── scripts
56+
│   └── unittest
57+
│   └── python
58+
├── target
59+
│   ├── dist
60+
│   └── reports
61+
└── venv
62+
```
63+
64+
- All the Python packages and commands necessary for the system can be found in `venv`. This directory and its contents is generated when you create your virtual environment. It should not be necessary for you to edit anything within this directory.
65+
- `documentation` contains the documentation of the system. This includes all the LateX and PDF files.
66+
- `target` is generated each time the `pyb` command executed. This directory contains all the generated source code in a structure that is generally used to distribute and install Python applications. Any changes you make here will not be saved when you rebuild the project.
67+
- `dist` contains the portable distribution and generated source code of the application.
68+
- `reports` contains all the different reports generated by the unit testing, integration testing and code coverage modules.
69+
- `src` is where all the source code and resources for the application is stored. This includes runnable scripts, classes, unit tests, integration tests, images, etc.
70+
- `integrationtest/python` is where all the integration tests can be found. Each file should start with the prefix `itest_` followed by the rest of the filename.
71+
- `unittest/python` is where all the unit tests can be found. Each file should start with the prefix `test_` followed by the rest of the filename.
72+
- `main/python` is where all the main source code for the application can be found, such as class and function definitions.
73+
- `main/scripts` contains all the runnable scripts for the application. This is where you will typically find the entry-point into the application.
874

9-
Repository for the Java the Hutts team for COS301
75+
## Important files
76+
- `build.py` contains the configuration used by PyBuilder to build the project. Any plugins and customized build settings are contained in this file.
77+
- `README.md`. This file explains how the entire system should be built and used. Refer to it before asking any questions about the build process.

0 commit comments

Comments
 (0)