예제 #1
0
    # Make the _() function available even if gettext is not working.
    import __builtin__
    if not hasattr(__builtin__, '_'):
        __builtin__.__dict__['_'] = lambda s: s

## ------------------- end Enable i18n -------------------------------


from rednotebook.util import utils
from rednotebook.util import markup
from rednotebook import info
from rednotebook import configuration
from rednotebook import data


args = info.get_commandline_parser().parse_args()

## ---------------------- Enable logging -------------------------------

def setup_logging(log_file):
    file_logging_stream = open(log_file, 'w')

    # We want to have all stdout and stderr messages in the logfile.
    # In the frozen version we cannot log to sys.stderr because it's
    # broken on windows. Stdout doesn't work either it seems.
    stderr_streams = [file_logging_stream]
    stdout_streams = [file_logging_stream]
    if not filesystem.main_is_frozen():
        stderr_streams.append(sys.__stderr__)
        stdout_streams.append(sys.__stdout__)
    sys.stderr = utils.StreamDuplicator(stderr_streams)
예제 #2
0
https://github.com/tobias47n9e/pygobject-locale
https://sourceforge.net/p/pygobjectwin32/tickets/27/

"""

elibintl.install(GETTEXT_DOMAIN, LOCALE_PATH, libintl=None)

# ------------------- end Enable i18n -------------------------------

from rednotebook.util import utils
from rednotebook.util import markup
from rednotebook import info
from rednotebook import configuration
from rednotebook import data

args = info.get_commandline_parser().parse_args()

# ---------------------- Enable logging -------------------------------


def setup_logging(log_file):
    file_logging_stream = open(log_file, 'w')

    # We want to have all stdout and stderr messages in the logfile.
    # In the frozen version we cannot log to sys.stderr because it's
    # broken on windows. Stdout doesn't work either it seems.
    stderr_streams = [file_logging_stream]
    stdout_streams = [file_logging_stream]
    if not filesystem.main_is_frozen():
        stderr_streams.append(sys.__stderr__)
        stdout_streams.append(sys.__stdout__)
예제 #3
0
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# RedNotebook is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with RedNotebook; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
# -----------------------------------------------------------------------

from rednotebook import info

commandline_help = info.get_commandline_parser().format_help()

tags = _("Tags")

greeting = _("Hello!")
intro = _("Some example text has been added to help you start and "
          "you can erase it whenever you like.")
# Translators: "Help" -> noun
help_par = _("The example text and more documentation is available under "
             '"Help" -> "Contents".')

# Translators: noun
preview = _("Preview")
preview1 = _("There are two modes in RedNotebook, the __edit__ mode and the "
             "__preview__ mode.")
preview2 = _("Click on Edit above to see the difference.")