def process_gitmarks_cmd(opts, args): """ processes a gitmarks command opts is list of options. args is 1 or more URL's to process. """ # -- each arg is a URL. for arg in args: g = gitmark(arg,settings.USER_NAME) if 'tags' in opts.keys(): g.addTags(opts['tags']) if 'private' in opts.keys(): g.setPrivacy(opts['private']) # -- get content, and autogen title if canHazWebs(): g.getContent() g.parseTitle() else: print "no netz! overriding push to false!" opts['push'] = False doPush = opts['push'] if 'push' in opts.keys() else 'False' updateRepoWith(g, doPush)
def process_gitmarks_cmd(opts, args): """ processes a gitmarks command opts is list of options. args is 1 or more URL's to process. """ # -- each arg is a URL. for arg in args: g = gitmark(arg, settings.USER_NAME) if 'tags' in opts.keys(): g.addTags(opts['tags']) if 'private' in opts.keys(): g.setPrivacy(opts['private']) # -- get content, and autogen title if canHazWebs(): g.getContent() g.parseTitle() else: print "no netz! overriding push to false!" opts['push'] = False doPush = opts['push'] if 'push' in opts.keys() else 'False' updateRepoWith(g, doPush)
for post_index, post in enumerate(post_list): try: url = post.getAttribute('href') desc = post.getAttribute('description') timestamp = post.getAttribute('time') raw_tags = post.getAttribute('tag') extended = post.getAttribute('extended') meta = post.getAttribute('meta') # turn a comma separated list of tags into a real list of tags tags = [tag.lstrip().rstrip() for tag in raw_tags.split()] privateString = post.getAttribute('private') g = gitmark(url, 'delicious:' + str(username)) g.description = desc g.tags = tags g.time = timestamp g.rights = None g.meta = meta g.extended = extended if (privateString == "0"): print "not private" g.private = False newMarksList.append(g) #break, for single test break
newMarksList = [] for post_index, post in enumerate(post_list): try: url = post.getAttribute("href") desc = post.getAttribute("description") timestamp = post.getAttribute("time") raw_tags = post.getAttribute("tag") extended = post.getAttribute("extended") meta = post.getAttribute("meta") # turn a comma separated list of tags into a real list of tags tags = [tag.lstrip().rstrip() for tag in raw_tags.split()] privateString = post.getAttribute("private") g = gitmark(url, "delicious:" + str(username)) g.description = desc g.tags = tags g.time = timestamp g.rights = None g.meta = meta g.extended = extended if privateString == "0" or privateString == "": g.private = False newMarksList.append(g) # break here for single test without data resetting/fixing except (KeyboardInterrupt, SystemExit): print >> sys.stderr, ("backup interrupted by KeyboardInterrupt/SystemExit")
for post_index, post in enumerate(post_list): try: url = post.getAttribute('href') desc = post.getAttribute('description') timestamp = post.getAttribute('time') raw_tags = post.getAttribute('tag') extended = post.getAttribute('extended') meta = post.getAttribute('meta') # turn a comma separated list of tags into a real list of tags tags = [tag.lstrip().rstrip() for tag in raw_tags.split()] privateString = post.getAttribute('private') g = gitmark(url, 'delicious:' + str(username)) g.description = desc g.tags = tags g.time = timestamp g.rights = None g.meta = meta g.extended = extended if(privateString == "0"): print "not private" g.private = False newMarksList.append(g) #break, for single test break