Esempio n. 1
0
File: ui.py Progetto: almccon/DYCAST
 def load_birds(self):
     self.status_label["text"] = "Status: loading birds..."
     self.status_label.update_idletasks()
     self.load_birds_button["state"] = DISABLED
     self.files = self.load_birds_entry.get()
     self.files = self.files.split(" ")
     try:
         for file in self.files:
             dir, base = os.path.split(file)
             self.status_label["text"] = "Status: loading birds... %s" % base
             self.status_label.update_idletasks()
             dycast.load_bird_file(file)
     except:
         if (self.files):
             tkMessageBox.showwarning(
                 "Open file",
                 "Cannot open file(s): %s" % self.files
             )
         else:
             tkMessageBox.showwarning(
                 "Open file",
                 "No files selected"
             )
         
     self.load_birds_button["state"] = NORMAL
     self.status_label["text"] = "Status: ready"
     self.status_label.update_idletasks()
Esempio n. 2
0
    def load_birds(self):
        self.status_label["text"] = "Status: loading birds..."
        self.status_label.update_idletasks()
        self.load_birds_button["state"] = DISABLED
        self.files = self.load_birds_entry.get()
        self.files = self.files.split(" ")
        try:
            for file in self.files:
                dir, base = os.path.split(file)
                self.status_label[
                    "text"] = "Status: loading birds... %s" % base
                self.status_label.update_idletasks()
                dycast.load_bird_file(file)
        except:
            if (self.files):
                tkMessageBox.showwarning(
                    "Open file", "Cannot open file(s): %s" % self.files)
            else:
                tkMessageBox.showwarning("Open file", "No files selected")

        self.load_birds_button["state"] = NORMAL
        self.status_label["text"] = "Status: ready"
        self.status_label.update_idletasks()
Esempio n. 3
0
# date (MM/DD/YYYY)
# long (decimal degrees)
# lat (decimal degrees)
# species

import dycast
import optparse

usage = "usage: %prog [options] datafile.tsv"
p = optparse.OptionParser(usage)
p.add_option('--config',
             '-c',
             default="./dycast.config",
             help="load config file FILE",
             metavar="FILE")
options, arguments = p.parse_args()

config_file = options.config

dycast.read_config(config_file)

dycast.init_logging()

dycast.init_db()

# If arguments includes multiple filenames, fileinput will handle them all

for file in arguments:
    (lines_read, lines_processed, lines_loaded,
     lines_skipped) = dycast.load_bird_file(file)
Esempio n. 4
0
  cs = default_cs
if options.closetime:
  ct = options.closetime
else:
  ct = default_ct
if options.spatialdomain:
  sd = options.spatialdomain
else:
  sd = default_sd
if options.temporaldomain:
  td = options.temporaldomain
else:
  td = default_td

i = int(options.num_days)

cur_date = datetime.date.today()
oneday = datetime.timedelta(days=1)

if cur_date.weekday() == calendar.FRIDAY:
    dycast.backup_birds()

dycast.download_birds() # All options set in config file
dycast.load_bird_file() # All options set in config file 
while i > 0:
    dycast.daily_risk(cur_date, cs, ct, sd, td) # this just needs to know date, and the parameters to use
    dycast.export_risk(cur_date) # needs to know date; use default directory
    dycast.upload_new_risk() # upload everything from default directory
    cur_date -= oneday  # back up one day
    i -= 1              # number of times remaining to back up
Esempio n. 5
0
# id
# date (MM/DD/YYYY)
# long (decimal degrees)
# lat (decimal degrees)
# species

import dycast
import optparse

usage = "usage: %prog [options] datafile.tsv"
p = optparse.OptionParser(usage)
p.add_option('--config', '-c', 
            default="./dycast.config", 
            help="load config file FILE", 
            metavar="FILE")
options, arguments = p.parse_args()

config_file = options.config

dycast.read_config(config_file)

dycast.init_logging()

dycast.init_db()

# If arguments includes multiple filenames, fileinput will handle them all

for file in arguments:
    (lines_read, lines_processed, lines_loaded, lines_skipped) = dycast.load_bird_file(file)