How to use the sma.utils function in sma

To help you get started, we’ve selected a few sma examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github sdockray / sma / sma / archiver.py View on Github external
ouput = "%s---\n" % output
		if self.link and self.link in self.links:
			output = "%s%s\n" % (output, self.links[self.link].markdownify(summary=True))
		urls = utils.extract_urls(initial_message)
		for u in urls:
			if not u==self.link and u in self.links:
				output = "%s%s\n" % (output, self.links[u].markdownify(summary=True))
		output = "%s\n" % output
		for c in self.comments:
			output = "%s**%s:**\n%s\n\n" % (output, c.user.name, mdl(c.message))
		self.save_markdown(output, save_location=save_location) 
		#
		users_str = ' - '.join([self.users[k].name for k in self.users])
		if not save_location:
			title = initial_message if initial_message else self.link if hasattr(self, 'link') and self.link else 'no title available'
			title = utils.truncate(re.sub('[\r\n]', ' / ', title), 180)
			files.save_txt(title, subdir=self.id, filename="title.txt")
github sdockray / sma / sma / archiver.py View on Github external
def extract_links(self, s, description_override=None):
		urls = utils.extract_urls(s)
		description = s if not description_override else description_override
		for u in urls:
			if not u in self.links:
				self.links[u] = Link(u, description=description)