def main(env): init_for(env) for filename in [ 'countryInfo.txt', 'admin1CodesASCII.txt', 'admin2Codes.txt', 'IN.zip', 'allCountries.zip', 'alternateNames.zip']: downloadfile('http://download.geonames.org/export/dump/', filename) load_country_info(open('countryInfo.txt')) load_admin1_codes(open('admin1CodesASCII.txt')) load_admin2_codes(open('admin2Codes.txt')) load_geonames(open('IN.txt')) load_geonames(open('allCountries.txt')) load_alt_names(open('alternateNames.txt'))
#!/usr/bin/env python # -*- coding: utf-8 -*- import sys from hascore import app, init_for init_for('dev') try: port = int(sys.argv[1]) except (IndexError, ValueError): port = 8070 app.run('0.0.0.0', port=port, debug=True)
import sys import os.path sys.path.insert(0, os.path.dirname(__file__)) from hascore import app as application, init_for init_for('production')
def main(env): init_for(env) load_country_info(open('countryInfo.txt'))
# Load data for networkbar import sys from hascore import init_for from hascore.models import db, NetworkLink if __name__ == '__main__': init_for(sys.argv[1]) db.session.add_all([ NetworkLink(seq=1, name=u'home', title=u'HasGeek', url=u'http://hasgeek.com/'), NetworkLink(seq=2, name=u'blog', title=u'Blog', url=u'http://blog.hasgeek.com/'), NetworkLink(seq=3, name=u'jobs', title=u'Jobs', url=u'http://jobs.hasgeek.com/'), NetworkLink(seq=4, name=u'hgtv', title=u'TV', url=u'http://hasgeek.tv/'), NetworkLink(seq=5, name=u'funnel', title=u'Funnel', url=u'http://funnel.hasgeek.com/'), NetworkLink(seq=6, name=u'geekup', title=u'Geekup', url=u'http://geekup.in/'), NetworkLink(seq=7, name=u'hacknight', title=u'Hacknight', url=u'http://hacknight.in/'), ]) events = NetworkLink(seq=8, name=u'events', title=u'Events') workshops = NetworkLink(seq=9, name=u'workshops', title=u'Workshops') db.session.add_all([events, workshops]) db.session.add_all([ NetworkLink(seq=20, parent=events, name=u'fifthelephant', title=u'The Fifth Elephant', url=u'http://fifthelephant.in/'), NetworkLink(seq=21, parent=events, name=u'pastevents', title=u'Past events', sep=True), NetworkLink(seq=22, parent=events, name=u'metarefresh', title=u'Meta Refresh', url=u'http://metarefresh.in/'), NetworkLink(seq=23, parent=events, name=u'jsfoo', title=u'JSFoo', url=u'http://jsfoo.in/'),
# Load data for networkbar import sys from hascore import init_for from hascore.models import db, NetworkLink if __name__ == '__main__': init_for(sys.argv[1]) db.session.add_all([ NetworkLink(seq=1, name=u'home', title=u'HasGeek', url=u'http://hasgeek.com/'), NetworkLink(seq=2, name=u'blog', title=u'Blog', url=u'http://blog.hasgeek.com/'), NetworkLink(seq=3, name=u'jobs', title=u'Jobs', url=u'http://jobs.hasgeek.com/'), NetworkLink(seq=4, name=u'hgtv', title=u'TV', url=u'http://hasgeek.tv/'), NetworkLink(seq=5, name=u'funnel', title=u'Funnel', url=u'http://funnel.hasgeek.com/'), NetworkLink(seq=6,