" -h, --help Display this help.\n"
" --configfile FILE Use configuration file FILE instead of the\n"
" default (%s).\n"
+ " --database DATABASE Use the metadata database DATABASE instead\n"
+ " of the default (specified in the\n"
+ " configuration file).\n"
" --gencharenc ENC Generate HTML pages with character\n"
" encoding ENC instead of the default\n"
" (taken from locale settings).\n"
" -l, --location LOCATION Add/register to location LOCATION.\n"
" Default: last.\n"
" --no-act Do everything which is supposed to be done,\n"
- " but don't commit any changes to the shelf.\n"
- " --shelf SHELF Use the shelf SHELF instead of the default\n"
- " (specified in the configuration file).\n"
+ " but don't commit any changes to the\n"
+ " database.\n"
" -t, --type TYPE Use album type TYPE when creating an album\n"
" or output type TYPE when generating output.\n"
" -v, --verbose Be verbose (and slower).\n"
"\n"
"Commands:\n"
"\n"
- " For shelfs\n"
- " ==========\n"
+ " For databases\n"
+ " =============\n"
" check Find missing images and print some\n"
" statistics.\n"
" create-album TAG Create an empty, unlinked album with tag\n"
optlist, args = getopt.gnu_getopt(
argv[1:],
"hl:t:vV",
- ["configfile=",
+ ["database=",
+ "configfile=",
"gencharenc=",
"help",
"ids",
"location=",
"no-act",
- "shelf=",
"type=",
"verbose",
"version"])
for opt, optarg in optlist:
if opt == "--configfile":
configFileLocation = os.path.expanduser(env.to_l(optarg))
+ elif opt == "--database":
+ shelfLocation = env.to_l(optarg)
elif opt == "--gencharenc":
genCharEnc = str(optarg)
elif opt in ("-h", "--help"):
except ValueError:
printErrorAndExit("Invalid location: \"%s\"\n" %
env.to_l(optarg))
- elif opt == "--shelf":
- shelfLocation = env.to_l(optarg)
elif opt in ("-t", "--type"):
env.type = optarg
elif opt in ("-v", "--verbose"):
sys.stdout.write("%s\n" % env.version)
sys.exit(0)
elif opt == "--no-act":
- sys.stdout.write("no-act: No changes will be commited to the shelf!\n")
+ sys.stdout.write("no-act: No changes will be commited to the database!\n")
env.noAct = True
if len(args) == 0:
try:
env.shelf.begin()
except ShelfNotFoundError, x:
- printErrorAndExit("Could not open shelf \"%s\".\n" % (
+ printErrorAndExit("Could not open metadata database \"%s\".\n" % (
env.shelfLocation))
except ShelfLockedError, x:
printErrorAndExit(
- "Could not open shelf \"%s\".\n" % env.shelfLocation +
+ "Could not open metadata database \"%s\".\n" % env.shelfLocation +
"Another process is locking it.\n")
except UnsupportedShelfError, filename:
printErrorAndExit(
- "Could not read shelf file %s (too new shelf format?).\n" %
+ "Could not read metadata database file %s (too new database format?).\n" %
filename)
try:
env.gencharenc = genCharEnc
commandTable[args[0]](env, args[1:])
if env.noAct:
env.shelf.rollback()
- printOutput("no-act: All changes to the shelf have been revoked!\n")
+ printOutput("no-act: All changes to the database have been revoked!\n")
else:
env.shelf.commit()
sys.exit(0)
env.shelf.begin()
except ShelfLockedError, e:
env.startupNotices += [
- "Error: Could not open shelf \"%s\"." % e +
+ "Error: Could not open metadata database \"%s\"." % e +
" Another process is locking it.\n"]
setupOk = False
if env.startupNotices:
help="use configuration file CONFIGFILE instead of the default (%s)" % (
DEFAULT_CONFIGFILE_LOCATION),
default=None)
+ parser.add_option(
+ "--database",
+ type="string",
+ dest="database",
+ help="use metadata database DATABASE instead of the default (specified in the configuration file)",
+ default=None)
parser.add_option(
"--debug",
action="store_true",
help="print debug messages to stdout",
default=False)
- parser.add_option(
- "--shelf",
- type="string",
- dest="shelf",
- help="use shelf SHELF instead of the default (specified in the configuration file)",
- default=None)
options, args = parser.parse_args(argv[1:])
if len(args) != 0:
parser.error("incorrect number of arguments")
setupOk = env.setup(
- bindir, options.debug, options.configfile, options.shelf)
+ bindir, options.debug, options.configfile, options.database)
env.controller = Controller()
env.controller.start(setupOk)
A missing configuration file will be created iff
createMissingConfigFile is true.
- A missing shelf will be created iff createMissingShel is true.
+ A missing shelf will be created iff createMissingShelf is true.
"""
if configFileLocation == None:
if shelfLocation == None:
self.__shelfLocation = self.unicodeToLocalizedString(
- os.path.expanduser(self.config.get("shelf", "location")))
+ os.path.expanduser(self.config.get("database", "location")))
else:
self.__shelfLocation = shelfLocation
self.shelf.create()
except FailedWritingError, self.shelfLocation:
raise BadShelfError, \
- ("Could not create shelf file %s.\n" % (
+ ("Could not create metadata database \"%s\".\n" % (
self.shelfLocation),
self.shelfLocation)
- self._writeInfo("Created shelf \"%s\".\n" % self.shelfLocation)
+ self._writeInfo("Created metadata database \"%s\".\n" % self.shelfLocation)
else:
raise MissingShelfError, \
- ("Could not open shelf \"%s\"" % self.shelfLocation,
+ ("Could not open metadata database \"%s\"" % self.shelfLocation,
self.shelfLocation)
self.__imageCache = ImageCache(
DEFAULT_CONFIGFILE_LOCATION = os.path.join(
"~", "KofotoData", "config.ini")
DEFAULT_SHELF_LOCATION = os.path.join(
- "~", "KofotoData", "shelf.db")
+ "~", "KofotoData", "metadata.db")
DEFAULT_IMAGECACHE_LOCATION = os.path.join(
"~", "KofotoData", "ImageCache")
else:
DEFAULT_CONFIGFILE_LOCATION = os.path.join(
"~", ".kofoto", "config")
DEFAULT_SHELF_LOCATION = os.path.join(
- "~", ".kofoto", "shelf")
+ "~", ".kofoto", "metadata")
DEFAULT_IMAGECACHE_LOCATION = os.path.join(
"~", ".kofoto", "imagecache")
if function and not function(value):
raise BadConfigurationValueError, (section, key, value)
- checkConfigurationItem("shelf", "location", None)
+ checkConfigurationItem("database", "location", None)
checkConfigurationItem("image cache", "location", None)
checkConfigurationItem(
"image cache", "use_orientation_attribute", None)
######################################################################
## General configuration
-[shelf]
+[database]
-# Default location of the shelf. This is where information about
-# albums, images, categories, etc., is stored.
+# Default location of the metadata database. This is where information
+# about albums, images, categories, etc., is stored.
location = %s
######################################################################