Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(38)  |  Call(34)  |  Derive(0)  |  Import(4)

src/p/y/pyrone-1.1.2/pyrone/lib/helpers.py   pyrone(Download)
 
from pyrone.version import PYRONE_VERSION
from pyrone.models.config import get as get_config
from pyrone.models.file import get_storage_dirs
from pyrone.models import DBSession, Article, Tag, Comment, File
def timestamp_to_dt(ts):
    """
    Convert UTC seconds to datetime object
    """
    tz = get_config('timezone')
def timestamp_to_str(ts, fmt='%Y-%m-%d %H:%M'):
    """
    Convert UTC seconds to time string in local timezone
    """
    tz = get_config('timezone')
def str_to_timestamp(t_str):
    """
    Convert time string in local timezone to UTC seconds
    """
    tz = get_config('timezone')
        pages_links = list()
        # fetch from settings, parse, fill cache
        raw = get_config('widget_pages_pages_spec')
        if raw is None:
            raw = ''

src/p/y/pyrone-1.1.2/pyrone/views/blog.py   pyrone(Download)
 
from pyrone.models import DBSession, Article, Comment, Tag, File, VerifiedEmail
from pyrone.models.config import get as get_config
from pyrone.lib import helpers as h, markup, notifications
from pyrone.models.file import get_storage_dirs, allowed_dltypes
        headers.append('{0}: {1}'.format(k, v))
 
    page_size = int(get_config('elements_on_page'))
    start_page = 0
    if 'start' in request.GET:
def tag_articles(request):
    _ = request.translate
    tag = request.matchdict['tag']
 
    page_size = int(get_config('elements_on_page'))
    comment = dbsession.query(Comment).get(comment.id)
    parent = comment.parent
    admin_email = get_config('admin_notifications_email')
    vf_q = dbsession.query(VerifiedEmail)
    notifications_emails = list()
            ns.append(notifications.gen_comment_response_notification(request, article, comment, c, email))
 
    admin_notifications_email = normalize_email(get_config('admin_notifications_email'))
 
    for nfn in ns:

src/p/y/pyrone-1.1.2/pyrone/lib/notifications.py   pyrone(Download)
from pyramid.url import route_url
 
from pyrone.models.config import get as get_config
from pyrone.models.user import normalize_email
from pyrone.lib import helpers as h
        log.debug(debug_data)
        log.debug('--------------------------------------------------')
        sender = get_config('notifications_from_email')
        if enable_email:
            msg = MIMEMultipart()
    """
    # generate notification using templates
    subject_tpl = get_config('comment_answer_msg_subject_tpl')
    body_tpl = get_config('comment_answer_msg_body_tpl')
 
    subject = subject_tpl
    repl = dict()
    repl.update(_extract_comment_sub(request, comment))
    repl.update(_extract_article_sub(request, comment.article))
    repl['site_title'] = get_config('site_title')

src/p/y/pyrone-1.1.2/pyrone/views/admin.py   pyrone(Download)
def view_pages_widget_settings(request):
    c = dict(errors=dict(), settings=dict())
 
    widget_pages_pages_spec = config.get('widget_pages_pages_spec')
 

src/p/y/pyrone-1.1.2/pyrone/views/account.py   pyrone(Download)
from pyrone.models.user import find_local_user, find_twitter_user,\
    normalize_email, VerifiedEmail
from pyrone.models.config import get as get_config
from pyrone.lib.jsonhttpresponse import JSONResponse
from pyrone.lib import httpcode
    c = {'authorize_url': False}
 
    consumer_key = str(get_config('tw_consumer_key'))
    consumer_secret = str(get_config('tw_consumer_secret'))
 
def login_twitter_finish(request):
    """
    Finish twitter authentication
    """
    consumer_key = str(get_config('tw_consumer_key'))
    consumer_secret = str(get_config('tw_consumer_secret'))

src/p/y/pyrone-1.1.2/pyrone/lib/lang.py   pyrone(Download)
def locale_negotiator(request):
    lang = config.get('ui_lang')
    return lang
 
lang = locale_negotiator