Giter Site home page Giter Site logo

base64 encoded output about filetranspiler HOT 7 CLOSED

lbohnsac avatar lbohnsac commented on August 22, 2024
base64 encoded output

from filetranspiler.

Comments (7)

lbohnsac avatar lbohnsac commented on August 22, 2024 1

Just realised that we need a proper mimetype for the output ... therefor we need a file mimetype detection too

from filetranspiler.

ashcrow avatar ashcrow commented on August 22, 2024

@lbohnsac in terms of output do you mean on encoding files within the Ignition configuration or encoding the literal output of the file for a use case?

from filetranspiler.

lbohnsac avatar lbohnsac commented on August 22, 2024

Something like this but with a command line switch like -64:

diff filetranspile filetranspile.base64
13d12
< import base64
179,181d177
<         file_contents_bytes = file_contents.encode('utf-8')
<         file_contents_base64 = base64.b64encode(file_contents_bytes)
<         file_contents = file_contents_base64.decode('utf-8')
187c183
<                 'source': 'data:text/plain;charset=utf-8;base64,{}'.format(file_contents)
---
>                 'source': 'data:,{}'.format(quote(file_contents))
228,231d223
<         file_contents_bytes = file_contents.encode('utf-8')
<         file_contents_base64 = base64.b64encode(file_contents_bytes)
<         file_contents = file_contents_base64.decode('utf-8')
< 
237c229
<                 'source': 'data:text/plain;charset=utf-8;base64,{}'.format(file_contents)
---
>                 'source': 'data:,{}'.format(quote(file_contents))
326c318
< 
---
>

I have only limited python skills ...

from filetranspiler.

ashcrow avatar ashcrow commented on August 22, 2024

Ah I see. Sure I'll take a stab at it!

from filetranspiler.

lbohnsac avatar lbohnsac commented on August 22, 2024

The advantage is the possibility to drop binaries in the ignition file too

from filetranspiler.

lbohnsac avatar lbohnsac commented on August 22, 2024

two thumbs up! ;)

from filetranspiler.

ashcrow avatar ashcrow commented on August 22, 2024

In the PR we are discussing doing a slightly different pattern. PTAL.

from filetranspiler.

Related Issues (13)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.