Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

SQL, MacOS X #4

Merged
merged 1 commit into from over 2 years ago

2 participants

Andrii Kostenko ramusus
Andrii Kostenko

Added support for MacOS X (zcat works only for .Z files), added SQL files to distribution

ramusus ramusus merged commit c2f93cd into from December 27, 2011
ramusus ramusus closed this December 27, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Showing 1 unique commit by 1 author.

Dec 25, 2011
Andrii Kostenko installing SQL data 4024022
This page is out of date. Refresh to see the latest.
2  geonames/management/commands/load_geonames.py
@@ -59,7 +59,7 @@ def handle_noargs(self, **options):
59 59
         # overhead from using the ORM.  Moreover, copying from a gzipped file
60 60
         # reduces disk I/O.
61 61
         copy_sql = "COPY %s (geonameid,name,alternates,fclass,fcode,country,cc2,admin1,admin2,admin3,admin4,population,elevation,topo,timezone,moddate,point) FROM STDIN;" % db_table
62  
-        copy_cmd = 'zcat %(gz_file)s | psql %(db_opts)s -c "%(copy_sql)s"'
  62
+        copy_cmd = 'gunzip -c %(gz_file)s | psql %(db_opts)s -c "%(copy_sql)s"'
63 63
         copy_args = {'gz_file' : os.path.join(GEONAMES_DATA, 'allCountries.gz'),
64 64
                      'db_opts' : db_opts,
65 65
                      'copy_sql' : copy_sql
8  setup.py
... ...
@@ -1,6 +1,6 @@
1 1
 #!/usr/bin/env python
2 2
 
3  
-from distutils.core import setup
  3
+from setuptools import setup, find_packages
4 4
 
5 5
 setup(name='django-geonames',
6 6
       version=__import__('geonames').__version__,
@@ -8,6 +8,10 @@
8 8
       author='Justin Bronn',
9 9
       author_email='jbronn@geodjango.org',
10 10
       url='https://github.com/ramusus/django-geonames/',
11  
-      packages=['geonames', 'geonames.management', 'geonames.management.commands'],
  11
+      packages = find_packages(),
  12
+      include_package_data = True,
  13
+      package_data = {
  14
+          'geonames' : ['sql/*.sql']
  15
+      }
12 16
 )
13 17
 
Commit_comment_tip

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.