finish menu with album import
This commit is contained in:
parent
1fc9c48d2c
commit
6401692d0d
@ -170,7 +170,7 @@ if __name__ == '__main__':
|
|||||||
import_parser.add_argument("--no-create", help="No create post", dest="create", default="store_false", action="store_true")
|
import_parser.add_argument("--no-create", help="No create post", dest="create", default="store_false", action="store_true")
|
||||||
import_parser.add_argument("--no-update", help="No update post", dest="update", default="store_false", action="store_true")
|
import_parser.add_argument("--no-update", help="No update post", dest="update", default="store_false", action="store_true")
|
||||||
import_parser.add_argument("--no-image", help="No image add or update", dest="image", default="store_false", action="store_true")
|
import_parser.add_argument("--no-image", help="No image add or update", dest="image", default="store_false", action="store_true")
|
||||||
import_parser.add_argument("--author", help="Define author for page album", default="")
|
import_parser.add_argument("--author-album", dest=author, help="Define author for page album", default="")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -264,7 +264,6 @@ if __name__ == '__main__':
|
|||||||
for i in wordpress:
|
for i in wordpress:
|
||||||
importWp.setUrl(i)
|
importWp.setUrl(i)
|
||||||
importWp.fromFile(files=args.file.split(","))
|
importWp.fromFile(files=args.file.split(","))
|
||||||
exit(0)
|
|
||||||
menuWp = WPMenu(name="Thread-1", basic=basic, wordpress=args.wordpress, logger=logger, parser=args.parser, ssl_canalblog=ssl_canalblog, ssl_wordpress=ssl_wordpress)
|
menuWp = WPMenu(name="Thread-1", basic=basic, wordpress=args.wordpress, logger=logger, parser=args.parser, ssl_canalblog=ssl_canalblog, ssl_wordpress=ssl_wordpress)
|
||||||
menuWp.fromFile("{0}".format(args.file.split(",")[0]))
|
menuWp.fromFile("{0}".format(args.file.split(",")[0]))
|
||||||
if len(args.directory) > 0:
|
if len(args.directory) > 0:
|
||||||
|
@ -91,9 +91,11 @@ class WPMenu:
|
|||||||
search = "posts"
|
search = "posts"
|
||||||
post_type = "post"
|
post_type = "post"
|
||||||
if len(articletitle) == 0:
|
if len(articletitle) == 0:
|
||||||
articletitle = soup.find("div", class_="albumbody").find("h2").get_text()
|
articletitle = soup.find_all("div", class_="albumbody")
|
||||||
search = "pages"
|
if len(articletitle) > 0:
|
||||||
post_type = "page"
|
articletitle = articletitle[0].find("h2").get_text()
|
||||||
|
search = "pages"
|
||||||
|
post_type = "page"
|
||||||
|
|
||||||
exist = False
|
exist = False
|
||||||
for index in range(1,10):
|
for index in range(1,10):
|
||||||
@ -171,7 +173,7 @@ class WPMenu:
|
|||||||
title = title[::-1]
|
title = title[::-1]
|
||||||
self._logger.info("{0} link {1} title {2}".format(self._name, link, title))
|
self._logger.info("{0} link {1} title {2}".format(self._name, link, title))
|
||||||
if link == "index.html":
|
if link == "index.html":
|
||||||
if second_title == "archives" or second_title == "albums":
|
if second_title == "albums":
|
||||||
idMenu = self._getIdFromPost(href)
|
idMenu = self._getIdFromPost(href)
|
||||||
else:
|
else:
|
||||||
idMenu = self._getId(title)
|
idMenu = self._getId(title)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user