Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Delete g.countries.

  • Loading branch information...
commit ed18fc5b2139440b24ca96a481b264eaf0132a37 1 parent 48623ff
Brian Simpson bsimpson63 authored
1  install-reddit.sh
View
@@ -131,7 +131,6 @@ python-beautifulsoup
python-cssutils
python-chardet
python-psycopg2
-python-pycountry
python-pycassa
python-imaging
python-pycaptcha
14 r2/Makefile
View
@@ -247,17 +247,3 @@ clean_gzip:
rm -f $(GZIPPED)
$(shell rm -f $(DEFS_FILE))
-
-#################### country list
-COUNTRY_FILE := $(STATIC_BUILD_DIR)/countries.json
-
-countries: $(COUNTRY_FILE)
-
-$(STATIC_BUILD_DIR):
- mkdir -p $(STATIC_BUILD_DIR)
-
-$(COUNTRY_FILE): $(STATIC_BUILD_DIR)
- $(PYTHON) r2/lib/countries.py > $(COUNTRY_FILE)
-
-clean_countries:
- rm -f $(COUNTRY_FILE)
7 r2/example.ini
View
@@ -563,17 +563,12 @@ compress_level = 6
min_size = 800
[loggers]
-keys = root, pycountry
+keys = root
[logger_root]
level = WARNING
handlers = console
-[logger_pycountry]
-level = CRITICAL
-qualname = pycountry.db
-handlers =
-
[handlers]
keys = console
11 r2/r2/lib/app_globals.py
View
@@ -53,7 +53,6 @@
)
from r2.lib.configparse import ConfigValue, ConfigValueParser
from r2.lib.contrib import ipaddress
-from r2.lib.countries import get_countries_and_codes
from r2.lib.lock import make_lock_factory
from r2.lib.manager import db_manager
from r2.lib.plugin import PluginLoader
@@ -377,16 +376,6 @@ def setup(self):
csslog = logging.getLogger("cssutils")
cssutils.log.setLog(csslog)
- # load the country list
- countries_file_path = os.path.join(static_files, "countries.json")
- try:
- with open(countries_file_path) as handle:
- self.countries = json.load(handle)
- self.log.debug("Using countries.json.")
- except IOError:
- self.log.warning("Couldn't find countries.json. Using pycountry.")
- self.countries = get_countries_and_codes()
-
if not self.media_domain:
self.media_domain = self.domain
if self.media_domain == self.domain:
39 r2/r2/lib/countries.py
View
@@ -1,39 +0,0 @@
-# The contents of this file are subject to the Common Public Attribution
-# License Version 1.0. (the "License"); you may not use this file except in
-# compliance with the License. You may obtain a copy of the License at
-# http://code.reddit.com/LICENSE. The License is based on the Mozilla Public
-# License Version 1.1, but Sections 14 and 15 have been added to cover use of
-# software over a computer network and provide for limited attribution for the
-# Original Developer. In addition, Exhibit A has been modified to be consistent
-# with Exhibit B.
-#
-# Software distributed under the License is distributed on an "AS IS" basis,
-# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
-# the specific language governing rights and limitations under the License.
-#
-# The Original Code is reddit.
-#
-# The Original Developer is the Initial Developer. The Initial Developer of
-# the Original Code is reddit Inc.
-#
-# All portions of the code written by reddit are Copyright (c) 2006-2013 reddit
-# Inc. All Rights Reserved.
-###############################################################################
-
-import json
-
-
-def get_countries_and_codes():
- """Return a dict of ISO Alpha2 country codes to country names."""
-
- # avoid importing this until this function is called since we're going to
- # try our best to not import this at all in the app. it takes a tonne of
- # memory!
- import pycountry
-
- return {x.alpha2: x.name for x in pycountry.countries}
-
-
-if __name__ == "__main__":
- # Print out the country dict in JSON format for use in the Makefile.
- print json.dumps(get_countries_and_codes(), indent=2, sort_keys=True)
1  r2/setup.py
View
@@ -83,7 +83,6 @@
"cssutils==0.9.5.1",
"chardet",
"psycopg2",
- "pycountry",
"pycassa>=1.7.0",
"PIL",
"pycaptcha",
Please sign in to comment.
Something went wrong with that request. Please try again.