use defs file to look for COPYING, AUTHORS and THANKS files.
This commit is contained in:
parent
467bc8dde8
commit
c0ca8027af
|
@ -25,6 +25,8 @@ import config
|
|||
from contacts import Contacts
|
||||
from events import Events
|
||||
|
||||
import defs
|
||||
|
||||
interface = None # The actual interface (the gtk one for the moment)
|
||||
config = config.Config()
|
||||
version = config.get('version')
|
||||
|
|
|
@ -713,7 +713,13 @@ class AboutDialog:
|
|||
dlg.set_version(gajim.version)
|
||||
s = u'Copyright © 2003-2006 Gajim Team'
|
||||
dlg.set_copyright(s)
|
||||
text = open('../COPYING').read()
|
||||
copying_file_path = None
|
||||
if os.path.isfile(os.path.join(gajim.defs.docdir, 'COPYING')):
|
||||
copying_file_path = os.path.join(gajim.defs.docdir, 'COPYING')
|
||||
elif os.path.isfile('../COPYING'):
|
||||
copying_file_path = '../COPYING'
|
||||
if copying_file_path:
|
||||
text = open(copying_file_path).read()
|
||||
dlg.set_license(text)
|
||||
|
||||
dlg.set_comments('%s\n%s %s\n%s %s'
|
||||
|
@ -722,8 +728,14 @@ class AboutDialog:
|
|||
_('PyGTK Version:'), self.tuple2str(gtk.pygtk_version)))
|
||||
dlg.set_website('http://www.gajim.org/')
|
||||
|
||||
authors_file_path = None
|
||||
if os.path.isfile(os.path.join(gajim.defs.docdir, 'AUTHORS')):
|
||||
authors_file_path = os.path.join(gajim.defs.docdir, 'AUTHORS')
|
||||
elif os.path.isfile('../AUTHORS'):
|
||||
authors_file_path = '../AUTHORS'
|
||||
if authors_file_path:
|
||||
authors = []
|
||||
authors_file = open('../AUTHORS').read()
|
||||
authors_file = open(authors_file_path).read()
|
||||
authors_file = authors_file.split('\n')
|
||||
for author in authors_file:
|
||||
if author == 'CURRENT DEVELOPERS:':
|
||||
|
@ -733,9 +745,15 @@ class AboutDialog:
|
|||
elif author != '': # Real author line
|
||||
authors.append(author)
|
||||
|
||||
thanks_file_path = None
|
||||
if os.path.isfile(os.path.join(gajim.defs.docdir, 'THANKS')):
|
||||
thanks_file_path = os.path.join(gajim.defs.docdir, 'THANKS')
|
||||
elif os.path.isfile('../THANKS'):
|
||||
thanks_file_path = '../THANKS'
|
||||
if thanks_file_path:
|
||||
authors.append('\n' + _('THANKS:'))
|
||||
|
||||
text = open('../THANKS').read()
|
||||
text = open(thanks_file_path).read()
|
||||
text_splitted = text.split('\n')
|
||||
text = '\n'.join(text_splitted[:-2]) # remove one english sentence
|
||||
# and add it manually as translatable
|
||||
|
|
Loading…
Reference in New Issue