summaryrefslogtreecommitdiff
path: root/yarns/lib.py
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2018-01-19 19:16:57 +0200
committerLars Wirzenius <liw@liw.fi>2018-01-19 19:16:57 +0200
commit66fe1de8368ba7e754fa6dad798bf351f3c3bf93 (patch)
treee1e410beeaa3264212f2760debfbcfeebd46c50d /yarns/lib.py
parent3bc16ac24091009e73d9c4b9c2fbda0cdca6cff5 (diff)
downloadick2-66fe1de8368ba7e754fa6dad798bf351f3c3bf93.tar.gz
Change: builds are now numbered foo/123, as are logs
Diffstat (limited to 'yarns/lib.py')
-rw-r--r--yarns/lib.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/yarns/lib.py b/yarns/lib.py
index cd95b6e..0914b00 100644
--- a/yarns/lib.py
+++ b/yarns/lib.py
@@ -13,6 +13,8 @@
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+import base64
import errno
import json
import os
@@ -218,3 +220,7 @@ def list_diff(a, b):
if delta:
return '\n'.join(delta)
return None
+
+
+def encode_basename(basename):
+ return base64.urlsafe_b64encode(basename.encode()).decode('ascii')