Exemplo n.º 1
0
    def make_empty_template_files(self):
        global help_text

        files = []
        for day_number in range(1, 8):
            weekday = WEEKDAYS[day_number - 1]
            files.append((
                self.get_path(str(day_number)),
                example_text.replace("template ===",
                                     "template for %s ===" % weekday),
            ))

        help_text %= self.dirs.template_dir

        files.append((self.get_path("Help"), help_text))

        # Only add the example templates the first time and just restore
        # the day templates everytime
        if self.main_window.journal.is_first_start:
            files.append((self.get_path("Meeting"), meeting))
            files.append((self.get_path("Journey"), journey))
            files.append((self.get_path("Call"), call))
            files.append((self.get_path("Personal"), personal))

        filesystem.make_files(files)
Exemplo n.º 2
0
    def make_empty_template_files(self):
        global help_text

        files = []
        for day_number in range(1, 8):
            weekday = WEEKDAYS[day_number - 1]
            files.append((self.get_template_file(day_number),
                          example_text.replace('template ===',
                                               'template for %s ===' % weekday)))

        help_text %= (self.dirs.template_dir)

        files.append((self.get_template_file('Help'), help_text))

        # Only add the example templates the first time and just restore
        # the day templates everytime
        if self.main_window.journal.is_first_start:
            files.append((self.get_template_file('Meeting'), meeting))
            files.append((self.get_template_file('Journey'), journey))
            files.append((self.get_template_file('Call'), call))
            files.append((self.get_template_file('Personal'), personal))

        filesystem.make_files(files)
Exemplo n.º 3
0
    def make_empty_template_files(self):
        global help_text

        files = []
        for day_number in range(1, 8):
            files.append((self.get_template_file(day_number), example_text))

        help_text %= (self.dirs.template_dir)

        files.append((self.get_template_file('Help'), help_text))

        # Only add the example templates the first time and just restore
        # the day templates everytime
        if not self.main_window.journal.is_first_start:
            filesystem.make_files(files)
            return

        files.append((self.get_template_file('Meeting'), meeting))
        files.append((self.get_template_file('Journey'), journey))
        files.append((self.get_template_file('Call'), call))
        files.append((self.get_template_file('Personal'), personal))

        filesystem.make_files(files)
Exemplo n.º 4
0
	def make_empty_template_files(self):
		def get_instruction(day_number):
			file = self.get_template_file(day_number)
			#text = '''\
#The template for this weekday has not been edited. 
#If you want to have some text that you can add to that day every week, \
#edit the file [%s ""%s""] in a text editor.
#
#To do so, you can switch to "Preview" and click on the link to that file.
#			''' % (os.path.basename(file), file)
			text = example_text
			return text
					
		file_content_pairs = []
		for day_number in range(1, 8):
			file_content_pairs.append((self.get_template_file(day_number), get_instruction(day_number)))
		
		template_help_text = '''\
Besides templates for weekdays you can also have arbitrary named templates. 
For example you might want to have a template for "Meeting" or "Journey".
All templates must reside in the directory "%s".

To create a new template, just save an ordinary textfile in that directory. \
You can use your favourite text editing program for that task \
(e.g. gedit on Linux or the editor on Win). 
The name of the newly created file will be the template's title.

You can switch to "Preview" mode and click on the link to get to the \
[template directory ""%s""].

If you come up with templates that could be useful for other people as well, \
I would appreciate if you sent me your template file, so others can benefit \
from it.
		''' % (self.dirs.template_dir, self.dirs.template_dir)
		
		template_help_filename = self.get_template_file('Help')
		file_content_pairs.append((template_help_filename, template_help_text))
		
		# Only add the example templates the first time and just restore
		# the day templates everytime
		if not self.main_window.journal.dirs.is_first_start:
			filesystem.make_files(file_content_pairs)
			return
		
		
		template_meeting_text = '''\
=== Meeting ===
Group name, date, and place

**Present**

 - Axxxx
 - Bxxxx
 - Cxxx
 - Dxxxxx
 - Exxxx


**Agenda**

 - Xxxx xxxxx xxxxxxx xxxx
 - Xxxxxxx xxxxxxxxx xxxx xxxx
   - Xxxx xxxxx


**Discussion, decisions, assignments**

First agenda item: Xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Second agenda item: Xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx. Xxxxxxxxxxxxx

Additional items: Xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx. Xxxxxxxxxxxxxxxxxxxxx


**Tentative agenda for the next meeting**

 - Xxxxxxxxxxxxxxx Xxxxx Xxxxxxxxxxx
 - Xxxxxxxxxx Xxxxxxxxxxxx
		'''
		
		template_meeting_filename = self.get_template_file('Meeting')
		file_content_pairs.append((template_meeting_filename, template_meeting_text))
		
		
		template_journey_text = '''\
=== Journey ===
**Date:** xx.xx.xxxx

**Location:** 

**Participants:**

**The trip:** 
First we went to xxxxx then we got to yyyyy ...

**Pictures:** [Image folder ""/path/to/the/images/""]
		'''
		
		template_journey_filename = self.get_template_file('Journey')
		file_content_pairs.append((template_journey_filename, template_journey_text))
		
		
		filesystem.make_files(file_content_pairs)