* src/gramps_main.py (on_export_activate): Switch to new Exporter.
* src/WriteXML.py: Change registration. Return 1 on success and 0 when on failure. * src/Utils.py (get_new_filename): Add function. * src/DbPrompter.py (get_new_filename): Remove function. * src/Exporter.py: Add to CVS. * src/Makefile.am: Ship Exporter.py. * src/Plugins.py (register_export): Change to the new scheme. svn: r3254
This commit is contained in:
13
src/Utils.py
13
src/Utils.py
@ -545,3 +545,16 @@ def create_id():
|
||||
s += chr(val%57+65)
|
||||
val = int(val/57)
|
||||
return s
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
#
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
_NEW_NAME_PATTERN = '~/Untitled_%d.%s'
|
||||
|
||||
def get_new_filename(ext):
|
||||
ix = 1
|
||||
while os.path.isfile(os.path.expanduser(_NEW_NAME_PATTERN % (ix,ext) )):
|
||||
ix = ix + 1
|
||||
return os.path.expanduser(_NEW_NAME_PATTERN % (ix,ext))
|
||||
|
Reference in New Issue
Block a user