Skip to content
This repository has been archived by the owner on Dec 25, 2022. It is now read-only.

Commit

Permalink
Merge pull request #75 from tubone24/openapi
Browse files Browse the repository at this point in the history
add write_image test
  • Loading branch information
tubone24 committed May 2, 2019
2 parents 567a7a5 + 473e934 commit 7d63998
Show file tree
Hide file tree
Showing 34 changed files with 16,371 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ebook_homebrew/rest.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
api = responder.API(
title="Ebook-homebrew",
debug=True,
cors=True,
version=__version__,
static_dir=os.path.join(os.path.dirname(os.path.abspath(__file__)), "static"),
static_route="/static",
Expand Down Expand Up @@ -159,7 +160,7 @@ def write_image(images_b64, extension, tmp_dir):
"""
for i, content in enumerate(images_b64):
image = base64.b64decode(content)
image = base64.b64decode(content.split(",")[-1])
file_name = os.path.join(tmp_dir, str(i) + "." + extension)
_logger.debug("file_name: {}".format(file_name))
with open(file_name, "wb") as image_file:
Expand Down
18 changes: 18 additions & 0 deletions examples/ebook-homebrew-vue-client/.babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"presets": [
["env", {
"modules": false,
"targets": {
"browsers": ["> 1%", "last 2 versions", "not ie <= 8"]
}
}],
"stage-2"
],
"plugins": ["transform-vue-jsx", "transform-runtime"],
"env": {
"test": {
"presets": ["env", "stage-2"],
"plugins": ["transform-vue-jsx", "transform-es2015-modules-commonjs", "dynamic-import-node"]
}
}
}
9 changes: 9 additions & 0 deletions examples/ebook-homebrew-vue-client/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
root = true

[*]
charset = utf-8
indent_style = space
indent_size = 2
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
5 changes: 5 additions & 0 deletions examples/ebook-homebrew-vue-client/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/build/
/config/
/dist/
/*.js
/test/unit/coverage/
29 changes: 29 additions & 0 deletions examples/ebook-homebrew-vue-client/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// https://eslint.org/docs/user-guide/configuring

module.exports = {
root: true,
parserOptions: {
parser: 'babel-eslint'
},
env: {
browser: true,
},
extends: [
// https://github.com/vuejs/eslint-plugin-vue#priority-a-essential-error-prevention
// consider switching to `plugin:vue/strongly-recommended` or `plugin:vue/recommended` for stricter rules.
'plugin:vue/essential',
// https://github.com/standard/standard/blob/master/docs/RULES-en.md
'standard'
],
// required to lint *.vue files
plugins: [
'vue'
],
// add your custom rules here
rules: {
// allow async-await
'generator-star-spacing': 'off',
// allow debugger during development
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off'
}
}
17 changes: 17 additions & 0 deletions examples/ebook-homebrew-vue-client/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
.DS_Store
node_modules/
/dist/
npm-debug.log*
yarn-debug.log*
yarn-error.log*
/test/unit/coverage/
/test/e2e/reports/
selenium-debug.log

# Editor directories and files
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
10 changes: 10 additions & 0 deletions examples/ebook-homebrew-vue-client/.postcssrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// https://github.com/michael-ciniawsky/postcss-load-config

module.exports = {
"plugins": {
"postcss-import": {},
"postcss-url": {},
// to edit target browsers: use "browserslist" field in package.json
"autoprefixer": {}
}
}
30 changes: 30 additions & 0 deletions examples/ebook-homebrew-vue-client/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# ebook-homebrew-vue-client

> Make pdf file which you use e-books by take in some image files such as jpeg, png and gif.
## Build Setup

``` bash
# install dependencies
npm install

# serve with hot reload at localhost:8080
npm run dev

# build for production with minification
npm run build

# build for production and view the bundle analyzer report
npm run build --report

# run unit tests
npm run unit

# run e2e tests
npm run e2e

# run all tests
npm test
```

For a detailed explanation on how things work, check out the [guide](http://vuejs-templates.github.io/webpack/) and [docs for vue-loader](http://vuejs.github.io/vue-loader).
7 changes: 7 additions & 0 deletions examples/ebook-homebrew-vue-client/config/dev.env.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
'use strict'
const merge = require('webpack-merge');
const prodEnv = require('./prod.env');

module.exports = merge(prodEnv, {
NODE_ENV: '"development"'
});
76 changes: 76 additions & 0 deletions examples/ebook-homebrew-vue-client/config/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
'use strict'
// Template version: 1.3.1
// see http://vuejs-templates.github.io/webpack for documentation.

const path = require('path')

module.exports = {
dev: {

// Paths
assetsSubDirectory: 'static',
assetsPublicPath: '/',
proxyTable: {},

// Various Dev Server settings
host: 'localhost', // can be overwritten by process.env.HOST
port: 8080, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
autoOpenBrowser: false,
errorOverlay: true,
notifyOnErrors: true,
poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions-

// Use Eslint Loader?
// If true, your code will be linted during bundling and
// linting errors and warnings will be shown in the console.
useEslint: true,
// If true, eslint errors and warnings will also be shown in the error overlay
// in the browser.
showEslintErrorsInOverlay: false,

/**
* Source Maps
*/

// https://webpack.js.org/configuration/devtool/#development
devtool: 'cheap-module-eval-source-map',

// If you have problems debugging vue-files in devtools,
// set this to false - it *may* help
// https://vue-loader.vuejs.org/en/options.html#cachebusting
cacheBusting: true,

cssSourceMap: true
},

build: {
// Template for index.html
index: path.resolve(__dirname, '../dist/index.html'),

// Paths
assetsRoot: path.resolve(__dirname, '../dist'),
assetsSubDirectory: 'static',
assetsPublicPath: '/',

/**
* Source Maps
*/

productionSourceMap: true,
// https://webpack.js.org/configuration/devtool/#production
devtool: '#source-map',

// Gzip off by default as many popular static hosts such as
// Surge or Netlify already gzip all static assets for you.
// Before setting to `true`, make sure to:
// npm install --save-dev compression-webpack-plugin
productionGzip: false,
productionGzipExtensions: ['js', 'css'],

// Run the build command with an extra argument to
// View the bundle analyzer report after build finishes:
// `npm run build --report`
// Set to `true` or `false` to always turn it on or off
bundleAnalyzerReport: process.env.npm_config_report
}
}
4 changes: 4 additions & 0 deletions examples/ebook-homebrew-vue-client/config/prod.env.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
'use strict'
module.exports = {
NODE_ENV: '"production"'
};
7 changes: 7 additions & 0 deletions examples/ebook-homebrew-vue-client/config/test.env.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
'use strict'
const merge = require('webpack-merge')
const devEnv = require('./dev.env')

module.exports = merge(devEnv, {
NODE_ENV: '"testing"'
})
12 changes: 12 additions & 0 deletions examples/ebook-homebrew-vue-client/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<title>ebook-homebrew-vue-client</title>
</head>
<body>
<div id="app"></div>
<!-- built files will be auto injected -->
</body>
</html>

0 comments on commit 7d63998

Please sign in to comment.