Did I find the right examples for you? yes no

All Samples(16)  |  Call(12)  |  Derive(0)  |  Import(4)
'joe', int(1) -> 'joe@1.pub'
'joe', None   -> 'joe.pub'

        def joinkey(name, machine):
    ''' 'joe', int(1) -> 'joe@1.pub'
        'joe', None   -> 'joe.pub'
    '''

    if machine is None: return name + '.pub'
    else:               return '%s@%s.pub' % (name, machine)
        


src/g/i/gitolite-sshkey-form-0.2.1/gitolite_sshkey_form/dir.py   gitolite-sshkey-form(Download)
from os import unlink, makedirs
from os.path import basename, join as pjoin, exists, isdir
from util import nextinseq, splitkey, joinkey
 
 
    def addkey(self, user, data):
        nums = [i[1] for i in self.listkeys(user, True)]
        next = nextinseq(nums)
 
        fn = pjoin(self.keydir, joinkey(user, next))
    def dropkey(self, user, machine):
        if machine == 'None': machine = None # @bug
 
        fn = pjoin(self.keydir, joinkey(user, machine))
 
    def _keypath(self, name, machine):
        return pjoin( self.keydir, joinkey(name, machine))
 
 

src/g/i/gitolite-sshkey-form-HEAD/gitolite_sshkey_form/dir.py   gitolite-sshkey-form(Download)
from os import unlink, makedirs
from os.path import basename, join as pjoin, exists, isdir
from util import nextinseq, splitkey, joinkey
 
 
    def addkey(self, user, data):
        nums = [i[1] for i in self.listkeys(user, True)]
        next = nextinseq(nums)
 
        fn = pjoin(self.keydir, joinkey(user, next))
    def dropkey(self, user, machine):
        if machine == 'None': machine = None # @bug
 
        fn = pjoin(self.keydir, joinkey(user, machine))
 
    def _keypath(self, name, machine):
        return pjoin( self.keydir, joinkey(name, machine))
 
 

src/g/i/gitolite-sshkey-form-0.2.1/gitolite_sshkey_form/gitolite.py   gitolite-sshkey-form(Download)
 
from os.path import basename, join as pjoin
from util import nextinseq, splitkey, joinkey
 
 
    def addkey(self, user, data):
        nums = [i[1] for i in self.listkeys(user, True)]
        next = nextinseq(nums)
 
        fn = pjoin(self.keydir, joinkey(user, next))
    def dropkey(self, user, machine):
        if machine == 'None': machine = None # @bug
 
        fn = pjoin(self.keydir, joinkey(user, machine))
 
        return pjoin(self.gitadm.repo.working_dir,
                     self.keydir,
                     joinkey(name, machine))
 
 

src/g/i/gitolite-sshkey-form-HEAD/gitolite_sshkey_form/gitolite.py   gitolite-sshkey-form(Download)
 
from os.path import basename, join as pjoin
from util import nextinseq, splitkey, joinkey
 
 
    def addkey(self, user, data):
        nums = [i[1] for i in self.listkeys(user, True)]
        next = nextinseq(nums)
 
        fn = pjoin(self.keydir, joinkey(user, next))
    def dropkey(self, user, machine):
        if machine == 'None': machine = None # @bug
 
        fn = pjoin(self.keydir, joinkey(user, machine))
 
        return pjoin(self.gitadm.repo.working_dir,
                     self.keydir,
                     joinkey(name, machine))