-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #292 from Ghini/ghini-1.0-dev
publish early
- Loading branch information
Showing
45 changed files
with
283 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
### Expected behaviour | ||
|
||
### Actual behaviour | ||
|
||
### Steps to reproduce the behaviour | ||
|
||
##### How to set up the same initial situation | ||
|
||
##### Which actions to take in sequence, which contribute to create the critical situation | ||
|
||
##### Last step, with the unexpected result | ||
|
||
##### Opinions and suggestions |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,8 @@ | ||
# -*- coding: utf-8 -*- | ||
# | ||
# Copyright (c) 2005,2006,2007,2008,2009 Brett Adams <[email protected]> | ||
# Copyright (c) 2012-2016 Mario Frasca <[email protected]> | ||
# Copyright (c) 2012-2017 Mario Frasca <[email protected]> | ||
# Copyright 2017 Jardín Botánico de Quito | ||
# | ||
# This file is part of ghini.desktop. | ||
# | ||
|
@@ -47,6 +48,16 @@ def pb_set_fraction(fraction): | |
if gui is not None and gui.progressbar is not None: | ||
gui.progressbar.set_fraction(fraction) | ||
|
||
def pb_grab(): | ||
if gui is not None and gui.progressbar is not None: | ||
gui.set_busy(True) | ||
gui.progressbar.show() | ||
gui.progressbar.set_fraction(0) | ||
|
||
def pb_release(): | ||
if gui is not None and gui.progressbar is not None: | ||
gui.progressbar.hide() | ||
gui.set_busy(False) | ||
|
||
def main_is_frozen(): | ||
""" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,8 @@ | ||
# -*- coding: utf-8 -*- | ||
# | ||
# Copyright 2008-2010 Brett Adams | ||
# Copyright 2015-2016 Mario Frasca <[email protected]>. | ||
# Copyright 2015-2017 Mario Frasca <[email protected]>. | ||
# Copyright 2017 Jardín Botánico de Quito | ||
# | ||
# This file is part of ghini.desktop. | ||
# | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,8 @@ | ||
# -*- coding: utf-8 -*- | ||
# | ||
# Copyright 2005-2010 Brett Adams <[email protected]> | ||
# Copyright 2015 Mario Frasca <[email protected]>. | ||
# Copyright 2015-2017 Mario Frasca <[email protected]>. | ||
# Copyright 2017 Jardín Botánico de Quito | ||
# | ||
# This file is part of ghini.desktop. | ||
# | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,8 @@ | ||
# -*- coding: utf-8 -*- | ||
# | ||
# Copyright 2008-2010 Brett Adams | ||
# Copyright 2015 Mario Frasca <[email protected]>. | ||
# Copyright 2015-2017 Mario Frasca <[email protected]>. | ||
# Copyright 2017 Jardín Botánico de Quito | ||
# | ||
# This file is part of ghini.desktop. | ||
# | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,8 @@ | |
# Copyright (c) 2005,2006,2007,2008,2009 Brett Adams <[email protected]> | ||
# Copyright (c) 2006 Mark Mruss http://www.learningpython.com | ||
# Copyright (c) 2007 Kopfgeldjaeger | ||
# Copyright (c) 2012-2015 Mario Frasca <[email protected]> | ||
# Copyright (c) 2012-2017 Mario Frasca <[email protected]> | ||
# Copyright 2017 Jardín Botánico de Quito | ||
# | ||
# This file is part of ghini.desktop. | ||
# | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
# | ||
# Copyright 2008-2010 Brett Adams | ||
# Copyright 2012-2015 Mario Frasca <[email protected]>. | ||
# Copyright 2017 Jardín Botánico de Quito | ||
# | ||
# This file is part of ghini.desktop. | ||
# | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
# | ||
# Copyright (c) 2005,2006,2007,2008,2009 Brett Adams <[email protected]> | ||
# Copyright (c) 2012-2016 Mario Frasca <[email protected]> | ||
# Copyright 2017 Jardín Botánico de Quito | ||
# | ||
# This file is part of ghini.desktop. | ||
# | ||
|
@@ -339,7 +340,8 @@ def start(self, filename=None, plants=None): | |
if d.run() == gtk.RESPONSE_ACCEPT: | ||
filename = d.get_filename() | ||
d.destroy() | ||
return filename | ||
if not filename: | ||
return | ||
|
||
if plants: | ||
nplants = len(plants) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
# | ||
# Copyright 2008-2010 Brett Adams | ||
# Copyright 2015 Mario Frasca <[email protected]>. | ||
# Copyright 2017 Jardín Botánico de Quito | ||
# | ||
# This file is part of ghini.desktop. | ||
# | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
# | ||
# Copyright 2008-2010 Brett Adams | ||
# Copyright 2015-2016 Mario Frasca <[email protected]>. | ||
# Copyright 2017 Jardín Botánico de Quito | ||
# | ||
# This file is part of ghini.desktop. | ||
# | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
# -*- coding: utf-8 -*- | ||
# | ||
# Copyright 2017 Mario Frasca <[email protected]>. | ||
# Copyright 2017 Jardín Botánico de Quito | ||
# | ||
# This file is part of ghini.desktop. | ||
# | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
# -*- coding: utf-8 -*- | ||
# | ||
# Copyright 2017 Mario Frasca <[email protected]>. | ||
# Copyright 2017 Jardín Botánico de Quito | ||
# | ||
# This file is part of ghini.desktop. | ||
# | ||
|
@@ -28,7 +29,7 @@ | |
from bauble import pluginmgr | ||
|
||
|
||
import gtk | ||
import gtk, gobject | ||
import os | ||
|
||
|
||
|
@@ -80,6 +81,8 @@ def create_pocket(filename): | |
|
||
def export_to_pocket(filename, include_private=True): | ||
from bauble.plugins.plants import Species | ||
from bauble import pb_set_fraction, pb_grab, pb_release | ||
gobject.idle_add(pb_grab) | ||
session = db.Session() | ||
plant_query = (session.query(Plant) | ||
.order_by(Plant.code) | ||
|
@@ -98,6 +101,7 @@ def export_to_pocket(filename, include_private=True): | |
import sqlite3 | ||
cn = sqlite3.connect(filename) | ||
cr = cn.cursor() | ||
count = 1 | ||
for i in species: | ||
try: | ||
cr.execute('INSERT INTO "species" ' | ||
|
@@ -108,6 +112,9 @@ def export_to_pocket(filename, include_private=True): | |
i.infraspecific_author or i.sp_author or '')) | ||
except Exception, e: | ||
logger.info("error exporting species %s: %s %s" % (i.id, type(e), e)) | ||
gobject.idle_add(pb_set_fraction, 0.05 * count / len(species)) | ||
count += 1 | ||
count = 1 | ||
for i in accessions: | ||
try: | ||
try: | ||
|
@@ -120,6 +127,9 @@ def export_to_pocket(filename, include_private=True): | |
(i.id, i.code, i.species_id, source_name, i.date_accd)) | ||
except Exception, e: | ||
logger.info("error exporting accession %s: %s %s" % (i.id, type(e), e)) | ||
gobject.idle_add(pb_set_fraction, 0.05 + 0.4 * count / len(accessions)) | ||
count += 1 | ||
count = 1 | ||
for i in plants: | ||
try: | ||
cr.execute('INSERT INTO "plant" ' | ||
|
@@ -128,8 +138,11 @@ def export_to_pocket(filename, include_private=True): | |
(i.id, i.accession_id, "." + i.code, i.location.code, i.date_of_death, len(i.pictures))) | ||
except Exception, e: | ||
logger.info("error exporting plant %s: %s %s" % (i.id, type(e), e)) | ||
gobject.idle_add(pb_set_fraction, 0.45 + 0.55 * count / len(plants)) | ||
count += 1 | ||
cn.commit() | ||
session.close() | ||
gobject.idle_add(pb_release) | ||
return True | ||
|
||
|
||
|
@@ -145,8 +158,16 @@ def start(self): | |
gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL)) | ||
if d.run() == gtk.RESPONSE_ACCEPT: | ||
pocket = d.get_filename() | ||
if os.path.isfile(pocket): | ||
try: | ||
os.unlink(pocket) | ||
create_pocket(pocket) | ||
export_to_pocket(pocket) | ||
except: | ||
pass | ||
else: | ||
pocket = None | ||
d.destroy() | ||
if pocket: | ||
create_pocket(pocket) | ||
from threading import Thread | ||
thread = Thread(target=export_to_pocket, | ||
args=[pocket]) | ||
thread.start() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
# | ||
# Copyright 2008-2010 Brett Adams | ||
# Copyright 2015 Mario Frasca <[email protected]>. | ||
# Copyright 2017 Jardín Botánico de Quito | ||
# | ||
# This file is part of ghini.desktop. | ||
# | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
# | ||
# Copyright 2008-2010 Brett Adams | ||
# Copyright 2015-2017 Mario Frasca <[email protected]>. | ||
# Copyright 2017 Jardín Botánico de Quito | ||
# | ||
# This file is part of ghini.desktop. | ||
# | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
# | ||
# Copyright 2008-2010 Brett Adams | ||
# Copyright 2015-2016 Mario Frasca <[email protected]>. | ||
# Copyright 2017 Jardín Botánico de Quito | ||
# | ||
# This file is part of ghini.desktop. | ||
# | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
# | ||
# Copyright 2008-2010 Brett Adams | ||
# Copyright 2015,2017 Mario Frasca <[email protected]>. | ||
# Copyright 2017 Jardín Botánico de Quito | ||
# | ||
# This file is part of ghini.desktop. | ||
# | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
# | ||
# Copyright 2008-2010 Brett Adams | ||
# Copyright 2012-2015 Mario Frasca <[email protected]>. | ||
# Copyright 2017 Jardín Botánico de Quito | ||
# | ||
# This file is part of ghini.desktop. | ||
# | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
# | ||
# Copyright 2008-2010 Brett Adams | ||
# Copyright 2014-2015 Mario Frasca <[email protected]>. | ||
# Copyright 2017 Jardín Botánico de Quito | ||
# | ||
# This file is part of ghini.desktop. | ||
# | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
# | ||
# Copyright 2008-2010 Brett Adams | ||
# Copyright 2015 Mario Frasca <[email protected]>. | ||
# Copyright 2017 Jardín Botánico de Quito | ||
# | ||
# This file is part of ghini.desktop. | ||
# | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
# | ||
# Copyright 2008-2010 Brett Adams | ||
# Copyright 2012-2015 Mario Frasca <[email protected]>. | ||
# Copyright 2017 Jardín Botánico de Quito | ||
# | ||
# This file is part of ghini.desktop. | ||
# | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
# | ||
# Copyright 2008-2010 Brett Adams | ||
# Copyright 2012-2016 Mario Frasca <[email protected]>. | ||
# Copyright 2017 Jardín Botánico de Quito | ||
# | ||
# This file is part of ghini.desktop. | ||
# | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
# | ||
# Copyright 2008-2010 Brett Adams | ||
# Copyright 2015 Mario Frasca <[email protected]>. | ||
# Copyright 2017 Jardín Botánico de Quito | ||
# | ||
# This file is part of ghini.desktop. | ||
# | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
# | ||
# Copyright 2008-2010 Brett Adams | ||
# Copyright 2012-2017 Mario Frasca <[email protected]>. | ||
# Copyright 2017 Jardín Botánico de Quito | ||
# Copyright 2017 Ross Demuth | ||
# | ||
# This file is part of ghini.desktop. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
# | ||
# Copyright 2008-2010 Brett Adams | ||
# Copyright 2012-2016 Mario Frasca <[email protected]>. | ||
# Copyright 2017 Jardín Botánico de Quito | ||
# | ||
# This file is part of ghini.desktop. | ||
# | ||
|
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
# | ||
# Copyright (c) 2005,2006,2007,2008,2009 Brett Adams <[email protected]> | ||
# Copyright (c) 2012-2015 Mario Frasca <[email protected]> | ||
# Copyright 2017 Jardín Botánico de Quito | ||
# | ||
# This file is part of ghini.desktop. | ||
# | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
# | ||
# Copyright (c) 2005,2006,2007,2008,2009 Brett Adams <[email protected]> | ||
# Copyright (c) 2012-2017 Mario Frasca <[email protected]> | ||
# Copyright 2017 Jardín Botánico de Quito | ||
# Copyright (c) 2017 Ross Demuth <[email protected]> | ||
# | ||
# This file is part of ghini.desktop. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
# | ||
# Copyright (c) 2005,2006,2007,2008,2009 Brett Adams <[email protected]> | ||
# Copyright (c) 2012-2017 Mario Frasca <[email protected]> | ||
# Copyright 2017 Jardín Botánico de Quito | ||
# | ||
# This file is part of ghini.desktop. | ||
# | ||
|
Oops, something went wrong.