Skip to content

Commit 6c8057b

Browse files
Working on some improvements before release
1 parent a9e7d1e commit 6c8057b

File tree

6 files changed

+18
-27
lines changed

6 files changed

+18
-27
lines changed

.github/workflows/codesee-arch-diagram.yml

-22
This file was deleted.

.github/workflows/tests.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: sandbox-workflow
1+
name: sandboxapi
22

33
on: [push]
44

@@ -22,4 +22,4 @@ jobs:
2222
- name: Test scripts
2323
run: |
2424
coverage run -m unittest discover
25-
nosetests tests/*
25+
nosetests tests/*

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@ _build/
1010
/.virtualenv/
1111
/.pytest_cache/
1212
Pipfile.lock
13+
.DS_Store

README.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ sandboxapi
77
.. image:: https://app.travis-ci.com/InQuest/python-sandboxapi.svg?branch=master
88
:target: https://app.travis-ci.com/InQuest/python-sandboxapi
99
:alt: Build Status
10-
.. image:: https://github.com/InQuest/python-sandboxapi/workflows/sandbox-workflow/badge.svg?branch=master
10+
.. image:: https://github.com/InQuest/python-sandboxapi/workflows/sandboxapi/badge.svg?branch=master
1111
:target: https://github.com/InQuest/python-sandboxapi/actions
1212
:alt: Build Status (GitHub Workflow)
13-
.. image:: https://github.com/InQuest/python-sandboxapi/workflows/sandbox-workflow/badge.svg?branch=develop
13+
.. image:: https://github.com/InQuest/python-sandboxapi/workflows/sandboxapi/badge.svg?branch=develop
1414
:target: https://github.com/InQuest/python-sandboxapi/actions
1515
:alt: Build Status - Dev (GitHub Workflow)
1616
.. image:: https://readthedocs.org/projects/sandboxapi/badge/?version=latest

sandboxapi/joe.py

+12
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import json
2+
import magic
23
import jbxapi
4+
import mimetypes
35
import sandboxapi
46

57
class JoeAPI(sandboxapi.SandboxAPI):
@@ -26,6 +28,16 @@ def analyze(self, handle, filename):
2628
:rtype: str
2729
:return: Task ID as a string
2830
"""
31+
32+
# If no file extension is present, we try to identify the file type as an extra precaution for Joe
33+
try:
34+
ext = mimetypes.guess_extension(magic.Magic(mime=True).from_file(filename)) or ".txt"
35+
36+
if ext and not filename.lower().endswith(ext):
37+
filename = f"{filename}{ext}"
38+
except FileNotFoundError as e:
39+
pass
40+
2941
# ensure the handle is at offset 0.
3042
handle.seek(0)
3143

setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
setup(
1414
name='sandboxapi',
15-
version='1.7.1',
15+
version='1.8.0',
1616
include_package_data=True,
1717
packages=[
1818
'sandboxapi',

0 commit comments

Comments
 (0)