Initial Commit

This commit is contained in:
plane000
2018-07-17 14:57:52 +01:00
parent 2a9f73c5d5
commit 0d8f6c961a
216 changed files with 32763 additions and 0 deletions

35
print.js Normal file
View File

@@ -0,0 +1,35 @@
const PythonShell = require('python-shell');
const Result = require('./resultbuilder');
const WeatherAPI = require('./weatherAPI');
module.exports.print = async function(name, coords) {
let text = Result.genCompilerSettings({
padding: 2,
lineBreaks: 1,
lines: [
{
content: `Hello, ${name}!`,
align: `center`,
size: `large`
},
{
content: `The weather at ${coords} is:`,
align: `left`,
size: `small`
},
{
content: `${await WeatherAPI.getWeather(1, coords)}`,
align: `left`,
size: `small`
},
{
content: `The forcast for today is ${await WeatherAPI.getWeather(2, coords)}`,
align: `left`,
size: `small`
}
]
});
PythonShell.run('printer/write.py', text, function (err, results) {
if (err) throw err;
});
}