Skip to content

Commit

Permalink
Updating entire repo with fab script
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomasThoren committed May 1, 2015
1 parent 58d0aef commit 0d0b180
Show file tree
Hide file tree
Showing 6 changed files with 317 additions and 145 deletions.
6 changes: 2 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
# Directories
backups
data
# logs
logs
misc
realestate/static/pictures

# Files
*config.py
realestate/config.py
scripts/phantomjs
scripts/ngrok

*.txt
# *.log
*.log
*.pyc
*.DS_Store
*.sql
Expand Down
159 changes: 88 additions & 71 deletions fabfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
LOCAL_APP_DIR,
LOCAL_CSS_DIR,
LOCAL_DATA_DIR,
LOCAL_DOCS_DIR,
LOCAL_FONTS_DIR,
LOCAL_IMAGES_DIR,
LOCAL_JS_DIR,
Expand All @@ -22,22 +23,6 @@
)


def push():
local('git push origin master')


def pull():
local('git pull origin master')


def data():
'''/data'''

local(
'git add %s/assessor-error-html/assessor_error.html' % LOCAL_DATA_DIR)
local('git add %s/sale-error-html/sale_error.html' % LOCAL_DATA_DIR)


def repo():
'''/'''

Expand All @@ -53,63 +38,45 @@ def repo():
local('git add %s/setup.py' % LOCAL_PROJECT_DIR)


def app():
'''/realestate/'''

local('git add %s/__init__.py' % LOCAL_APP_DIR)
local('git add %s/app.py' % LOCAL_APP_DIR)
local('git add %s/config.py' % LOCAL_APP_DIR)
local('git add %s/db.py' % LOCAL_APP_DIR)
local('git add %s/models.py' % LOCAL_APP_DIR)
local('git add %s/views.py' % LOCAL_APP_DIR)

def data():
'''/data'''

def scripts():
'''/scripts/'''
local(
'git add %s/assessor-error-html/assessor_error.html' % LOCAL_DATA_DIR)
local('git add %s/sale-error-html/sale_error.html' % LOCAL_DATA_DIR)

local('git add %s/backup.sh' % LOCAL_SCRIPTS_DIR)
local('git add %s/delete_db.py' % LOCAL_SCRIPTS_DIR)
local('git add %s/initialize.py' % LOCAL_SCRIPTS_DIR)
local('git add %s/main.sh' % LOCAL_SCRIPTS_DIR)
local('git add %s/make_db.py' % LOCAL_SCRIPTS_DIR)
local('git add %s/screen.js' % LOCAL_SCRIPTS_DIR)
local('git add %s/tserver.py' % LOCAL_SCRIPTS_DIR)

def docs():
'''/docs/'''

def tests():
'''/tests/'''
local('git add %s/' % LOCAL_DOCS_DIR)

local('git add %s/__init__.py' % LOCAL_TESTS_DIR)
local('git add %s/test_pep8.py' % LOCAL_TESTS_DIR)
local('git add %s/test_pylint.py' % LOCAL_TESTS_DIR)
# local('git add %s/build.rst' % LOCAL_DOCS_DIR)
# local('git add %s/conf.py' % LOCAL_DOCS_DIR)
# local('git add %s/database.rst' % LOCAL_DOCS_DIR)
# local('git add %s/index.rst' % LOCAL_DOCS_DIR)
# local('git add %s/Makefile' % LOCAL_DOCS_DIR)
# local('git add %s/misc.rst' % LOCAL_DOCS_DIR)
# local('git add %s/scrape.rst' % LOCAL_DOCS_DIR)
# local('git add %s/tests.rst' % LOCAL_DOCS_DIR)


def templates():
'''/realestate/templates'''
def realestate():
'''/realestate/'''

local('git add %s/404.html' % LOCAL_TEMPLATE_DIR)
local('git add %s/banner.html' % LOCAL_TEMPLATE_DIR)
local('git add %s/dashboard.html' % LOCAL_TEMPLATE_DIR)
local('git add %s/footer.html' % LOCAL_TEMPLATE_DIR)
local('git add %s/head.html' % LOCAL_TEMPLATE_DIR)
local('git add %s/index.html' % LOCAL_TEMPLATE_DIR)
local('git add %s/js.html' % LOCAL_TEMPLATE_DIR)
local('git add %s/sale.html' % LOCAL_TEMPLATE_DIR)
local('git add %s/search.html' % LOCAL_TEMPLATE_DIR)
local('git add %s/search-area.html' % LOCAL_TEMPLATE_DIR)
local('git add %s/table.html' % LOCAL_TEMPLATE_DIR)
local('git add %s/__init__.py' % LOCAL_APP_DIR)
local('git add %s/app.py' % LOCAL_APP_DIR)
local('git add %s/db.py' % LOCAL_APP_DIR)
local('git add %s/models.py' % LOCAL_APP_DIR)
local('git add %s/views.py' % LOCAL_APP_DIR)


def lib():
'''/realestate/lib'''

