Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
solos committed Apr 8, 2014
2 parents b50b892 + 4830cec commit 5cbd7bf
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions linote.py
Expand Up @@ -2,6 +2,11 @@
# -*- coding: utf-8 -*-

import os
import sys

PROJECT_ROOT = os.path.abspath(os.path.dirname(__file__))
sys.path.append(PROJECT_ROOT)

import re
import local
import config
Expand All @@ -13,9 +18,9 @@
from logger import logger
from docutils.core import publish_parts
import evernote.edam.error.ttypes as Errors
import thrift.transport.THttpClient as THttpClient
import evernote.edam.notestore.NoteStore as NoteStore
import evernote.edam.type.ttypes as Types
import thrift.transport.THttpClient as THttpClient
from thrift.protocol.TBinaryProtocol import TBinaryProtocol

__version__ = '0.0.1'
Expand Down Expand Up @@ -82,8 +87,10 @@ def getNotebooks(self):
@check_rate_limit
def getNotebookDir(self, notebook):
if notebook.stack:
parent_dir = notebook.stack
subdir = '%s/%s' % (parent_dir, notebook.name)
#parent_dir = notebook.stack
parent_dir = os.path.join(PROJECT_ROOT, notebook.stack)
#subdir = '%s/%s' % (parent_dir, notebook.name)
subdir = os.path.join(PROJECT_ROOT, parent_dir, notebook.name)
if not os.path.isdir(parent_dir):
os.mkdir(parent_dir)
if not os.path.isdir(subdir):
Expand Down Expand Up @@ -125,8 +132,10 @@ def chdir(self, notedir):
logger.error(e)

def format(self, note):
_, content = encoding.html_to_unicode('', note.content)
content = encoding_match.sub('', content)
content = ''
if note is None:
_, content = encoding.html_to_unicode('', note.content)
content = encoding_match.sub('', content)
return content

def clean_note(self, content):
Expand Down

0 comments on commit 5cbd7bf

Please sign in to comment.