]> git.phdru.name Git - bookmarks_db.git/commitdiff
Feat(Python3): exec statement -> exec() function
authorOleg Broytman <phd@phdru.name>
Sat, 13 May 2017 16:20:21 +0000 (19:20 +0300)
committerOleg Broytman <phd@phdru.name>
Sat, 13 May 2017 17:09:01 +0000 (20:09 +0300)
robots.py
storage.py
writers.py

index 3efb8f02de8dcee0a4b3429a474c160992b8d8d6..77dc446d33463a499b222b469b97777db90ab743 100644 (file)
--- a/robots.py
+++ b/robots.py
@@ -5,7 +5,7 @@ This file is a part of Bookmarks database and Internet robot.
 """
 
 __author__ = "Oleg Broytman <phd@phdru.name>"
-__copyright__ = "Copyright (C) 1997-2014 PhiloSoft Design"
+__copyright__ = "Copyright (C) 1997-2017 PhiloSoft Design"
 __license__ = "GNU GPL"
 
 __all__ = ['import_robot', 'robot']
@@ -17,8 +17,8 @@ from bkmk_objects import parse_params, set_params
 robot_name, robot_params = parse_params(environ.get("BKMK_ROBOT", "forking"))
 
 def import_robot(robot_name):
-   exec "from Robots import bkmk_r%s" % robot_name
-   exec "robot = bkmk_r%s.robot_%s" % (robot_name, robot_name)
+   exec("from Robots import bkmk_r%s" % robot_name)
+   exec("robot = bkmk_r%s.robot_%s" % (robot_name, robot_name))
    return robot
 
 robot = import_robot(robot_name)
index 9c806e43f97933705383d114ed363ae2b5bc2722..7b6ca06ed31328b93425540718bda75716646e93 100644 (file)
@@ -5,7 +5,7 @@ This file is a part of Bookmarks database and Internet robot.
 """
 
 __author__ = "Oleg Broytman <phd@phdru.name>"
-__copyright__ = "Copyright (C) 1997-2014 PhiloSoft Design"
+__copyright__ = "Copyright (C) 1997-2017 PhiloSoft Design"
 __license__ = "GNU GPL"
 
 __all__ = ['import_storage', 'storage']
@@ -17,8 +17,8 @@ from bkmk_objects import parse_params, set_params
 storage_name, storage_params = parse_params(environ.get("BKMK_STORAGE", "pickle"))
 
 def import_storage(storage_name):
-   exec "from Storage import bkmk_st%s" % storage_name
-   exec "storage = bkmk_st%s.storage_%s" % (storage_name, storage_name)
+   exec("from Storage import bkmk_st%s" % storage_name)
+   exec("storage = bkmk_st%s.storage_%s" % (storage_name, storage_name))
    return storage
 
 storage = import_storage(storage_name)
index 57d963cfbb2f15e3d10d6394138c9b527c982dbe..952a23227bb9fb6da66e0abb408c841717256064 100644 (file)
@@ -5,7 +5,7 @@ This file is a part of Bookmarks database and Internet robot.
 """
 
 __author__ = "Oleg Broytman <phd@phdru.name>"
-__copyright__ = "Copyright (C) 1997-2014 PhiloSoft Design"
+__copyright__ = "Copyright (C) 1997-2017 PhiloSoft Design"
 __license__ = "GNU GPL"
 
 __all__ = ['import_writer', 'writer']
@@ -17,8 +17,8 @@ from bkmk_objects import parse_params, set_params
 writer_name, writer_params = parse_params(environ.get("BKMK_WRITER", "html"))
 
 def import_writer(writer_name):
-   exec "from Writers import bkmk_w%s" % writer_name
-   exec "writer = bkmk_w%s.writer_%s" % (writer_name, writer_name)
+   exec("from Writers import bkmk_w%s" % writer_name)
+   exec("writer = bkmk_w%s.writer_%s" % (writer_name, writer_name))
    return writer
 
 writer = import_writer(writer_name)