Permalink
Browse files

MB-100: refactored gen_dockey method

Change-Id: Id20981d98e974edfc709e72bbe8633847094dbe1
Reviewed-on: http://review.couchbase.org/17994
Reviewed-by: Bin Cui <bin.cui@gmail.com>
Tested-by: Pavel Paulau <pavel.paulau@gmail.com>
  • Loading branch information...
1 parent 95f59b0 commit 324277af5d68be8344b6a55157a0f69a1c651bd9 @pavel-paulau pavel-paulau committed with pavel-paulau Jul 6, 2012
Showing with 1 addition and 5 deletions.
  1. +1 −5 docloader
View
@@ -7,7 +7,6 @@ import os
import os.path
import simplejson as json
from tempfile import TemporaryFile
-import re
from optparse import OptionParser
from couchbase import client
@@ -65,10 +64,7 @@ class DocLoader:
views.append(viewpath)
def gen_dockey(self, filename):
- fileslashed = re.split(".json", filename)
- fileinlist = re.split("/", fileslashed[0])
- file_for_key = fileinlist.pop()
- return file_for_key
+ return os.path.basename(filename).split('.')[0]
def list_files(self, bucket, views, subdir=None):
if not subdir:

0 comments on commit 324277a

Please sign in to comment.