Permalink
Browse files

add a blog list to follow

  • Loading branch information...
sdpython committed May 10, 2015
1 parent b04eeb4 commit 7862f7e5a1c6a4b6157182afb8dedfe76be34f91
Showing with 97 additions and 5 deletions.
  1. +3 −0 .gitignore
  2. +74 −0 _unittests/ut_module/test_write_script.py
  3. +3 −1 setup.py
  4. +4 −4 src/code_beatrix/__init__.py
  5. +13 −0 src/code_beatrix/rss_blog_list.xml
View
@@ -244,4 +244,7 @@ _doc/sphinxdoc/source/blog/feed-icon*.png
_doc/notebooks/.ipynb_checkpoints/*
_doc/notebooks/*/.ipynb_checkpoints/*
auto_*.bat
auto_*.py
auto_*.xml
auto_*.db3
auto_setup_dep.py
@@ -0,0 +1,74 @@
"""
@brief test tree node (time=5s)
"""
import sys
import os
import unittest
import re
import shutil
import warnings
try:
import src
except ImportError:
path = os.path.normpath(
os.path.abspath(
os.path.join(
os.path.split(__file__)[0],
"..",
"..")))
if path not in sys.path:
sys.path.append(path)
import src
try:
import pyquickhelper
except ImportError:
path = os.path.normpath(
os.path.abspath(
os.path.join(
os.path.split(__file__)[0],
"..",
"..",
"..",
"pyquickhelper",
"src")))
if path not in sys.path:
sys.path.append(path)
import pyquickhelper
from pyquickhelper import fLOG, get_temp_folder
from pyquickhelper import write_module_scripts
from src.code_beatrix import __blog__
class TestWriteScript(unittest.TestCase):
def test_write_script(self):
fLOG(
__file__,
self._testMethodName,
OutputPrint=__name__ == "__main__")
temp = get_temp_folder(__file__, "temp_write_script")
res = write_module_scripts(temp, "win32", __blog__)
assert len(res) > 1
for c in res:
assert os.path.exists(c)
with open(c, "r") as f:
content = f.read()
if "__" in content:
for line in content.split("\n"):
if "__" in line and "sys.path.append" not in line:
raise Exception(content)
if ".xml" in c:
if '<outline text="' not in content:
raise Exception(content)
if __name__ == "__main__":
unittest.main()
View
@@ -75,6 +75,7 @@
project_var_name + ".scratch.example_pyramide": ["*.sb2"],
project_var_name + ".scratch.example_chute": ["*.sb2"],
project_var_name + ".jsscripts.snap": ["*.*"],
project_var_name: ["rss_blog_list.xml"],
}
############
@@ -184,7 +185,8 @@ def write_version():
r = pyquickhelper.process_standard_options_for_setup(
sys.argv, __file__, project_var_name,
unittest_modules=["pyquickhelper"],
requirements=["pyquickhelper"])
requirements=["pyquickhelper"],
blog_list=os.path.abspath(os.path.join("src", project_var_name, package_data[project_var_name][0])))
else:
r = False
@@ -3,17 +3,17 @@
@file
@brief Main file
"""
import sys
if sys.version_info[0] < 3:
raise ImportError("pyensae only works with Python 3")
import os
__version__ = "0.5"
__author__ = "Xavier Dupré"
__github__ = "https://github.com/sdpython/code_beatrix"
__url__ = "http://lesenfantscodaient/"
__downloadUrl__ = "http://www.xavierdupre.fr/site2013/index_code.html#code_beatrix"
__license__ = "BSD License"
__blog__ = os.path.abspath(
os.path.join(os.path.dirname(__file__), "rss_blog_list.xml"))
from .scratchs import check
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<opml version="1.0">
<head>
<title>blog</title>
</head>
<body>
<outline text="lesenfantscodaient.fr"
title="lesenfantscodaient.fr"
type="rss"
xmlUrl="http://lesenfantscodaient.fr/_downloads/rss.xml"
htmlUrl="http://lesenfantscodaient.fr/blog/main_0000.html" />
</body>
</opml>

0 comments on commit 7862f7e

Please sign in to comment.