Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
mrprompt committed Sep 18, 2020
0 parents commit ff3b78f
Show file tree
Hide file tree
Showing 11 changed files with 792 additions and 0 deletions.
57 changes: 57 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]

# C extensions
*.so

# Distribution / packaging
.Python
env/
build/
develop-eggs/
dist/
downloads/
eggs/
lib/
lib64/
parts/
sdist/
var/
*.egg-info/
.installed.cfg
*.egg

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.cache
nosetests.xml
coverage.xml

# Translations
*.mo
*.pot

# Django stuff:
*.log

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# OS X
.DS_Store
12 changes: 12 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
language: python
python:
- "3.8"
install:
- "pip install coveralls"
- "pip install -e .[test]"
script:
- py.test
- coverage run --source=uploader -m py.test
after_success:
- coveralls
sudo: false
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# BRAMON - Uploader

Sync directory to BRAMON API.

## Instalação

```
pip install -e .
```

## Uso

```console
export API_TOKEN=<token>

uploader <directorio> <stations.json>
```
5 changes: 5 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[egg_info]
tag_build = dev

[upload]
dry-run = 1
34 changes: 34 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
from codecs import open as codecs_open
from setuptools import setup, find_packages

# Get the long description from the relevant file
with codecs_open('README.md', encoding='utf-8') as f:
long_description = f.read()

setup(name='uploader',
version='0.0.1',
description=u"Image uploader.",
long_description=long_description,
classifiers=[],
keywords='image,uploader',
author=u"Thiago Paes",
author_email='mrprompt@gmail.com',
url='https://github.com/bramon-org/uploader-sync',
license='MIT',
packages=find_packages(exclude=['ez_setup', 'examples', 'tests']),
include_package_data=True,
zip_safe=False,
install_requires=[
'click',
],
extras_require={
'test': [
'pytest',
'requests'
],
},
entry_points="""
[console_scripts]
uploader=uploader.scripts.cli:cli
"""
)
9 changes: 9 additions & 0 deletions tests/test_cli.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
from click.testing import CliRunner
from uploader.scripts.cli import cli


def test_cli_count():
runner = CliRunner()
result = runner.invoke(cli, ['./', '*P.jpg', 'output.jpg'])
assert result.exit_code == 0
assert result.output == "- Reading captures\n- Nothing to do\n"
Empty file added uploader/__init__.py
Empty file.
7 changes: 7 additions & 0 deletions uploader/data/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import os

BASE_PATH = os.path.dirname(__file__)
# API_URL = 'http://local-api.bramonmeteor.org/v1/operator/captures'
API_URL = 'https://api.bramonmeteor.org/v1/operator/captures'
API_TOKEN = os.environ.get('API_TOKEN')
STATIONS_MAP = "{}/../data/stations.json".format(BASE_PATH)
Loading

0 comments on commit ff3b78f

Please sign in to comment.