mirror of
https://github.com/reddit-archive/reddit.git
synced 2026-04-05 03:00:15 -04:00
Synchronize mis-merges from production branch.
This commit is contained in:
@@ -63,9 +63,9 @@ from r2.lib.scraper import str_to_image
|
||||
from r2.controllers.api_docs import api_doc, api_section
|
||||
from r2.lib.search import SearchQuery
|
||||
from r2.controllers.oauth2 import OAuth2ResourceController, require_oauth2_scope
|
||||
from r2.lib.template_helpers import add_sr, get_domain
|
||||
from r2.lib.system_messages import notify_user_added
|
||||
from r2.controllers.ipn import generate_blob
|
||||
from r2.lib.template_helpers import add_sr, get_domain
|
||||
|
||||
from r2.models import wiki
|
||||
from r2.lib.merge import ConflictException
|
||||
|
||||
@@ -1198,8 +1198,8 @@ class CommentPane(Templated):
|
||||
likes = []
|
||||
dislikes = []
|
||||
is_friend = set()
|
||||
saves = set()
|
||||
gildings = {}
|
||||
saves = set()
|
||||
for t in self.listing_iter(my_listing):
|
||||
if not hasattr(t, "likes"):
|
||||
# this is for MoreComments and MoreRecursion
|
||||
|
||||
@@ -1442,6 +1442,19 @@ def weighted_lottery(weights, _random=random.random):
|
||||
"weighted_lottery messed up: r=%r, t=%r, total=%r" % (r, t, total))
|
||||
|
||||
|
||||
def read_static_file_config(config_file):
|
||||
parser = ConfigParser.RawConfigParser()
|
||||
with open(config_file, "r") as cf:
|
||||
parser.readfp(cf)
|
||||
config = dict(parser.items("static_files"))
|
||||
|
||||
s3 = boto.connect_s3(config["aws_access_key_id"],
|
||||
config["aws_secret_access_key"])
|
||||
bucket = s3.get_bucket(config["bucket"])
|
||||
|
||||
return bucket, config
|
||||
|
||||
|
||||
class GoldPrice(object):
|
||||
"""Simple price math / formatting type.
|
||||
|
||||
@@ -1471,15 +1484,3 @@ class GoldPrice(object):
|
||||
def config_gold_price(v, key=None, data=None):
|
||||
return GoldPrice(v)
|
||||
|
||||
|
||||
def read_static_file_config(config_file):
|
||||
parser = ConfigParser.RawConfigParser()
|
||||
with open(config_file, "r") as cf:
|
||||
parser.readfp(cf)
|
||||
config = dict(parser.items("static_files"))
|
||||
|
||||
s3 = boto.connect_s3(config["aws_access_key_id"],
|
||||
config["aws_secret_access_key"])
|
||||
bucket = s3.get_bucket(config["bucket"])
|
||||
|
||||
return bucket, config
|
||||
|
||||
@@ -46,8 +46,6 @@ from r2.lib.utils import Enum, to_date
|
||||
from r2.models.account import Account
|
||||
from r2.models import Link
|
||||
|
||||
from r2.lib.utils import Enum, fetch_things2, to_date
|
||||
|
||||
|
||||
engine = g.dbm.get_engine('authorize')
|
||||
# Allocate a session maker for communicating object changes with the back end
|
||||
|
||||
@@ -37,8 +37,8 @@ from r2.lib.strings import strings, Score
|
||||
from r2.lib.db import tdb_cassandra
|
||||
from r2.lib.db.tdb_cassandra import NotFoundException, view_of
|
||||
from r2.models.subreddit import MultiReddit
|
||||
from r2.models.promo import PROMOTE_STATUS, get_promote_srid
|
||||
from r2.models.query_cache import CachedQueryMutator
|
||||
from r2.models.promo import PROMOTE_STATUS, get_promote_srid
|
||||
|
||||
from pylons import c, g, request
|
||||
from pylons.i18n import ungettext, _
|
||||
|
||||
Reference in New Issue
Block a user