pinnwand/command.py
def add(lexer: str) -> None:
    """Add a paste to pinnwand's database from stdin."""
    if lexer not in utility.list_languages():
        log.error("add: unknown lexer")
        return

    paste = database.Paste(
        sys.stdin.read(), lexer=lexer, expiry=timedelta(days=1)
    )

    with database.session() as session:
        session.add(paste)
        session.commit()

    log.info("add: paste created: %s", paste.paste_id)
Add a paste to pinnwand's database from stdin.
Add a paste to pinnwand's database from stdin.
Add a paste to pinnwand ' s database from stdin .
def add(lexer: str) -> None:
    if lexer not in utility.list_languages():
        log.error("add: unknown lexer")
        return
    paste = database.Paste(
        sys.stdin.read(), lexer=lexer, expiry=timedelta(days=1)
    )
    with database.session() as session:
        session.add(paste)
        session.commit()
    log.info("add: paste created: %s", paste.paste_id)
def add ( lexer : str ) -> None : if lexer not in utility . list_languages ( ) : log . error ( "add: unknown lexer" ) return paste = database . Paste ( sys . stdin . read ( ) , lexer = lexer , expiry = timedelta ( days = 1 ) ) with database . session ( ) as session : session . add ( paste ) session . commit ( ) log . info ( "add: paste created: %s" , paste . paste_id )
Add a paste to pinnwand's database from stdin.
Add a paste to pinnwand ' s database from stdin .
"""Add a paste to pinnwand's database from stdin."""
lexer
str