<commit_before>#!/usr/bin/env python
from datetime import date, datetime
import os, os.path, re, subprocess, sys
import argparse, socket
import psycopg2
import warnings
import ConfigParser

"""
This script queries the UGA SSA data stored in the NESPAL database and
upload the last probe reading before 9am per day for each probe into
the IrrigatorPro database.
"""

if __name__ == "__main__":
    # Add django root dir to python path
    PROJECT_ROOT      = os.path.abspath(os.path.join(os.path.dirname(__file__), '..',))
    print "PROJECT_ROOT=", PROJECT_ROOT
    sys.path.append(PROJECT_ROOT)

    # Add virtualenv dirs to python path
    if socket.gethostname()=='gregs-mbp':
        VIRTUAL_ENV_ROOT = os.path.join( PROJECT_ROOT, 'VirtualEnvs', 'irrigator_pro')
    else:
        VIRTUAL_ENV_ROOT = '/www/VirtualEnvs/irrigator_pro/'

    print "VIRTUAL_ENV_ROOT='%s'" % VIRTUAL_ENV_ROOT
    activate_this = os.path.join(VIRTUAL_ENV_ROOT, 'bin', 'activate_this.py')
    execfile(activate_this, dict(__file__=activate_this))

    # Get settings
    os.environ.setdefault("DJANGO_SETTINGS_MODULE", "irrigator_pro.settings")

from irrigator_pro.settings import ABSOLUTE_PROJECT_ROOT
from farms.models import ProbeSync, ProbeReading
from django.contrib.auth.models import User
from django.utils import timezone
import pytz


## Current Timezone
eastern = pytz.timezone("US/Eastern")<commit_msg>Modify sync_probes.py script to work properly on development server.<commit_after>#!/usr/bin/env python
from datetime import date, datetime
import os, os.path, re, socket, subprocess, sys
import argparse, socket
import psycopg2
import warnings
import ConfigParser

"""
This script queries the UGA SSA data stored in the NESPAL database and
upload the last probe reading before 9am per day for each probe into
the IrrigatorPro database.
"""

if __name__ == "__main__":
    # Add django root dir to python path
    PROJECT_ROOT      = os.path.abspath(os.path.join(os.path.dirname(__file__), '..',))
    print "PROJECT_ROOT=", PROJECT_ROOT
    sys.path.append(PROJECT_ROOT)


    # Add virtualenv dirs to python path
    host = socket.gethostname()
    print "HOSTNAME=%s" % host
    if host=='irrigatorpro':
        if "test" in PROJECT_ROOT:
            VIRTUAL_ENV_ROOT = '/www/VirtualEnvs/test/'
        else:
            VIRTUAL_ENV_ROOT = '/www/VirtualEnvs/irrigator_pro/'
    else:
        VIRTUAL_ENV_ROOT = os.path.join( PROJECT_ROOT, 'VirtualEnvs', 'irrigator_pro')

    print "VIRTUAL_ENV_ROOT='%s'" % VIRTUAL_ENV_ROOT
    activate_this = os.path.join(VIRTUAL_ENV_ROOT, 'bin', 'activate_this.py')
    execfile(activate_this, dict(__file__=activate_this))

    # Get settings
    os.environ.setdefault("DJANGO_SETTINGS_MODULE", "irrigator_pro.settings")

from irrigator_pro.settings import ABSOLUTE_PROJECT_ROOT
from farms.models import ProbeSync, ProbeReading
from django.contrib.auth.models import User
from django.utils import timezone
import pytz


## Current Timezone
eastern = pytz.timezone("US/Eastern")
{'fraction_non_alphanumeric': 0.0966456326801727, 'fraction_numerical': 0.001328462304882099, 'mean_word_length': 4.349911190053286, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 3, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '957244', 'n_tokens_mistral': 1005, 'n_tokens_neox': 980, 'n_words': 258}