version 2.0 finalized

This commit is contained in:
Peter Molnar 2017-12-17 17:37:32 +00:00
parent 69943e41cd
commit 38fdc6bd33
7 changed files with 160 additions and 36 deletions

View file

@ -1,3 +1,34 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# vim: set fileencoding=utf-8 :
__author__ = "Peter Molnar"
__copyright__ = "Copyright 2017, Peter Molnar"
__license__ = "GPLv3"
__version__ = "2.0"
__maintainer__ = "Peter Molnar"
__email__ = "hello@petermolnar.eu"
__status__ = "Production"
"""
silo archiver module of NASG
Copyright (C) 2017 Peter Molnar
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
"""
import os import os
import json import json
import requests import requests

29
nasg.py
View file

@ -1,4 +1,33 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# vim: set fileencoding=utf-8 :
__author__ = "Peter Molnar"
__copyright__ = "Copyright 2017, Peter Molnar"
__license__ = "GPLv3"
__version__ = "2.0"
__maintainer__ = "Peter Molnar"
__email__ = "hello@petermolnar.eu"
__status__ = "Production"
"""
silo archiver module of NASG
Copyright (C) 2017 Peter Molnar
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
"""
import os import os
import re import re

View file

@ -1,5 +1,33 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# vim: set fileencoding=utf-8 :
__author__ = "Peter Molnar"
__copyright__ = "Copyright 2017, Peter Molnar"
__license__ = "GPLv3"
__version__ = "2.0"
__maintainer__ = "Peter Molnar"
__email__ = "hello@petermolnar.eu"
__status__ = "Production"
"""
silo archiver module of NASG
Copyright (C) 2017 Peter Molnar
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
"""
from sanic import Sanic from sanic import Sanic
import sanic.response import sanic.response
from sanic.log import log as logging from sanic.log import log as logging

View file

@ -1,3 +1,34 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# vim: set fileencoding=utf-8 :
__author__ = "Peter Molnar"
__copyright__ = "Copyright 2017, Peter Molnar"
__license__ = "GPLv3"
__version__ = "2.0"
__maintainer__ = "Peter Molnar"
__email__ = "hello@petermolnar.eu"
__status__ = "Production"
"""
silo archiver module of NASG
Copyright (C) 2017 Peter Molnar
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
"""
import configparser import configparser
import os import os
import re import re
@ -264,27 +295,6 @@ class BaseDB(object):
cursor.execute('PRAGMA auto_vacuum;') cursor.execute('PRAGMA auto_vacuum;')
self.db.close() self.db.close()
# class TokenDBng(BaseDB):
# def __init__(self):
#self.fpath = config.get('var', 'tokendb')
# super().__init__(self.fpath)
#cursor = self.db.cursor()
# cursor.execute('''
# CREATE TABLE IF NOT EXISTS `tokens` (
#`service` TEXT PRIMARY KEY NOT NULL UNIQUE,
#`timestamp` TIMESTAMP NOT NULL DEFAULT (strftime('%s', 'now'))
#`oauth_token` TEXT NOT NULL,
#`oauth_token_secret` TEXT NOT NULL,
#`access_token` TEXT NOT NULL,
#`access_token_secret` TEXT NOT NULL,
#`verifier` TEXT NOT NULL
#);
#''')
# self.db.commit()
# TODO class SearchDBng(object):
# TODO class EXIFDBng(object):
class TokenDB(object): class TokenDB(object):
def __init__(self, uuid='tokens'): def __init__(self, uuid='tokens'):
@ -576,8 +586,9 @@ def __setup_sitevars():
for o in config.options(section): for o in config.options(section):
SiteVars.update({o: config.get(section, o)}) SiteVars.update({o: config.get(section, o)})
# TODO this should be a nice recursive function instead # this should be a nice recursive function instead
# extra site section # extra site section - nope, because it relies on order
# and author won't get appended
for section in config.get('site', 'appendwith').split(): for section in config.get('site', 'appendwith').split():
SiteVars.update({section: {}}) SiteVars.update({section: {}})
for o in config.options(section): for o in config.options(section):

View file

@ -76,11 +76,10 @@
{% endif %} {% endif %}
</p> </p>
<ul> <ul>
{% for value in [3] %}
{% for name, url in site.payment.items() %} {% for name, url in site.payment.items() %}
<li> <li>
<a rel="payment" title="pay {{ site.author.name }} via {{ name }} {{ site.currency }}{{ value }}" href="{{ url }}{{value}}"> <a rel="payment" title="pay {{ site.author.name }} via {{ name }} {{ site.donation.currency }}{{ site.donation.amount }}" href="{{ url }}{{ site.donation.amount }}">
{{ site.currency }}{{value}} {{ site.donation.currency }}{{ site.donation.amount }}
<span class="method"> <span class="method">
<svg class="icon"><use xlink:href="#icon-{{ name }}"></use></svg> <svg class="icon"><use xlink:href="#icon-{{ name }}"></use></svg>
with {{ name }} with {{ name }}
@ -88,9 +87,17 @@
</a> </a>
</li> </li>
{% endfor %} {% endfor %}
{% for name, walletid in site.cryptocurrencies.items() %}
<!--
<li>
<a rel="payment" title="pay {{ site.author.name }} with {{ name }}" href="#">
<span class="wallet">{{ walletid }}</span>
<span class="method">{{ name }}</span>
</a>
</li>
-->
{% endfor %} {% endfor %}
</ul> </ul>
</aside> </aside>

View file

@ -25,6 +25,12 @@
<svg class="icon"><use xlink:href="#icon-{{ silo }}" /></svg> <svg class="icon"><use xlink:href="#icon-{{ silo }}" /></svg>
<a rel="me" class="u-{{ silo }} url u-url" href="{{ url }}">{{ silo }}</a> <a rel="me" class="u-{{ silo }} url u-url" href="{{ url }}">{{ silo }}</a>
</dd> </dd>
{% endfor %}
</dl>
<dl class="cryptocurrencies">
{% for name, walletid in site.cryptocurrencies.items() %}
<dt>{{ name }}</dt>
<dd>{{ walletid }}</dd>
{% endfor %} {% endfor %}
</dl> </dl>
</nav> </nav>

View file

@ -376,6 +376,18 @@ code.sourceCode span.va { color: turquoise; }
content: ''; content: '';
} }
.content-footer dl.cryptocurrencies {
font-size: 0.7rem;
margin-top: 0.3rem;
}
.content-footer dl.cryptocurrencies dt {
display: inline-block;
visibility: visible;
text-transform: uppercase;
}
input { input {
vertical-align:middle; vertical-align:middle;
border: none; border: none;