Skip to content

Commit

Permalink
Fiat lux.
Browse files Browse the repository at this point in the history
  • Loading branch information
nzblnk committed Feb 27, 2017
1 parent 8266f92 commit 5443548
Show file tree
Hide file tree
Showing 18 changed files with 2,082 additions and 1 deletion.
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.idea/
dist/
*.iml
*.nzb
*.cfg
*.pyc
26 changes: 25 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,25 @@
# nzb-monkey
# NZB Monkey

Reference implementation of how to handle a [NZBLNK](https://nzblnk.github.io/)-URI.

## Runing the monkey

See detailed information [here](https://nzblnk.github.io/nzb-monkey/).

## Build the windows binary

Use a **32-bit python v3.4** and install all requirements:

`pip install -r requirements-build.txt `

To build the EXE just call:

`make_windows.cmd`

## Contribution

Feel free to send pull requests.

### macOS Support

We still need someone who gives this monkey wings on macOS.
17 changes: 17 additions & 0 deletions make_linux.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash
echo "Create NZB-Monkey source package..."
VERSION=$(grep -m 1 -Po "__version__ = '\K[^']*" src/version.py)
DESTINATION="nzbmonkey-v${VERSION}-linux"
DISTDIR=$PWD/dist
mkdir $DISTDIR 2>/dev/null

echo "$DESTINATION"
mkdir /tmp/$DESTINATION
cp src/*.py /tmp/$DESTINATION
cp src/LICENSE /tmp/$DESTINATION

cd /tmp
tar -cjf "$DISTDIR/$DESTINATION.tbz2" $DESTINATION

rm -rf $DESTINATION
cd $OLDPWD
17 changes: 17 additions & 0 deletions make_windows.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
@echo off

py -3 -c "import sys;exit(2 if sys.maxsize > 2**32 else 1)"
if errorlevel 2 goto SIXTYFOUR

set DIR=%CD%
cd %~dp0
set PYTHONPATH=./src
py -3 setup.py py2exe
cd %DIR%
goto EOF

:SIXTYFOUR
echo.
echo Please run with a 32-bit python.
:EOF
timeout 5
6 changes: 6 additions & 0 deletions requirements-build.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
pyperclip
requests
configobj
colorama
cryptography
py2exe
5 changes: 5 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
pyperclip
requests
configobj
colorama
cryptography
Binary file added resource/nzb-monkey-128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resource/nzb-monkey-16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resource/nzb-monkey-32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resource/nzb-monkey-48.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resource/nzb-monkey-icons.ico
Binary file not shown.
1 change: 1 addition & 0 deletions resource/nzb-monkey.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
52 changes: 52 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import sys
import datetime
from distutils.core import setup

try:
import py2exe
except ImportError:
if len(sys.argv) >= 2 and sys.argv[1] == 'py2exe':
print("Cannot import py2exe, please install!", file=sys.stderr)
exit(1)

# Load version
exec(compile(open('src/version.py').read(), 'src/version.py', 'exec'))

params = {
'console': [{
"script": "./src/nzbmonkey.py",
"dest_base": "nzbmonkey",
"icon_resources": [(0, "./resource/nzb-monkey-icons.ico")],
"product_name": "NZB-Monkey™",
"version": __version__,
"company_name": "NZBLNK, Inc.",
"copyright": "© %d, NZBLNK, Inc." % datetime.datetime.now().year
}],
'options': {
"py2exe": {
"bundle_files": 1,
"compressed": 1,
"optimize": 2,
'includes': 'nzblnkconfig',
'excludes': ['doctest','pdb','unittest','difflib','inspect'],
"dist_dir": 'dist'
}
},
'zipfile': None
}

setup(
name='nzb-monkey-py',
version=__version__,
packages=[''],
url='',
license='',
author='',
author_email='',
description='',
requires=__requires__,
**params
)
21 changes: 21 additions & 0 deletions src/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2017 NZBLNK

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Loading

0 comments on commit 5443548

Please sign in to comment.