mirror of
https://github.com/jrnl-org/jrnl.git
synced 2025-05-10 16:48:31 +02:00
Merge master and fix merge conflict
Signed-off-by: Aniket Pant <me@aniketpant.com>
This commit is contained in:
commit
5e448270d2
4 changed files with 10 additions and 6 deletions
|
@ -2,12 +2,10 @@ language: python
|
|||
python:
|
||||
- "2.6"
|
||||
- "2.7"
|
||||
- "3.2"
|
||||
- "3.3"
|
||||
install: "pip install -r requirements.txt --use-mirrors"
|
||||
# command to run tests
|
||||
script: nosetests
|
||||
matrix:
|
||||
allow_failures: # python 3 support for travis is shaky....
|
||||
- python: 3.2
|
||||
- python: 3.3
|
||||
|
|
|
@ -3,10 +3,16 @@ Changelog
|
|||
|
||||
#### 1.1.1
|
||||
|
||||
<<<<<<< HEAD
|
||||
* [New] Export to multiple files
|
||||
* [New] Feature to export to given output file
|
||||
|
||||
#### 1.1.0
|
||||
=======
|
||||
* [Fixed] Unicode and Python3 issues resolved.
|
||||
|
||||
### 1.1.0
|
||||
>>>>>>> master
|
||||
|
||||
* [New] JSON export exports tags as well.
|
||||
* [Improved] Nicer error message when there is a syntactical error in your config file.
|
||||
|
|
|
@ -15,7 +15,7 @@ class Entry:
|
|||
|
||||
def parse_tags(self):
|
||||
fulltext = " ".join([self.title, self.body]).lower()
|
||||
tags = re.findall(ur'([{}]\w+)'.format(self.journal.config['tagsymbols']), fulltext, re.UNICODE)
|
||||
tags = re.findall(r'(?u)([{}]\w+)'.format(self.journal.config['tagsymbols']), fulltext, re.UNICODE)
|
||||
self.tags = set(tags)
|
||||
|
||||
def __unicode__(self):
|
||||
|
|
|
@ -171,13 +171,13 @@ class Journal(object):
|
|||
lambda match: self._colorize(match.group(0)),
|
||||
pp, re.UNICODE)
|
||||
else:
|
||||
pp = re.sub(ur"(?u)([{}]\w+)".format(self.config['tagsymbols']),
|
||||
pp = re.sub(r"(?u)([{}]\w+)".format(self.config['tagsymbols']),
|
||||
lambda match: self._colorize(match.group(0)),
|
||||
pp)
|
||||
return pp
|
||||
|
||||
def __repr__(self):
|
||||
return "<Journal with %d entries>" % len(self.entries)
|
||||
return "<Journal with {} entries>".format(len(self.entries))
|
||||
|
||||
def write(self, filename=None):
|
||||
"""Dumps the journal into the config file, overwriting it"""
|
||||
|
@ -230,7 +230,7 @@ class Journal(object):
|
|||
for m in matches:
|
||||
date = e.date.strftime(self.config['timeformat'])
|
||||
excerpt = e.body[m.start():min(len(e.body), m.end()+60)]
|
||||
res.append('%s %s ..' % (date, excerpt))
|
||||
res.append('{} {} ..'.format(date, excerpt))
|
||||
e.body = "\n".join(res)
|
||||
else:
|
||||
for e in self.entries:
|
||||
|
|
Loading…
Add table
Reference in a new issue