local('git add %s/__init__.py' % LOCAL_LIB_DIR)
local('git add %s/build.py' % LOCAL_LIB_DIR)
local('git add %s/build_assessor_urls.py' % LOCAL_LIB_DIR)
local('git add %s/check_assessor_urls.py' % LOCAL_LIB_DIR)
local('git add %s/check_temp_status.py' % LOCAL_LIB_DIR)
local('git add %s/clean.py' % LOCAL_LIB_DIR)
local('git add %s/dashboard_sync.py' % LOCAL_LIB_DIR)
local('git add %s/delete_dates.py' % LOCAL_LIB_DIR)
local('git add %s/email_template.py' % LOCAL_LIB_DIR)
local('git add %s/form_tweet.py' % LOCAL_LIB_DIR)
Expand All @@ -124,7 +91,6 @@ def lib():
local('git add %s/stat_analysis.py' % LOCAL_LIB_DIR)
local('git add %s/twitter.py' % LOCAL_LIB_DIR)
local('git add %s/utils.py' % LOCAL_LIB_DIR)
local('git add %s/webhook.py' % LOCAL_LIB_DIR)


def css():
Expand All @@ -135,10 +101,10 @@ def css():
local('git add %s/foundation.min.css' % LOCAL_CSS_DIR)
local('git add %s/jquery-ui.css' % LOCAL_CSS_DIR)
local('git add %s/jquery.tablesorter.pager.css' % LOCAL_CSS_DIR)
local('git add %s/realestate.css' % LOCAL_CSS_DIR)
local('git add %s/lens.css' % LOCAL_CSS_DIR)
local('git add %s/lenstablesorter.css' % LOCAL_CSS_DIR)
local('git add %s/mapbox.css' % LOCAL_CSS_DIR)
local('git add %s/realestate.css' % LOCAL_CSS_DIR)
local('git add %s/table.css' % LOCAL_CSS_DIR)


Expand Down Expand Up @@ -198,28 +164,79 @@ def js():
local('git add %s/search-area.js' % LOCAL_JS_DIR)


def doitall():
def templates():
'''/realestate/templates'''

local('git add %s/404.html' % LOCAL_TEMPLATE_DIR)
local('git add %s/banner.html' % LOCAL_TEMPLATE_DIR)
local('git add %s/dashboard.html' % LOCAL_TEMPLATE_DIR)
local('git add %s/footer.html' % LOCAL_TEMPLATE_DIR)
local('git add %s/head.html' % LOCAL_TEMPLATE_DIR)
local('git add %s/index.html' % LOCAL_TEMPLATE_DIR)
local('git add %s/js.html' % LOCAL_TEMPLATE_DIR)
local('git add %s/sale.html' % LOCAL_TEMPLATE_DIR)
local('git add %s/search.html' % LOCAL_TEMPLATE_DIR)
local('git add %s/search-area.html' % LOCAL_TEMPLATE_DIR)
local('git add %s/table.html' % LOCAL_TEMPLATE_DIR)


def scripts():
'''/scripts/'''

local('git add %s/backup.sh' % LOCAL_SCRIPTS_DIR)
local('git add %s/delete_db.py' % LOCAL_SCRIPTS_DIR)
local('git add %s/initialize.py' % LOCAL_SCRIPTS_DIR)
local('git add %s/main.sh' % LOCAL_SCRIPTS_DIR)
local('git add %s/make_db.py' % LOCAL_SCRIPTS_DIR)
local('git add %s/screen.js' % LOCAL_SCRIPTS_DIR)
local('git add %s/screen.py' % LOCAL_SCRIPTS_DIR)


def tests():
'''/tests/'''

local('git add %s/__init__.py' % LOCAL_TESTS_DIR)
local('git add %s/test_parse.py' % LOCAL_TESTS_DIR)
local('git add %s/test_pep8.py' % LOCAL_TESTS_DIR)
local('git add %s/test_pylint.py' % LOCAL_TESTS_DIR)


# Others
def addthemall():
'''Run through entire deployment.'''

data()
repo()
app()
scripts()
tests()
data()
docs()
realestate()
lib()
templates()
js()
css()
images()
fonts()
js()
templates()
scripts()
tests()


def python():
'''Deploy all *.py files.'''
def commit(message):
local('git commit -m "%s"' % message)

app()
scripts()
lib()

def push():
local('git push origin master')


def pull():
local('git pull origin master')


def github(message):
'''Add, commit and push to Github.'''

addthemall()
commit(message)
push()


if __name__ == '__main__':
Expand Down
1 change: 1 addition & 0 deletions realestate/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@
'/realestate/static/fonts'
LOCAL_IMAGES_DIR = '%s' % PROJECT_DIR + \
'/realestate/static/css/images'
LOCAL_DOCS_DIR = '%s/docs' % PROJECT_DIR

SERVER_PROJECT_DIR = '%s' % PROJECT_DIR
SERVER_APP_DIR = '%s/realestate' % PROJECT_DIR
Expand Down
7 changes: 6 additions & 1 deletion realestate/lib/geocode.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,12 @@ def no_neighborhood_found(self):
session.close()

def get_rows_with_null_rating(self):
'''Gets locations with rating IS NULL.'''
'''
Returns query result for locations with rating IS NULL, between dates
defined in self.initial_date and self.until_date.
:returns: SQLAlchemy query result.
'''

session = self.sn()

Expand Down
Loading

0 comments on commit 0d0b180

Please sign in to comment.