예제 #1
0
 def __init__(self, name, content, public=True, user=None, env_name=None):
     self.aserver_api = get_binstar()
     self.name = parameterize(name)
     self.content = content
     self.summary = "IPython notebook"
     self.public = public
     self.username = user
     self.env_name = env_name
     if self.username is None:
         self.username = self.aserver_api.user()['login']
    def __init__(self, name, content):
        self.aserver_api = get_server_api()
        self.name = parameterize(name)
        self.content = content
        self.summary = self.metadata.get("summary", "Jupyter Notebook")
        self.username = self.metadata.get("organization", None)
        if self.metadata.get("attach-environment", None):
            self.env_name = self.metadata.get("environment", None)
            if self.env_name is None:
                self.env_name = self.default_env()
        else:
            self.env_name = None

        if self.username is None:
            self.username = self.aserver_api.user()['login']
예제 #3
0
    def __init__(self, name, content):
        self.aserver_api = get_server_api()
        self.name = parameterize(name)
        self.content = content
        self.summary = self.metadata.get("summary", "Jupyter Notebook")
        self.username = self.metadata.get("organization", None)
        if self.metadata.get("attach-environment", None):
            self.env_name = self.metadata.get("environment", None)
            if self.env_name is None:
                ksname = self.ksname
                if ksname in ["python2", "python3"]:
                    # we are dealing with the native kernel, so let's find out
                    # the name of the env where that kernel lives
                    self.env_name = self.default_env()
                else:
                    # ksname comes in the form conda-env-name-[py/r] or
                    # conda-root-[py/r] so split them and catch the name
                    self.env_name = ksname.split("-")[-2]
        else:
            self.env_name = None

        if self.username is None:
            self.username = self.aserver_api.user()['login']
예제 #4
0
 def test_one_directory(self):
     self.assertEqual(inflection.parameterize(u"Donald E. Knuth"), 'donald-e-knuth')
 def test_one_directory(self):
     self.assertEqual(inflection.parameterize(u"Donald E. Knuth"),
                      'donald-e-knuth')