comparison roundup/configuration.py @ 2630:a65bae7af6d1

NOSY_MESSAGES_TO_AUTHOR is RunDetectorOption (values: yes, no, new)... rather than BooleanOption (yes/no); FilePathOptions have a comment about relative paths; add full stop at the end of all option descriptions
author Alexander Smishlajev <a1s@users.sourceforge.net>
date Mon, 26 Jul 2004 09:13:17 +0000
parents ac377478769d
children f47ca4541770
comparison
equal deleted inserted replaced
2629:ac377478769d 2630:a65bae7af6d1
1 # Roundup Issue Tracker configuration support 1 # Roundup Issue Tracker configuration support
2 # 2 #
3 # $Id: configuration.py,v 1.9 2004-07-26 05:59:45 a1s Exp $ 3 # $Id: configuration.py,v 1.10 2004-07-26 09:13:17 a1s Exp $
4 # 4 #
5 __docformat__ = "restructuredtext" 5 __docformat__ = "restructuredtext"
6 6
7 import imp 7 import imp
8 import os 8 import os
294 294
295 Paths may be either absolute or relative to the TRACKER_HOME. 295 Paths may be either absolute or relative to the TRACKER_HOME.
296 296
297 """ 297 """
298 298
299 class_description = "The path may be either absolute" \
300 " or relative to the tracker home."
301
299 def get(self): 302 def get(self):
300 _val = Option.get(self) 303 _val = Option.get(self)
301 if _val and not os.path.isabs(_val): 304 if _val and not os.path.isabs(_val):
302 _val = os.path.join(self.config["TRACKER_HOME"], _val) 305 _val = os.path.join(self.config["TRACKER_HOME"], _val)
303 return _val 306 return _val
364 else: 367 else:
365 return value 368 return value
366 369
367 class NullableFilePathOption(NullableOption, FilePathOption): 370 class NullableFilePathOption(NullableOption, FilePathOption):
368 371
369 # .get() is from FilePathOption, 372 # .get() and class_description are from FilePathOption,
370 get = FilePathOption.get 373 get = FilePathOption.get
371 # everything else - from NullableOption (inheritance order) 374 class_description = FilePathOption.class_description
375 # everything else taken from NullableOption (inheritance order)
372 376
373 ### Main configuration layout. 377 ### Main configuration layout.
374 # Config is described as a sequence of sections, 378 # Config is described as a sequence of sections,
375 # where each section name is followed by a sequence 379 # where each section name is followed by a sequence
376 # of Option definitions. Each Option definition 380 # of Option definitions. Each Option definition
379 # setting, default, [description, [aliases]] 383 # setting, default, [description, [aliases]]
380 # Note: aliases should only exist in historical options for backwards 384 # Note: aliases should only exist in historical options for backwards
381 # compatibility - new options should *not* have aliases! 385 # compatibility - new options should *not* have aliases!
382 SETTINGS = ( 386 SETTINGS = (
383 ("main", ( 387 ("main", (
384 (FilePathOption, "database", "db", "Database directory path"), 388 (FilePathOption, "database", "db", "Database directory path."),
385 (FilePathOption, "templates", "html", 389 (FilePathOption, "templates", "html",
386 "Path to the HTML templates directory"), 390 "Path to the HTML templates directory."),
387 (MailAddressOption, "admin_email", "roundup-admin", 391 (MailAddressOption, "admin_email", "roundup-admin",
388 "Email address that roundup will complain to" 392 "Email address that roundup will complain to"
389 " if it runs into trouble"), 393 " if it runs into trouble."),
390 (MailAddressOption, "dispatcher_email", "roundup-admin", 394 (MailAddressOption, "dispatcher_email", "roundup-admin",
391 "The 'dispatcher' is a role that can get notified\n" 395 "The 'dispatcher' is a role that can get notified\n"
392 "of new items to the database.\n" 396 "of new items to the database.\n"
393 "It is used by the ERROR_MESSAGES_TO config setting."), 397 "It is used by the ERROR_MESSAGES_TO config setting."),
394 (Option, "email_from_tag", "", 398 (Option, "email_from_tag", "",
398 "is usually: \"Foo Bar\" <issue_tracker@tracker.example>\n" 402 "is usually: \"Foo Bar\" <issue_tracker@tracker.example>\n"
399 "the EMAIL_FROM_TAG goes inside the \"Foo Bar\" quotes like so:\n" 403 "the EMAIL_FROM_TAG goes inside the \"Foo Bar\" quotes like so:\n"
400 "\"Foo Bar EMAIL_FROM_TAG\" <issue_tracker@tracker.example>"), 404 "\"Foo Bar EMAIL_FROM_TAG\" <issue_tracker@tracker.example>"),
401 (Option, "new_web_user_roles", "User", 405 (Option, "new_web_user_roles", "User",
402 "Roles that a user gets when they register" 406 "Roles that a user gets when they register"
403 " with Web User Interface\n" 407 " with Web User Interface.\n"
404 "This is a comma-separated string of role names" 408 "This is a comma-separated string of role names"
405 " (e.g. 'Admin,User')"), 409 " (e.g. 'Admin,User')."),
406 (Option, "new_email_user_roles", "User", 410 (Option, "new_email_user_roles", "User",
407 "Roles that a user gets when they register" 411 "Roles that a user gets when they register"
408 " with Email Gateway\n" 412 " with Email Gateway.\n"
409 "This is a comma-separated string of role names" 413 "This is a comma-separated string of role names"
410 " (e.g. 'Admin,User')"), 414 " (e.g. 'Admin,User')."),
411 (Option, "error_messages_to", "user", 415 (Option, "error_messages_to", "user",
412 # XXX This description needs better wording, 416 # XXX This description needs better wording,
413 # with explicit allowed values list. 417 # with explicit allowed values list.
414 "Send error message emails to the dispatcher, user, or both?\n" 418 "Send error message emails to the dispatcher, user, or both?\n"
415 "The dispatcher is configured using the DISPATCHER_EMAIL" 419 "The dispatcher is configured using the DISPATCHER_EMAIL"
427 "in their settings.", 431 "in their settings.",
428 ["DEFAULT_TIMEZONE"]), 432 ["DEFAULT_TIMEZONE"]),
429 )), 433 )),
430 ("tracker", ( 434 ("tracker", (
431 (Option, "name", "Roundup issue tracker", 435 (Option, "name", "Roundup issue tracker",
432 "A descriptive name for your roundup instance"), 436 "A descriptive name for your roundup instance."),
433 (Option, "web", NODEFAULT, 437 (Option, "web", NODEFAULT,
434 "The web address that the tracker is viewable at.\n" 438 "The web address that the tracker is viewable at.\n"
435 "This will be included in information" 439 "This will be included in information"
436 " sent to users of the tracker.\n" 440 " sent to users of the tracker.\n"
437 "The URL MUST include the cgi-bin part or anything else\n" 441 "The URL MUST include the cgi-bin part or anything else\n"
438 "that is required to get to the home page of the tracker.\n" 442 "that is required to get to the home page of the tracker.\n"
439 "You MUST include a trailing '/' in the URL."), 443 "You MUST include a trailing '/' in the URL."),
440 (MailAddressOption, "email", "issue_tracker", 444 (MailAddressOption, "email", "issue_tracker",
441 "Email address that mail to roundup should go to"), 445 "Email address that mail to roundup should go to."),
442 )), 446 )),
443 ("logging", ( 447 ("logging", (
444 (FilePathOption, "config", "", 448 (FilePathOption, "config", "",
445 "Path to configuration file for standard Python logging module.\n" 449 "Path to configuration file for standard Python logging module.\n"
446 "If this option is set, logging configuration is loaded\n" 450 "If this option is set, logging configuration is loaded\n"
457 )), 461 )),
458 ("mail", ( 462 ("mail", (
459 (Option, "domain", NODEFAULT, "Domain name used for email addresses."), 463 (Option, "domain", NODEFAULT, "Domain name used for email addresses."),
460 (Option, "host", NODEFAULT, 464 (Option, "host", NODEFAULT,
461 "SMTP mail host that roundup will use to send mail"), 465 "SMTP mail host that roundup will use to send mail"),
462 (Option, "username", "", "SMTP login name\n" 466 (Option, "username", "", "SMTP login name.\n"
463 "Set this if your mail host requires authenticated access.\n" 467 "Set this if your mail host requires authenticated access.\n"
464 "If username is not empty, password (below) MUST be set!"), 468 "If username is not empty, password (below) MUST be set!"),
465 (Option, "password", NODEFAULT, "SMTP login password\n" 469 (Option, "password", NODEFAULT, "SMTP login password.\n"
466 "Set this if your mail host requires authenticated access."), 470 "Set this if your mail host requires authenticated access."),
467 (BooleanOption, "tls", "no", 471 (BooleanOption, "tls", "no",
468 "If your SMTP mail host provides or requires TLS\n" 472 "If your SMTP mail host provides or requires TLS\n"
469 "(Transport Layer Security) then set this option to 'yes'"), 473 "(Transport Layer Security) then set this option to 'yes'."),
470 (NullableFilePathOption, "tls_keyfile", "", 474 (NullableFilePathOption, "tls_keyfile", "",
471 "If TLS is used, you may set this option to the name\n" 475 "If TLS is used, you may set this option to the name\n"
472 "of a PEM formatted file that contains your private key"), 476 "of a PEM formatted file that contains your private key."),
473 (NullableFilePathOption, "tls_certfile", "", 477 (NullableFilePathOption, "tls_certfile", "",
474 "If TLS is used, you may set this option to the name\n" 478 "If TLS is used, you may set this option to the name\n"
475 "of a PEM formatted certificate chain file"), 479 "of a PEM formatted certificate chain file."),
476 (Option, "charset", "utf-8", 480 (Option, "charset", "utf-8",
477 "Character set to encode email headers with.\n" 481 "Character set to encode email headers with.\n"
478 "We use utf-8 by default, as it's the most flexible.\n" 482 "We use utf-8 by default, as it's the most flexible.\n"
479 "Some mail readers (eg. Eudora) can't cope with that,\n" 483 "Some mail readers (eg. Eudora) can't cope with that,\n"
480 "so you might need to specify a more limited character set\n" 484 "so you might need to specify a more limited character set\n"
481 "(eg. iso-8859-1)", 485 "(eg. iso-8859-1).",
482 ["EMAIL_CHARSET"]), 486 ["EMAIL_CHARSET"]),
483 (FilePathOption, "debug", "", 487 (FilePathOption, "debug", "",
484 "Setting this option makes Roundup to write all outgoing email\n" 488 "Setting this option makes Roundup to write all outgoing email\n"
485 "messages to this file *instead* of sending them.\n" 489 "messages to this file *instead* of sending them.\n"
486 "This option has the same effect as environment variable" 490 "This option has the same effect as environment variable"
502 "if one isn't supplied in email subjects.\n" 506 "if one isn't supplied in email subjects.\n"
503 "To disable, leave the value blank.", 507 "To disable, leave the value blank.",
504 ["MAIL_DEFAULT_CLASS"]), 508 ["MAIL_DEFAULT_CLASS"]),
505 )), 509 )),
506 ("nosy", ( 510 ("nosy", (
507 (BooleanOption, "messages_to_author", "no", 511 (RunDetectorOption, "messages_to_author", "no",
508 "Send nosy messages to the author of the message", 512 "Send nosy messages to the author of the message.",
509 ["MESSAGES_TO_AUTHOR"]), 513 ["MESSAGES_TO_AUTHOR"]),
510 (Option, "signature_position", "bottom", 514 (Option, "signature_position", "bottom",
511 "Where to place the email signature\n" 515 "Where to place the email signature.\n"
512 "Allowed values: top, bottom, none", 516 "Allowed values: top, bottom, none",
513 ["EMAIL_SIGNATURE_POSITION"]), 517 ["EMAIL_SIGNATURE_POSITION"]),
514 (RunDetectorOption, "add_author", "new", 518 (RunDetectorOption, "add_author", "new",
515 "Does the author of a message get placed on the nosy list\n" 519 "Does the author of a message get placed on the nosy list\n"
516 "automatically? If 'new' is used, then the author will\n" 520 "automatically? If 'new' is used, then the author will\n"

Roundup Issue Tracker: http://roundup-tracker.org/