id
int32 0
252k
| repo
stringlengths 7
55
| path
stringlengths 4
127
| func_name
stringlengths 1
88
| original_string
stringlengths 75
19.8k
| language
stringclasses 1
value | code
stringlengths 75
19.8k
| code_tokens
list | docstring
stringlengths 3
17.3k
| docstring_tokens
list | sha
stringlengths 40
40
| url
stringlengths 87
242
|
|---|---|---|---|---|---|---|---|---|---|---|---|
239,100
|
ZeitOnline/sphinx_elasticsearch
|
src/sphinx_elasticsearch/parse_json.py
|
process_headers
|
def process_headers(data, filename):
"""Read headers from toc data."""
headers = []
if 'toc' in data:
for element in PyQuery(data['toc'])('a'):
headers.append(recurse_while_none(element))
if None in headers:
log.info('Unable to index file headers for: %s', filename)
return headers
|
python
|
def process_headers(data, filename):
"""Read headers from toc data."""
headers = []
if 'toc' in data:
for element in PyQuery(data['toc'])('a'):
headers.append(recurse_while_none(element))
if None in headers:
log.info('Unable to index file headers for: %s', filename)
return headers
|
[
"def",
"process_headers",
"(",
"data",
",",
"filename",
")",
":",
"headers",
"=",
"[",
"]",
"if",
"'toc'",
"in",
"data",
":",
"for",
"element",
"in",
"PyQuery",
"(",
"data",
"[",
"'toc'",
"]",
")",
"(",
"'a'",
")",
":",
"headers",
".",
"append",
"(",
"recurse_while_none",
"(",
"element",
")",
")",
"if",
"None",
"in",
"headers",
":",
"log",
".",
"info",
"(",
"'Unable to index file headers for: %s'",
",",
"filename",
")",
"return",
"headers"
] |
Read headers from toc data.
|
[
"Read",
"headers",
"from",
"toc",
"data",
"."
] |
cc5ebc18683439bd0949069045fcfd0290476edd
|
https://github.com/ZeitOnline/sphinx_elasticsearch/blob/cc5ebc18683439bd0949069045fcfd0290476edd/src/sphinx_elasticsearch/parse_json.py#L91-L99
|
239,101
|
kervi/kervi-devices
|
kervi/devices/sensors/TSL2561.py
|
TSL2561DeviceDriver.set_gain
|
def set_gain(self, gain=1):
""" Set the gain """
if gain == 1:
self.i2c.write8(0x81, 0x02)
else:
self.i2c.write8(0x81, 0x12)
time.sleep(self.pause)
|
python
|
def set_gain(self, gain=1):
""" Set the gain """
if gain == 1:
self.i2c.write8(0x81, 0x02)
else:
self.i2c.write8(0x81, 0x12)
time.sleep(self.pause)
|
[
"def",
"set_gain",
"(",
"self",
",",
"gain",
"=",
"1",
")",
":",
"if",
"gain",
"==",
"1",
":",
"self",
".",
"i2c",
".",
"write8",
"(",
"0x81",
",",
"0x02",
")",
"else",
":",
"self",
".",
"i2c",
".",
"write8",
"(",
"0x81",
",",
"0x12",
")",
"time",
".",
"sleep",
"(",
"self",
".",
"pause",
")"
] |
Set the gain
|
[
"Set",
"the",
"gain"
] |
c6aaddc6da1d0bce0ea2b0c6eb8393ba10aefa56
|
https://github.com/kervi/kervi-devices/blob/c6aaddc6da1d0bce0ea2b0c6eb8393ba10aefa56/kervi/devices/sensors/TSL2561.py#L31-L38
|
239,102
|
mback2k/python-appengine-auth
|
social_appengine_auth/backends.py
|
BaseGoogleAppEngineAuth.get_user_details
|
def get_user_details(self, response):
"""Return user details from OAuth Profile Google App Engine App"""
email = response['email']
username = response.get('nickname', email).split('@', 1)[0]
return {'username': username,
'email': email,
'fullname': '',
'first_name': '',
'last_name': ''}
|
python
|
def get_user_details(self, response):
"""Return user details from OAuth Profile Google App Engine App"""
email = response['email']
username = response.get('nickname', email).split('@', 1)[0]
return {'username': username,
'email': email,
'fullname': '',
'first_name': '',
'last_name': ''}
|
[
"def",
"get_user_details",
"(",
"self",
",",
"response",
")",
":",
"email",
"=",
"response",
"[",
"'email'",
"]",
"username",
"=",
"response",
".",
"get",
"(",
"'nickname'",
",",
"email",
")",
".",
"split",
"(",
"'@'",
",",
"1",
")",
"[",
"0",
"]",
"return",
"{",
"'username'",
":",
"username",
",",
"'email'",
":",
"email",
",",
"'fullname'",
":",
"''",
",",
"'first_name'",
":",
"''",
",",
"'last_name'",
":",
"''",
"}"
] |
Return user details from OAuth Profile Google App Engine App
|
[
"Return",
"user",
"details",
"from",
"OAuth",
"Profile",
"Google",
"App",
"Engine",
"App"
] |
dd27a0c53c7bebe147f7a6e3606c67ec673ac4d6
|
https://github.com/mback2k/python-appengine-auth/blob/dd27a0c53c7bebe147f7a6e3606c67ec673ac4d6/social_appengine_auth/backends.py#L24-L32
|
239,103
|
JeremyGrosser/bamboo
|
bamboo/log.py
|
BambooHandler.makePickle
|
def makePickle(self, record):
"""
Use JSON.
"""
#ei = record.exc_info
#if ei:
# dummy = self.format(record) # just to get traceback text into record.exc_text
# record.exc_info = None # to avoid Unpickleable error
s = '%s%s:%i:%s\n' % (self.prefix, record.name, int(record.created), self.format(record))
#if ei:
# record.exc_info = ei # for next handler
return s
|
python
|
def makePickle(self, record):
"""
Use JSON.
"""
#ei = record.exc_info
#if ei:
# dummy = self.format(record) # just to get traceback text into record.exc_text
# record.exc_info = None # to avoid Unpickleable error
s = '%s%s:%i:%s\n' % (self.prefix, record.name, int(record.created), self.format(record))
#if ei:
# record.exc_info = ei # for next handler
return s
|
[
"def",
"makePickle",
"(",
"self",
",",
"record",
")",
":",
"#ei = record.exc_info",
"#if ei:",
"# dummy = self.format(record) # just to get traceback text into record.exc_text",
"# record.exc_info = None # to avoid Unpickleable error",
"s",
"=",
"'%s%s:%i:%s\\n'",
"%",
"(",
"self",
".",
"prefix",
",",
"record",
".",
"name",
",",
"int",
"(",
"record",
".",
"created",
")",
",",
"self",
".",
"format",
"(",
"record",
")",
")",
"#if ei:",
"# record.exc_info = ei # for next handler",
"return",
"s"
] |
Use JSON.
|
[
"Use",
"JSON",
"."
] |
a1ce4c5a0024599a9512c36045babba8bd9d98d7
|
https://github.com/JeremyGrosser/bamboo/blob/a1ce4c5a0024599a9512c36045babba8bd9d98d7/bamboo/log.py#L19-L30
|
239,104
|
vmalloc/dessert
|
dessert/rewrite.py
|
_read_pyc
|
def _read_pyc(source, pyc):
"""Possibly read a pytest pyc containing rewritten code.
Return rewritten code if successful or None if not.
"""
try:
fp = open(pyc, "rb")
except IOError:
return None
try:
try:
mtime = int(os.stat(source).st_mtime)
data = fp.read(8)
except EnvironmentError:
return None
# Check for invalid or out of date pyc file.
if (len(data) != 8 or data[:4] != imp.get_magic() or
struct.unpack("<l", data[4:])[0] != mtime):
return None
co = marshal.load(fp)
if not isinstance(co, types.CodeType):
# That's interesting....
return None
return co
finally:
fp.close()
|
python
|
def _read_pyc(source, pyc):
"""Possibly read a pytest pyc containing rewritten code.
Return rewritten code if successful or None if not.
"""
try:
fp = open(pyc, "rb")
except IOError:
return None
try:
try:
mtime = int(os.stat(source).st_mtime)
data = fp.read(8)
except EnvironmentError:
return None
# Check for invalid or out of date pyc file.
if (len(data) != 8 or data[:4] != imp.get_magic() or
struct.unpack("<l", data[4:])[0] != mtime):
return None
co = marshal.load(fp)
if not isinstance(co, types.CodeType):
# That's interesting....
return None
return co
finally:
fp.close()
|
[
"def",
"_read_pyc",
"(",
"source",
",",
"pyc",
")",
":",
"try",
":",
"fp",
"=",
"open",
"(",
"pyc",
",",
"\"rb\"",
")",
"except",
"IOError",
":",
"return",
"None",
"try",
":",
"try",
":",
"mtime",
"=",
"int",
"(",
"os",
".",
"stat",
"(",
"source",
")",
".",
"st_mtime",
")",
"data",
"=",
"fp",
".",
"read",
"(",
"8",
")",
"except",
"EnvironmentError",
":",
"return",
"None",
"# Check for invalid or out of date pyc file.",
"if",
"(",
"len",
"(",
"data",
")",
"!=",
"8",
"or",
"data",
"[",
":",
"4",
"]",
"!=",
"imp",
".",
"get_magic",
"(",
")",
"or",
"struct",
".",
"unpack",
"(",
"\"<l\"",
",",
"data",
"[",
"4",
":",
"]",
")",
"[",
"0",
"]",
"!=",
"mtime",
")",
":",
"return",
"None",
"co",
"=",
"marshal",
".",
"load",
"(",
"fp",
")",
"if",
"not",
"isinstance",
"(",
"co",
",",
"types",
".",
"CodeType",
")",
":",
"# That's interesting....",
"return",
"None",
"return",
"co",
"finally",
":",
"fp",
".",
"close",
"(",
")"
] |
Possibly read a pytest pyc containing rewritten code.
Return rewritten code if successful or None if not.
|
[
"Possibly",
"read",
"a",
"pytest",
"pyc",
"containing",
"rewritten",
"code",
"."
] |
fa86b39da4853f2c35f0686942db777c7cc57728
|
https://github.com/vmalloc/dessert/blob/fa86b39da4853f2c35f0686942db777c7cc57728/dessert/rewrite.py#L338-L363
|
239,105
|
vmalloc/dessert
|
dessert/rewrite.py
|
_saferepr
|
def _saferepr(obj):
"""Get a safe repr of an object for assertion error messages.
The assertion formatting (util.format_explanation()) requires
newlines to be escaped since they are a special character for it.
Normally assertion.util.format_explanation() does this but for a
custom repr it is possible to contain one of the special escape
sequences, especially '\n{' and '\n}' are likely to be present in
JSON reprs.
"""
repr = py.io.saferepr(obj)
if py.builtin._istext(repr):
t = py.builtin.text
else:
t = py.builtin.bytes
return repr.replace(t("\n"), t("\\n"))
|
python
|
def _saferepr(obj):
"""Get a safe repr of an object for assertion error messages.
The assertion formatting (util.format_explanation()) requires
newlines to be escaped since they are a special character for it.
Normally assertion.util.format_explanation() does this but for a
custom repr it is possible to contain one of the special escape
sequences, especially '\n{' and '\n}' are likely to be present in
JSON reprs.
"""
repr = py.io.saferepr(obj)
if py.builtin._istext(repr):
t = py.builtin.text
else:
t = py.builtin.bytes
return repr.replace(t("\n"), t("\\n"))
|
[
"def",
"_saferepr",
"(",
"obj",
")",
":",
"repr",
"=",
"py",
".",
"io",
".",
"saferepr",
"(",
"obj",
")",
"if",
"py",
".",
"builtin",
".",
"_istext",
"(",
"repr",
")",
":",
"t",
"=",
"py",
".",
"builtin",
".",
"text",
"else",
":",
"t",
"=",
"py",
".",
"builtin",
".",
"bytes",
"return",
"repr",
".",
"replace",
"(",
"t",
"(",
"\"\\n\"",
")",
",",
"t",
"(",
"\"\\\\n\"",
")",
")"
] |
Get a safe repr of an object for assertion error messages.
The assertion formatting (util.format_explanation()) requires
newlines to be escaped since they are a special character for it.
Normally assertion.util.format_explanation() does this but for a
custom repr it is possible to contain one of the special escape
sequences, especially '\n{' and '\n}' are likely to be present in
JSON reprs.
|
[
"Get",
"a",
"safe",
"repr",
"of",
"an",
"object",
"for",
"assertion",
"error",
"messages",
"."
] |
fa86b39da4853f2c35f0686942db777c7cc57728
|
https://github.com/vmalloc/dessert/blob/fa86b39da4853f2c35f0686942db777c7cc57728/dessert/rewrite.py#L371-L387
|
239,106
|
vmalloc/dessert
|
dessert/rewrite.py
|
_format_assertmsg
|
def _format_assertmsg(obj):
"""Format the custom assertion message given.
For strings this simply replaces newlines with '\n~' so that
util.format_explanation() will preserve them instead of escaping
newlines. For other objects py.io.saferepr() is used first.
"""
# reprlib appears to have a bug which means that if a string
# contains a newline it gets escaped, however if an object has a
# .__repr__() which contains newlines it does not get escaped.
# However in either case we want to preserve the newline.
if py.builtin._istext(obj) or py.builtin._isbytes(obj):
s = obj
is_repr = False
else:
s = py.io.saferepr(obj)
is_repr = True
if py.builtin._istext(s):
t = py.builtin.text
else:
t = py.builtin.bytes
s = s.replace(t("\n"), t("\n~")).replace(t("%"), t("%%"))
if is_repr:
s = s.replace(t("\\n"), t("\n~"))
return s
|
python
|
def _format_assertmsg(obj):
"""Format the custom assertion message given.
For strings this simply replaces newlines with '\n~' so that
util.format_explanation() will preserve them instead of escaping
newlines. For other objects py.io.saferepr() is used first.
"""
# reprlib appears to have a bug which means that if a string
# contains a newline it gets escaped, however if an object has a
# .__repr__() which contains newlines it does not get escaped.
# However in either case we want to preserve the newline.
if py.builtin._istext(obj) or py.builtin._isbytes(obj):
s = obj
is_repr = False
else:
s = py.io.saferepr(obj)
is_repr = True
if py.builtin._istext(s):
t = py.builtin.text
else:
t = py.builtin.bytes
s = s.replace(t("\n"), t("\n~")).replace(t("%"), t("%%"))
if is_repr:
s = s.replace(t("\\n"), t("\n~"))
return s
|
[
"def",
"_format_assertmsg",
"(",
"obj",
")",
":",
"# reprlib appears to have a bug which means that if a string",
"# contains a newline it gets escaped, however if an object has a",
"# .__repr__() which contains newlines it does not get escaped.",
"# However in either case we want to preserve the newline.",
"if",
"py",
".",
"builtin",
".",
"_istext",
"(",
"obj",
")",
"or",
"py",
".",
"builtin",
".",
"_isbytes",
"(",
"obj",
")",
":",
"s",
"=",
"obj",
"is_repr",
"=",
"False",
"else",
":",
"s",
"=",
"py",
".",
"io",
".",
"saferepr",
"(",
"obj",
")",
"is_repr",
"=",
"True",
"if",
"py",
".",
"builtin",
".",
"_istext",
"(",
"s",
")",
":",
"t",
"=",
"py",
".",
"builtin",
".",
"text",
"else",
":",
"t",
"=",
"py",
".",
"builtin",
".",
"bytes",
"s",
"=",
"s",
".",
"replace",
"(",
"t",
"(",
"\"\\n\"",
")",
",",
"t",
"(",
"\"\\n~\"",
")",
")",
".",
"replace",
"(",
"t",
"(",
"\"%\"",
")",
",",
"t",
"(",
"\"%%\"",
")",
")",
"if",
"is_repr",
":",
"s",
"=",
"s",
".",
"replace",
"(",
"t",
"(",
"\"\\\\n\"",
")",
",",
"t",
"(",
"\"\\n~\"",
")",
")",
"return",
"s"
] |
Format the custom assertion message given.
For strings this simply replaces newlines with '\n~' so that
util.format_explanation() will preserve them instead of escaping
newlines. For other objects py.io.saferepr() is used first.
|
[
"Format",
"the",
"custom",
"assertion",
"message",
"given",
"."
] |
fa86b39da4853f2c35f0686942db777c7cc57728
|
https://github.com/vmalloc/dessert/blob/fa86b39da4853f2c35f0686942db777c7cc57728/dessert/rewrite.py#L389-L414
|
239,107
|
vmalloc/dessert
|
dessert/rewrite.py
|
set_location
|
def set_location(node, lineno, col_offset):
"""Set node location information recursively."""
def _fix(node, lineno, col_offset):
if "lineno" in node._attributes:
node.lineno = lineno
if "col_offset" in node._attributes:
node.col_offset = col_offset
for child in ast.iter_child_nodes(node):
_fix(child, lineno, col_offset)
_fix(node, lineno, col_offset)
return node
|
python
|
def set_location(node, lineno, col_offset):
"""Set node location information recursively."""
def _fix(node, lineno, col_offset):
if "lineno" in node._attributes:
node.lineno = lineno
if "col_offset" in node._attributes:
node.col_offset = col_offset
for child in ast.iter_child_nodes(node):
_fix(child, lineno, col_offset)
_fix(node, lineno, col_offset)
return node
|
[
"def",
"set_location",
"(",
"node",
",",
"lineno",
",",
"col_offset",
")",
":",
"def",
"_fix",
"(",
"node",
",",
"lineno",
",",
"col_offset",
")",
":",
"if",
"\"lineno\"",
"in",
"node",
".",
"_attributes",
":",
"node",
".",
"lineno",
"=",
"lineno",
"if",
"\"col_offset\"",
"in",
"node",
".",
"_attributes",
":",
"node",
".",
"col_offset",
"=",
"col_offset",
"for",
"child",
"in",
"ast",
".",
"iter_child_nodes",
"(",
"node",
")",
":",
"_fix",
"(",
"child",
",",
"lineno",
",",
"col_offset",
")",
"_fix",
"(",
"node",
",",
"lineno",
",",
"col_offset",
")",
"return",
"node"
] |
Set node location information recursively.
|
[
"Set",
"node",
"location",
"information",
"recursively",
"."
] |
fa86b39da4853f2c35f0686942db777c7cc57728
|
https://github.com/vmalloc/dessert/blob/fa86b39da4853f2c35f0686942db777c7cc57728/dessert/rewrite.py#L488-L498
|
239,108
|
vmalloc/dessert
|
dessert/rewrite.py
|
AssertionRewritingHook.mark_rewrite
|
def mark_rewrite(self, *names):
"""Mark import names as needing to be re-written.
The named module or package as well as any nested modules will
be re-written on import.
"""
already_imported = set(names).intersection(set(sys.modules))
if already_imported:
for name in already_imported:
if name not in self._rewritten_names:
self._warn_already_imported(name)
self._must_rewrite.update(names)
|
python
|
def mark_rewrite(self, *names):
"""Mark import names as needing to be re-written.
The named module or package as well as any nested modules will
be re-written on import.
"""
already_imported = set(names).intersection(set(sys.modules))
if already_imported:
for name in already_imported:
if name not in self._rewritten_names:
self._warn_already_imported(name)
self._must_rewrite.update(names)
|
[
"def",
"mark_rewrite",
"(",
"self",
",",
"*",
"names",
")",
":",
"already_imported",
"=",
"set",
"(",
"names",
")",
".",
"intersection",
"(",
"set",
"(",
"sys",
".",
"modules",
")",
")",
"if",
"already_imported",
":",
"for",
"name",
"in",
"already_imported",
":",
"if",
"name",
"not",
"in",
"self",
".",
"_rewritten_names",
":",
"self",
".",
"_warn_already_imported",
"(",
"name",
")",
"self",
".",
"_must_rewrite",
".",
"update",
"(",
"names",
")"
] |
Mark import names as needing to be re-written.
The named module or package as well as any nested modules will
be re-written on import.
|
[
"Mark",
"import",
"names",
"as",
"needing",
"to",
"be",
"re",
"-",
"written",
"."
] |
fa86b39da4853f2c35f0686942db777c7cc57728
|
https://github.com/vmalloc/dessert/blob/fa86b39da4853f2c35f0686942db777c7cc57728/dessert/rewrite.py#L163-L174
|
239,109
|
vmalloc/dessert
|
dessert/rewrite.py
|
AssertionRewritingHook._register_with_pkg_resources
|
def _register_with_pkg_resources(cls):
"""
Ensure package resources can be loaded from this loader. May be called
multiple times, as the operation is idempotent.
"""
try:
import pkg_resources
# access an attribute in case a deferred importer is present
pkg_resources.__name__
except ImportError:
return
# Since pytest tests are always located in the file system, the
# DefaultProvider is appropriate.
pkg_resources.register_loader_type(cls, pkg_resources.DefaultProvider)
|
python
|
def _register_with_pkg_resources(cls):
"""
Ensure package resources can be loaded from this loader. May be called
multiple times, as the operation is idempotent.
"""
try:
import pkg_resources
# access an attribute in case a deferred importer is present
pkg_resources.__name__
except ImportError:
return
# Since pytest tests are always located in the file system, the
# DefaultProvider is appropriate.
pkg_resources.register_loader_type(cls, pkg_resources.DefaultProvider)
|
[
"def",
"_register_with_pkg_resources",
"(",
"cls",
")",
":",
"try",
":",
"import",
"pkg_resources",
"# access an attribute in case a deferred importer is present",
"pkg_resources",
".",
"__name__",
"except",
"ImportError",
":",
"return",
"# Since pytest tests are always located in the file system, the",
"# DefaultProvider is appropriate.",
"pkg_resources",
".",
"register_loader_type",
"(",
"cls",
",",
"pkg_resources",
".",
"DefaultProvider",
")"
] |
Ensure package resources can be loaded from this loader. May be called
multiple times, as the operation is idempotent.
|
[
"Ensure",
"package",
"resources",
"can",
"be",
"loaded",
"from",
"this",
"loader",
".",
"May",
"be",
"called",
"multiple",
"times",
"as",
"the",
"operation",
"is",
"idempotent",
"."
] |
fa86b39da4853f2c35f0686942db777c7cc57728
|
https://github.com/vmalloc/dessert/blob/fa86b39da4853f2c35f0686942db777c7cc57728/dessert/rewrite.py#L216-L230
|
239,110
|
vmalloc/dessert
|
dessert/rewrite.py
|
AssertionRewriter.variable
|
def variable(self):
"""Get a new variable."""
# Use a character invalid in python identifiers to avoid clashing.
name = "@py_assert" + str(next(self.variable_counter))
self.variables.append(name)
return name
|
python
|
def variable(self):
"""Get a new variable."""
# Use a character invalid in python identifiers to avoid clashing.
name = "@py_assert" + str(next(self.variable_counter))
self.variables.append(name)
return name
|
[
"def",
"variable",
"(",
"self",
")",
":",
"# Use a character invalid in python identifiers to avoid clashing.",
"name",
"=",
"\"@py_assert\"",
"+",
"str",
"(",
"next",
"(",
"self",
".",
"variable_counter",
")",
")",
"self",
".",
"variables",
".",
"append",
"(",
"name",
")",
"return",
"name"
] |
Get a new variable.
|
[
"Get",
"a",
"new",
"variable",
"."
] |
fa86b39da4853f2c35f0686942db777c7cc57728
|
https://github.com/vmalloc/dessert/blob/fa86b39da4853f2c35f0686942db777c7cc57728/dessert/rewrite.py#L559-L564
|
239,111
|
vmalloc/dessert
|
dessert/rewrite.py
|
AssertionRewriter.helper
|
def helper(self, name, *args):
"""Call a helper in this module."""
py_name = ast.Name("@dessert_ar", ast.Load())
attr = ast.Attribute(py_name, "_" + name, ast.Load())
return ast_Call(attr, list(args), [])
|
python
|
def helper(self, name, *args):
"""Call a helper in this module."""
py_name = ast.Name("@dessert_ar", ast.Load())
attr = ast.Attribute(py_name, "_" + name, ast.Load())
return ast_Call(attr, list(args), [])
|
[
"def",
"helper",
"(",
"self",
",",
"name",
",",
"*",
"args",
")",
":",
"py_name",
"=",
"ast",
".",
"Name",
"(",
"\"@dessert_ar\"",
",",
"ast",
".",
"Load",
"(",
")",
")",
"attr",
"=",
"ast",
".",
"Attribute",
"(",
"py_name",
",",
"\"_\"",
"+",
"name",
",",
"ast",
".",
"Load",
"(",
")",
")",
"return",
"ast_Call",
"(",
"attr",
",",
"list",
"(",
"args",
")",
",",
"[",
"]",
")"
] |
Call a helper in this module.
|
[
"Call",
"a",
"helper",
"in",
"this",
"module",
"."
] |
fa86b39da4853f2c35f0686942db777c7cc57728
|
https://github.com/vmalloc/dessert/blob/fa86b39da4853f2c35f0686942db777c7cc57728/dessert/rewrite.py#L576-L580
|
239,112
|
vmalloc/dessert
|
dessert/rewrite.py
|
AssertionRewriter.generic_visit
|
def generic_visit(self, node):
"""Handle expressions we don't have custom code for."""
assert isinstance(node, ast.expr)
res = self.assign(node)
return res, self.explanation_param(self.display(res))
|
python
|
def generic_visit(self, node):
"""Handle expressions we don't have custom code for."""
assert isinstance(node, ast.expr)
res = self.assign(node)
return res, self.explanation_param(self.display(res))
|
[
"def",
"generic_visit",
"(",
"self",
",",
"node",
")",
":",
"assert",
"isinstance",
"(",
"node",
",",
"ast",
".",
"expr",
")",
"res",
"=",
"self",
".",
"assign",
"(",
"node",
")",
"return",
"res",
",",
"self",
".",
"explanation_param",
"(",
"self",
".",
"display",
"(",
"res",
")",
")"
] |
Handle expressions we don't have custom code for.
|
[
"Handle",
"expressions",
"we",
"don",
"t",
"have",
"custom",
"code",
"for",
"."
] |
fa86b39da4853f2c35f0686942db777c7cc57728
|
https://github.com/vmalloc/dessert/blob/fa86b39da4853f2c35f0686942db777c7cc57728/dessert/rewrite.py#L607-L611
|
239,113
|
vmalloc/dessert
|
dessert/rewrite.py
|
AssertionRewriter.visit_Assert
|
def visit_Assert(self, assert_):
"""Return the AST statements to replace the ast.Assert instance.
This re-writes the test of an assertion to provide
intermediate values and replace it with an if statement which
raises an assertion error with a detailed explanation in case
the expression is false.
"""
if isinstance(assert_.test, ast.Tuple) and self.config is not None:
fslocation = (self.module_path, assert_.lineno)
self.config.warn('R1', 'assertion is always true, perhaps '
'remove parentheses?', fslocation=fslocation)
self.statements = []
self.variables = []
self.variable_counter = itertools.count()
self.stack = []
self.on_failure = []
self.push_format_context()
# Rewrite assert into a bunch of statements.
top_condition, explanation = self.visit(assert_.test)
# Create failure message.
body = self.on_failure
negation = ast.UnaryOp(ast.Not(), top_condition)
self.statements.append(ast.If(negation, body, []))
if assert_.msg:
assertmsg = self.helper('format_assertmsg', assert_.msg)
explanation = "\n>assert " + explanation
else:
assertmsg = ast.Str("")
explanation = "assert " + explanation
if _MARK_ASSERTION_INTROSPECTION:
explanation = 'dessert* ' + explanation
template = ast.BinOp(assertmsg, ast.Add(), ast.Str(explanation))
msg = self.pop_format_context(template)
fmt = self.helper("format_explanation", msg, assertmsg)
err_name = ast.Name("AssertionError", ast.Load())
exc = ast_Call(err_name, [fmt], [])
if sys.version_info[0] >= 3:
raise_ = ast.Raise(exc, None)
else:
raise_ = ast.Raise(exc, None, None)
body.append(raise_)
# Clear temporary variables by setting them to None.
if self.variables:
variables = [ast.Name(name, ast.Store())
for name in self.variables]
clear = ast.Assign(variables, _NameConstant(None))
self.statements.append(clear)
# Fix line numbers.
for stmt in self.statements:
set_location(stmt, assert_.lineno, assert_.col_offset)
return self.statements
|
python
|
def visit_Assert(self, assert_):
"""Return the AST statements to replace the ast.Assert instance.
This re-writes the test of an assertion to provide
intermediate values and replace it with an if statement which
raises an assertion error with a detailed explanation in case
the expression is false.
"""
if isinstance(assert_.test, ast.Tuple) and self.config is not None:
fslocation = (self.module_path, assert_.lineno)
self.config.warn('R1', 'assertion is always true, perhaps '
'remove parentheses?', fslocation=fslocation)
self.statements = []
self.variables = []
self.variable_counter = itertools.count()
self.stack = []
self.on_failure = []
self.push_format_context()
# Rewrite assert into a bunch of statements.
top_condition, explanation = self.visit(assert_.test)
# Create failure message.
body = self.on_failure
negation = ast.UnaryOp(ast.Not(), top_condition)
self.statements.append(ast.If(negation, body, []))
if assert_.msg:
assertmsg = self.helper('format_assertmsg', assert_.msg)
explanation = "\n>assert " + explanation
else:
assertmsg = ast.Str("")
explanation = "assert " + explanation
if _MARK_ASSERTION_INTROSPECTION:
explanation = 'dessert* ' + explanation
template = ast.BinOp(assertmsg, ast.Add(), ast.Str(explanation))
msg = self.pop_format_context(template)
fmt = self.helper("format_explanation", msg, assertmsg)
err_name = ast.Name("AssertionError", ast.Load())
exc = ast_Call(err_name, [fmt], [])
if sys.version_info[0] >= 3:
raise_ = ast.Raise(exc, None)
else:
raise_ = ast.Raise(exc, None, None)
body.append(raise_)
# Clear temporary variables by setting them to None.
if self.variables:
variables = [ast.Name(name, ast.Store())
for name in self.variables]
clear = ast.Assign(variables, _NameConstant(None))
self.statements.append(clear)
# Fix line numbers.
for stmt in self.statements:
set_location(stmt, assert_.lineno, assert_.col_offset)
return self.statements
|
[
"def",
"visit_Assert",
"(",
"self",
",",
"assert_",
")",
":",
"if",
"isinstance",
"(",
"assert_",
".",
"test",
",",
"ast",
".",
"Tuple",
")",
"and",
"self",
".",
"config",
"is",
"not",
"None",
":",
"fslocation",
"=",
"(",
"self",
".",
"module_path",
",",
"assert_",
".",
"lineno",
")",
"self",
".",
"config",
".",
"warn",
"(",
"'R1'",
",",
"'assertion is always true, perhaps '",
"'remove parentheses?'",
",",
"fslocation",
"=",
"fslocation",
")",
"self",
".",
"statements",
"=",
"[",
"]",
"self",
".",
"variables",
"=",
"[",
"]",
"self",
".",
"variable_counter",
"=",
"itertools",
".",
"count",
"(",
")",
"self",
".",
"stack",
"=",
"[",
"]",
"self",
".",
"on_failure",
"=",
"[",
"]",
"self",
".",
"push_format_context",
"(",
")",
"# Rewrite assert into a bunch of statements.",
"top_condition",
",",
"explanation",
"=",
"self",
".",
"visit",
"(",
"assert_",
".",
"test",
")",
"# Create failure message.",
"body",
"=",
"self",
".",
"on_failure",
"negation",
"=",
"ast",
".",
"UnaryOp",
"(",
"ast",
".",
"Not",
"(",
")",
",",
"top_condition",
")",
"self",
".",
"statements",
".",
"append",
"(",
"ast",
".",
"If",
"(",
"negation",
",",
"body",
",",
"[",
"]",
")",
")",
"if",
"assert_",
".",
"msg",
":",
"assertmsg",
"=",
"self",
".",
"helper",
"(",
"'format_assertmsg'",
",",
"assert_",
".",
"msg",
")",
"explanation",
"=",
"\"\\n>assert \"",
"+",
"explanation",
"else",
":",
"assertmsg",
"=",
"ast",
".",
"Str",
"(",
"\"\"",
")",
"explanation",
"=",
"\"assert \"",
"+",
"explanation",
"if",
"_MARK_ASSERTION_INTROSPECTION",
":",
"explanation",
"=",
"'dessert* '",
"+",
"explanation",
"template",
"=",
"ast",
".",
"BinOp",
"(",
"assertmsg",
",",
"ast",
".",
"Add",
"(",
")",
",",
"ast",
".",
"Str",
"(",
"explanation",
")",
")",
"msg",
"=",
"self",
".",
"pop_format_context",
"(",
"template",
")",
"fmt",
"=",
"self",
".",
"helper",
"(",
"\"format_explanation\"",
",",
"msg",
",",
"assertmsg",
")",
"err_name",
"=",
"ast",
".",
"Name",
"(",
"\"AssertionError\"",
",",
"ast",
".",
"Load",
"(",
")",
")",
"exc",
"=",
"ast_Call",
"(",
"err_name",
",",
"[",
"fmt",
"]",
",",
"[",
"]",
")",
"if",
"sys",
".",
"version_info",
"[",
"0",
"]",
">=",
"3",
":",
"raise_",
"=",
"ast",
".",
"Raise",
"(",
"exc",
",",
"None",
")",
"else",
":",
"raise_",
"=",
"ast",
".",
"Raise",
"(",
"exc",
",",
"None",
",",
"None",
")",
"body",
".",
"append",
"(",
"raise_",
")",
"# Clear temporary variables by setting them to None.",
"if",
"self",
".",
"variables",
":",
"variables",
"=",
"[",
"ast",
".",
"Name",
"(",
"name",
",",
"ast",
".",
"Store",
"(",
")",
")",
"for",
"name",
"in",
"self",
".",
"variables",
"]",
"clear",
"=",
"ast",
".",
"Assign",
"(",
"variables",
",",
"_NameConstant",
"(",
"None",
")",
")",
"self",
".",
"statements",
".",
"append",
"(",
"clear",
")",
"# Fix line numbers.",
"for",
"stmt",
"in",
"self",
".",
"statements",
":",
"set_location",
"(",
"stmt",
",",
"assert_",
".",
"lineno",
",",
"assert_",
".",
"col_offset",
")",
"return",
"self",
".",
"statements"
] |
Return the AST statements to replace the ast.Assert instance.
This re-writes the test of an assertion to provide
intermediate values and replace it with an if statement which
raises an assertion error with a detailed explanation in case
the expression is false.
|
[
"Return",
"the",
"AST",
"statements",
"to",
"replace",
"the",
"ast",
".",
"Assert",
"instance",
"."
] |
fa86b39da4853f2c35f0686942db777c7cc57728
|
https://github.com/vmalloc/dessert/blob/fa86b39da4853f2c35f0686942db777c7cc57728/dessert/rewrite.py#L613-L667
|
239,114
|
vmalloc/dessert
|
dessert/rewrite.py
|
AssertionRewriter.visit_Call_35
|
def visit_Call_35(self, call):
"""
visit `ast.Call` nodes on Python3.5 and after
"""
new_func, func_expl = self.visit(call.func)
arg_expls = []
new_args = []
new_kwargs = []
for arg in call.args:
res, expl = self.visit(arg)
arg_expls.append(expl)
new_args.append(res)
for keyword in call.keywords:
res, expl = self.visit(keyword.value)
new_kwargs.append(ast.keyword(keyword.arg, res))
if keyword.arg:
arg_expls.append(keyword.arg + "=" + expl)
else: ## **args have `arg` keywords with an .arg of None
arg_expls.append("**" + expl)
expl = "%s(%s)" % (func_expl, ', '.join(arg_expls))
new_call = ast.Call(new_func, new_args, new_kwargs)
res = self.assign(new_call)
res_expl = self.explanation_param(self.display(res))
outer_expl = "%s\n{%s = %s\n}" % (res_expl, res_expl, expl)
return res, outer_expl
|
python
|
def visit_Call_35(self, call):
"""
visit `ast.Call` nodes on Python3.5 and after
"""
new_func, func_expl = self.visit(call.func)
arg_expls = []
new_args = []
new_kwargs = []
for arg in call.args:
res, expl = self.visit(arg)
arg_expls.append(expl)
new_args.append(res)
for keyword in call.keywords:
res, expl = self.visit(keyword.value)
new_kwargs.append(ast.keyword(keyword.arg, res))
if keyword.arg:
arg_expls.append(keyword.arg + "=" + expl)
else: ## **args have `arg` keywords with an .arg of None
arg_expls.append("**" + expl)
expl = "%s(%s)" % (func_expl, ', '.join(arg_expls))
new_call = ast.Call(new_func, new_args, new_kwargs)
res = self.assign(new_call)
res_expl = self.explanation_param(self.display(res))
outer_expl = "%s\n{%s = %s\n}" % (res_expl, res_expl, expl)
return res, outer_expl
|
[
"def",
"visit_Call_35",
"(",
"self",
",",
"call",
")",
":",
"new_func",
",",
"func_expl",
"=",
"self",
".",
"visit",
"(",
"call",
".",
"func",
")",
"arg_expls",
"=",
"[",
"]",
"new_args",
"=",
"[",
"]",
"new_kwargs",
"=",
"[",
"]",
"for",
"arg",
"in",
"call",
".",
"args",
":",
"res",
",",
"expl",
"=",
"self",
".",
"visit",
"(",
"arg",
")",
"arg_expls",
".",
"append",
"(",
"expl",
")",
"new_args",
".",
"append",
"(",
"res",
")",
"for",
"keyword",
"in",
"call",
".",
"keywords",
":",
"res",
",",
"expl",
"=",
"self",
".",
"visit",
"(",
"keyword",
".",
"value",
")",
"new_kwargs",
".",
"append",
"(",
"ast",
".",
"keyword",
"(",
"keyword",
".",
"arg",
",",
"res",
")",
")",
"if",
"keyword",
".",
"arg",
":",
"arg_expls",
".",
"append",
"(",
"keyword",
".",
"arg",
"+",
"\"=\"",
"+",
"expl",
")",
"else",
":",
"## **args have `arg` keywords with an .arg of None",
"arg_expls",
".",
"append",
"(",
"\"**\"",
"+",
"expl",
")",
"expl",
"=",
"\"%s(%s)\"",
"%",
"(",
"func_expl",
",",
"', '",
".",
"join",
"(",
"arg_expls",
")",
")",
"new_call",
"=",
"ast",
".",
"Call",
"(",
"new_func",
",",
"new_args",
",",
"new_kwargs",
")",
"res",
"=",
"self",
".",
"assign",
"(",
"new_call",
")",
"res_expl",
"=",
"self",
".",
"explanation_param",
"(",
"self",
".",
"display",
"(",
"res",
")",
")",
"outer_expl",
"=",
"\"%s\\n{%s = %s\\n}\"",
"%",
"(",
"res_expl",
",",
"res_expl",
",",
"expl",
")",
"return",
"res",
",",
"outer_expl"
] |
visit `ast.Call` nodes on Python3.5 and after
|
[
"visit",
"ast",
".",
"Call",
"nodes",
"on",
"Python3",
".",
"5",
"and",
"after"
] |
fa86b39da4853f2c35f0686942db777c7cc57728
|
https://github.com/vmalloc/dessert/blob/fa86b39da4853f2c35f0686942db777c7cc57728/dessert/rewrite.py#L728-L753
|
239,115
|
vrtsystems/pyat
|
pyat/sync.py
|
SynchronousScheduledTask.cancel
|
def cancel(self):
'''
Cancel the scheduled task.
'''
if (not self.cancelled) and (self._fn is not None):
self._cancelled = True
self._drop_fn()
|
python
|
def cancel(self):
'''
Cancel the scheduled task.
'''
if (not self.cancelled) and (self._fn is not None):
self._cancelled = True
self._drop_fn()
|
[
"def",
"cancel",
"(",
"self",
")",
":",
"if",
"(",
"not",
"self",
".",
"cancelled",
")",
"and",
"(",
"self",
".",
"_fn",
"is",
"not",
"None",
")",
":",
"self",
".",
"_cancelled",
"=",
"True",
"self",
".",
"_drop_fn",
"(",
")"
] |
Cancel the scheduled task.
|
[
"Cancel",
"the",
"scheduled",
"task",
"."
] |
23f87904e5f9f6902665bbf825e65e7eddd64995
|
https://github.com/vrtsystems/pyat/blob/23f87904e5f9f6902665bbf825e65e7eddd64995/pyat/sync.py#L111-L117
|
239,116
|
vrtsystems/pyat
|
pyat/sync.py
|
SynchronousScheduledTask.result
|
def result(self):
'''
The result from the executed task. Raises NotExecutedYet if not yet
executed.
'''
if self.cancelled or (self._fn is not None):
raise NotExecutedYet()
if self._fn_exc is not None:
six.reraise(*self._fn_exc)
else:
return self._fn_res
|
python
|
def result(self):
'''
The result from the executed task. Raises NotExecutedYet if not yet
executed.
'''
if self.cancelled or (self._fn is not None):
raise NotExecutedYet()
if self._fn_exc is not None:
six.reraise(*self._fn_exc)
else:
return self._fn_res
|
[
"def",
"result",
"(",
"self",
")",
":",
"if",
"self",
".",
"cancelled",
"or",
"(",
"self",
".",
"_fn",
"is",
"not",
"None",
")",
":",
"raise",
"NotExecutedYet",
"(",
")",
"if",
"self",
".",
"_fn_exc",
"is",
"not",
"None",
":",
"six",
".",
"reraise",
"(",
"*",
"self",
".",
"_fn_exc",
")",
"else",
":",
"return",
"self",
".",
"_fn_res"
] |
The result from the executed task. Raises NotExecutedYet if not yet
executed.
|
[
"The",
"result",
"from",
"the",
"executed",
"task",
".",
"Raises",
"NotExecutedYet",
"if",
"not",
"yet",
"executed",
"."
] |
23f87904e5f9f6902665bbf825e65e7eddd64995
|
https://github.com/vrtsystems/pyat/blob/23f87904e5f9f6902665bbf825e65e7eddd64995/pyat/sync.py#L120-L131
|
239,117
|
cltrudeau/wrench
|
wrench/utils.py
|
rows_to_columns
|
def rows_to_columns(matrix):
#hammer
"""Takes a two dimensional array and returns an new one where rows in the
first become columns in the second."""
num_rows = len(matrix)
num_cols = len(matrix[0])
data = []
for i in range(0, num_cols):
data.append([matrix[j][i] for j in range(0, num_rows)])
return data
|
python
|
def rows_to_columns(matrix):
#hammer
"""Takes a two dimensional array and returns an new one where rows in the
first become columns in the second."""
num_rows = len(matrix)
num_cols = len(matrix[0])
data = []
for i in range(0, num_cols):
data.append([matrix[j][i] for j in range(0, num_rows)])
return data
|
[
"def",
"rows_to_columns",
"(",
"matrix",
")",
":",
"#hammer",
"num_rows",
"=",
"len",
"(",
"matrix",
")",
"num_cols",
"=",
"len",
"(",
"matrix",
"[",
"0",
"]",
")",
"data",
"=",
"[",
"]",
"for",
"i",
"in",
"range",
"(",
"0",
",",
"num_cols",
")",
":",
"data",
".",
"append",
"(",
"[",
"matrix",
"[",
"j",
"]",
"[",
"i",
"]",
"for",
"j",
"in",
"range",
"(",
"0",
",",
"num_rows",
")",
"]",
")",
"return",
"data"
] |
Takes a two dimensional array and returns an new one where rows in the
first become columns in the second.
|
[
"Takes",
"a",
"two",
"dimensional",
"array",
"and",
"returns",
"an",
"new",
"one",
"where",
"rows",
"in",
"the",
"first",
"become",
"columns",
"in",
"the",
"second",
"."
] |
bc231dd085050a63a87ff3eb8f0a863928f65a41
|
https://github.com/cltrudeau/wrench/blob/bc231dd085050a63a87ff3eb8f0a863928f65a41/wrench/utils.py#L322-L333
|
239,118
|
cltrudeau/wrench
|
wrench/utils.py
|
parse_link
|
def parse_link(html):
#hammer
"""Parses an HTML anchor tag, returning the href and content text. Any
content before or after the anchor tag pair is ignored.
:param html:
Snippet of html to parse
:returns:
namedtuple('ParsedLink', ['url', 'text'])
Example:
.. code-block:: python
>>> parse_link('things <a href="/foo/bar.html">Foo</a> stuff')
ParsedLink('/foo/bar.html', 'Foo')
"""
parser = AnchorParser()
parser.feed(html)
return parser.ParsedLink(parser.url, parser.text)
|
python
|
def parse_link(html):
#hammer
"""Parses an HTML anchor tag, returning the href and content text. Any
content before or after the anchor tag pair is ignored.
:param html:
Snippet of html to parse
:returns:
namedtuple('ParsedLink', ['url', 'text'])
Example:
.. code-block:: python
>>> parse_link('things <a href="/foo/bar.html">Foo</a> stuff')
ParsedLink('/foo/bar.html', 'Foo')
"""
parser = AnchorParser()
parser.feed(html)
return parser.ParsedLink(parser.url, parser.text)
|
[
"def",
"parse_link",
"(",
"html",
")",
":",
"#hammer",
"parser",
"=",
"AnchorParser",
"(",
")",
"parser",
".",
"feed",
"(",
"html",
")",
"return",
"parser",
".",
"ParsedLink",
"(",
"parser",
".",
"url",
",",
"parser",
".",
"text",
")"
] |
Parses an HTML anchor tag, returning the href and content text. Any
content before or after the anchor tag pair is ignored.
:param html:
Snippet of html to parse
:returns:
namedtuple('ParsedLink', ['url', 'text'])
Example:
.. code-block:: python
>>> parse_link('things <a href="/foo/bar.html">Foo</a> stuff')
ParsedLink('/foo/bar.html', 'Foo')
|
[
"Parses",
"an",
"HTML",
"anchor",
"tag",
"returning",
"the",
"href",
"and",
"content",
"text",
".",
"Any",
"content",
"before",
"or",
"after",
"the",
"anchor",
"tag",
"pair",
"is",
"ignored",
"."
] |
bc231dd085050a63a87ff3eb8f0a863928f65a41
|
https://github.com/cltrudeau/wrench/blob/bc231dd085050a63a87ff3eb8f0a863928f65a41/wrench/utils.py#L370-L389
|
239,119
|
cltrudeau/wrench
|
wrench/utils.py
|
ExtendedEnum.choices
|
def choices(cls):
"""Returns a "choices" list of tuples. Each member of the list is one
of the possible items in the ``Enum``, with the first item in the pair
being the value and the second the name. This is compatible with
django's choices attribute in fields.
:returns:
List of tuples
"""
result = []
for name, member in cls.__members__.items():
result.append((member.value, name))
return result
|
python
|
def choices(cls):
"""Returns a "choices" list of tuples. Each member of the list is one
of the possible items in the ``Enum``, with the first item in the pair
being the value and the second the name. This is compatible with
django's choices attribute in fields.
:returns:
List of tuples
"""
result = []
for name, member in cls.__members__.items():
result.append((member.value, name))
return result
|
[
"def",
"choices",
"(",
"cls",
")",
":",
"result",
"=",
"[",
"]",
"for",
"name",
",",
"member",
"in",
"cls",
".",
"__members__",
".",
"items",
"(",
")",
":",
"result",
".",
"append",
"(",
"(",
"member",
".",
"value",
",",
"name",
")",
")",
"return",
"result"
] |
Returns a "choices" list of tuples. Each member of the list is one
of the possible items in the ``Enum``, with the first item in the pair
being the value and the second the name. This is compatible with
django's choices attribute in fields.
:returns:
List of tuples
|
[
"Returns",
"a",
"choices",
"list",
"of",
"tuples",
".",
"Each",
"member",
"of",
"the",
"list",
"is",
"one",
"of",
"the",
"possible",
"items",
"in",
"the",
"Enum",
"with",
"the",
"first",
"item",
"in",
"the",
"pair",
"being",
"the",
"value",
"and",
"the",
"second",
"the",
"name",
".",
"This",
"is",
"compatible",
"with",
"django",
"s",
"choices",
"attribute",
"in",
"fields",
"."
] |
bc231dd085050a63a87ff3eb8f0a863928f65a41
|
https://github.com/cltrudeau/wrench/blob/bc231dd085050a63a87ff3eb8f0a863928f65a41/wrench/utils.py#L26-L39
|
239,120
|
mdomke/signaling
|
signaling/signal.py
|
Signal.emit
|
def emit(self, **kwargs):
"""Emit signal by calling all connected slots.
The arguments supplied have to match the signal definition.
Args:
kwargs: Keyword arguments to be passed to connected slots.
Raises:
:exc:`InvalidEmit`: If arguments don't match signal specification.
"""
self._ensure_emit_kwargs(kwargs)
for slot in self.slots:
slot(**kwargs)
|
python
|
def emit(self, **kwargs):
"""Emit signal by calling all connected slots.
The arguments supplied have to match the signal definition.
Args:
kwargs: Keyword arguments to be passed to connected slots.
Raises:
:exc:`InvalidEmit`: If arguments don't match signal specification.
"""
self._ensure_emit_kwargs(kwargs)
for slot in self.slots:
slot(**kwargs)
|
[
"def",
"emit",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"self",
".",
"_ensure_emit_kwargs",
"(",
"kwargs",
")",
"for",
"slot",
"in",
"self",
".",
"slots",
":",
"slot",
"(",
"*",
"*",
"kwargs",
")"
] |
Emit signal by calling all connected slots.
The arguments supplied have to match the signal definition.
Args:
kwargs: Keyword arguments to be passed to connected slots.
Raises:
:exc:`InvalidEmit`: If arguments don't match signal specification.
|
[
"Emit",
"signal",
"by",
"calling",
"all",
"connected",
"slots",
"."
] |
c51d769d78b787fea5364027d7fd00b5d268ef2c
|
https://github.com/mdomke/signaling/blob/c51d769d78b787fea5364027d7fd00b5d268ef2c/signaling/signal.py#L14-L27
|
239,121
|
mdomke/signaling
|
signaling/signal.py
|
Signal.connect
|
def connect(self, slot):
"""Connect ``slot`` to this singal.
Args:
slot (callable): Callable object wich accepts keyword arguments.
Raises:
InvalidSlot: If ``slot`` doesn't accept keyword arguments.
"""
self._ensure_slot_args(slot)
if not self.is_connected(slot):
self.slots.append(slot)
|
python
|
def connect(self, slot):
"""Connect ``slot`` to this singal.
Args:
slot (callable): Callable object wich accepts keyword arguments.
Raises:
InvalidSlot: If ``slot`` doesn't accept keyword arguments.
"""
self._ensure_slot_args(slot)
if not self.is_connected(slot):
self.slots.append(slot)
|
[
"def",
"connect",
"(",
"self",
",",
"slot",
")",
":",
"self",
".",
"_ensure_slot_args",
"(",
"slot",
")",
"if",
"not",
"self",
".",
"is_connected",
"(",
"slot",
")",
":",
"self",
".",
"slots",
".",
"append",
"(",
"slot",
")"
] |
Connect ``slot`` to this singal.
Args:
slot (callable): Callable object wich accepts keyword arguments.
Raises:
InvalidSlot: If ``slot`` doesn't accept keyword arguments.
|
[
"Connect",
"slot",
"to",
"this",
"singal",
"."
] |
c51d769d78b787fea5364027d7fd00b5d268ef2c
|
https://github.com/mdomke/signaling/blob/c51d769d78b787fea5364027d7fd00b5d268ef2c/signaling/signal.py#L39-L50
|
239,122
|
mdomke/signaling
|
signaling/signal.py
|
Signal.disconnect
|
def disconnect(self, slot):
"""Disconnect ``slot`` from this signal."""
if self.is_connected(slot):
self.slots.remove(slot)
|
python
|
def disconnect(self, slot):
"""Disconnect ``slot`` from this signal."""
if self.is_connected(slot):
self.slots.remove(slot)
|
[
"def",
"disconnect",
"(",
"self",
",",
"slot",
")",
":",
"if",
"self",
".",
"is_connected",
"(",
"slot",
")",
":",
"self",
".",
"slots",
".",
"remove",
"(",
"slot",
")"
] |
Disconnect ``slot`` from this signal.
|
[
"Disconnect",
"slot",
"from",
"this",
"signal",
"."
] |
c51d769d78b787fea5364027d7fd00b5d268ef2c
|
https://github.com/mdomke/signaling/blob/c51d769d78b787fea5364027d7fd00b5d268ef2c/signaling/signal.py#L63-L66
|
239,123
|
JukeboxPipeline/jukebox-core
|
src/jukeboxcore/gui/reftrackitemdata.py
|
reftrack_task_data
|
def reftrack_task_data(rt, role):
"""Return the data for the task that is loaded by the reftrack
:param rt: the :class:`jukeboxcore.reftrack.Reftrack` holds the data
:type rt: :class:`jukeboxcore.reftrack.Reftrack`
:param role: item data role
:type role: QtCore.Qt.ItemDataRole
:returns: data for the task
:rtype: depending on role
:raises: None
"""
tfi = rt.get_taskfileinfo()
if not tfi:
return
return filesysitemdata.taskfileinfo_task_data(tfi, role)
|
python
|
def reftrack_task_data(rt, role):
"""Return the data for the task that is loaded by the reftrack
:param rt: the :class:`jukeboxcore.reftrack.Reftrack` holds the data
:type rt: :class:`jukeboxcore.reftrack.Reftrack`
:param role: item data role
:type role: QtCore.Qt.ItemDataRole
:returns: data for the task
:rtype: depending on role
:raises: None
"""
tfi = rt.get_taskfileinfo()
if not tfi:
return
return filesysitemdata.taskfileinfo_task_data(tfi, role)
|
[
"def",
"reftrack_task_data",
"(",
"rt",
",",
"role",
")",
":",
"tfi",
"=",
"rt",
".",
"get_taskfileinfo",
"(",
")",
"if",
"not",
"tfi",
":",
"return",
"return",
"filesysitemdata",
".",
"taskfileinfo_task_data",
"(",
"tfi",
",",
"role",
")"
] |
Return the data for the task that is loaded by the reftrack
:param rt: the :class:`jukeboxcore.reftrack.Reftrack` holds the data
:type rt: :class:`jukeboxcore.reftrack.Reftrack`
:param role: item data role
:type role: QtCore.Qt.ItemDataRole
:returns: data for the task
:rtype: depending on role
:raises: None
|
[
"Return",
"the",
"data",
"for",
"the",
"task",
"that",
"is",
"loaded",
"by",
"the",
"reftrack"
] |
bac2280ca49940355270e4b69400ce9976ab2e6f
|
https://github.com/JukeboxPipeline/jukebox-core/blob/bac2280ca49940355270e4b69400ce9976ab2e6f/src/jukeboxcore/gui/reftrackitemdata.py#L81-L95
|
239,124
|
JukeboxPipeline/jukebox-core
|
src/jukeboxcore/gui/reftrackitemdata.py
|
reftrack_rtype_data
|
def reftrack_rtype_data(rt, role):
"""Return the data for the releasetype that is loaded by the reftrack
:param rt: the :class:`jukeboxcore.reftrack.Reftrack` holds the data
:type rt: :class:`jukeboxcore.reftrack.Reftrack`
:param role: item data role
:type role: QtCore.Qt.ItemDataRole
:returns: data for the releasetype
:rtype: depending on role
:raises: None
"""
tfi = rt.get_taskfileinfo()
if not tfi:
return
return filesysitemdata.taskfileinfo_rtype_data(tfi, role)
|
python
|
def reftrack_rtype_data(rt, role):
"""Return the data for the releasetype that is loaded by the reftrack
:param rt: the :class:`jukeboxcore.reftrack.Reftrack` holds the data
:type rt: :class:`jukeboxcore.reftrack.Reftrack`
:param role: item data role
:type role: QtCore.Qt.ItemDataRole
:returns: data for the releasetype
:rtype: depending on role
:raises: None
"""
tfi = rt.get_taskfileinfo()
if not tfi:
return
return filesysitemdata.taskfileinfo_rtype_data(tfi, role)
|
[
"def",
"reftrack_rtype_data",
"(",
"rt",
",",
"role",
")",
":",
"tfi",
"=",
"rt",
".",
"get_taskfileinfo",
"(",
")",
"if",
"not",
"tfi",
":",
"return",
"return",
"filesysitemdata",
".",
"taskfileinfo_rtype_data",
"(",
"tfi",
",",
"role",
")"
] |
Return the data for the releasetype that is loaded by the reftrack
:param rt: the :class:`jukeboxcore.reftrack.Reftrack` holds the data
:type rt: :class:`jukeboxcore.reftrack.Reftrack`
:param role: item data role
:type role: QtCore.Qt.ItemDataRole
:returns: data for the releasetype
:rtype: depending on role
:raises: None
|
[
"Return",
"the",
"data",
"for",
"the",
"releasetype",
"that",
"is",
"loaded",
"by",
"the",
"reftrack"
] |
bac2280ca49940355270e4b69400ce9976ab2e6f
|
https://github.com/JukeboxPipeline/jukebox-core/blob/bac2280ca49940355270e4b69400ce9976ab2e6f/src/jukeboxcore/gui/reftrackitemdata.py#L98-L112
|
239,125
|
JukeboxPipeline/jukebox-core
|
src/jukeboxcore/gui/reftrackitemdata.py
|
reftrack_descriptor_data
|
def reftrack_descriptor_data(rt, role):
"""Return the data for the descriptor that is loaded by the reftrack
:param rt: the :class:`jukeboxcore.reftrack.Reftrack` holds the data
:type rt: :class:`jukeboxcore.reftrack.Reftrack`
:param role: item data role
:type role: QtCore.Qt.ItemDataRole
:returns: data for the descriptor
:rtype: depending on role
:raises: None
"""
tfi = rt.get_taskfileinfo()
if not tfi:
return
return filesysitemdata.taskfileinfo_descriptor_data(tfi, role)
|
python
|
def reftrack_descriptor_data(rt, role):
"""Return the data for the descriptor that is loaded by the reftrack
:param rt: the :class:`jukeboxcore.reftrack.Reftrack` holds the data
:type rt: :class:`jukeboxcore.reftrack.Reftrack`
:param role: item data role
:type role: QtCore.Qt.ItemDataRole
:returns: data for the descriptor
:rtype: depending on role
:raises: None
"""
tfi = rt.get_taskfileinfo()
if not tfi:
return
return filesysitemdata.taskfileinfo_descriptor_data(tfi, role)
|
[
"def",
"reftrack_descriptor_data",
"(",
"rt",
",",
"role",
")",
":",
"tfi",
"=",
"rt",
".",
"get_taskfileinfo",
"(",
")",
"if",
"not",
"tfi",
":",
"return",
"return",
"filesysitemdata",
".",
"taskfileinfo_descriptor_data",
"(",
"tfi",
",",
"role",
")"
] |
Return the data for the descriptor that is loaded by the reftrack
:param rt: the :class:`jukeboxcore.reftrack.Reftrack` holds the data
:type rt: :class:`jukeboxcore.reftrack.Reftrack`
:param role: item data role
:type role: QtCore.Qt.ItemDataRole
:returns: data for the descriptor
:rtype: depending on role
:raises: None
|
[
"Return",
"the",
"data",
"for",
"the",
"descriptor",
"that",
"is",
"loaded",
"by",
"the",
"reftrack"
] |
bac2280ca49940355270e4b69400ce9976ab2e6f
|
https://github.com/JukeboxPipeline/jukebox-core/blob/bac2280ca49940355270e4b69400ce9976ab2e6f/src/jukeboxcore/gui/reftrackitemdata.py#L115-L129
|
239,126
|
JukeboxPipeline/jukebox-core
|
src/jukeboxcore/gui/reftrackitemdata.py
|
reftrack_version_data
|
def reftrack_version_data(rt, role):
"""Return the data for the version that is loaded by the reftrack
:param rt: the :class:`jukeboxcore.reftrack.Reftrack` holds the data
:type rt: :class:`jukeboxcore.reftrack.Reftrack`
:param role: item data role
:type role: QtCore.Qt.ItemDataRole
:returns: data for the version
:rtype: depending on role
:raises: None
"""
tfi = rt.get_taskfileinfo()
if not tfi:
return
return filesysitemdata.taskfileinfo_version_data(tfi, role)
|
python
|
def reftrack_version_data(rt, role):
"""Return the data for the version that is loaded by the reftrack
:param rt: the :class:`jukeboxcore.reftrack.Reftrack` holds the data
:type rt: :class:`jukeboxcore.reftrack.Reftrack`
:param role: item data role
:type role: QtCore.Qt.ItemDataRole
:returns: data for the version
:rtype: depending on role
:raises: None
"""
tfi = rt.get_taskfileinfo()
if not tfi:
return
return filesysitemdata.taskfileinfo_version_data(tfi, role)
|
[
"def",
"reftrack_version_data",
"(",
"rt",
",",
"role",
")",
":",
"tfi",
"=",
"rt",
".",
"get_taskfileinfo",
"(",
")",
"if",
"not",
"tfi",
":",
"return",
"return",
"filesysitemdata",
".",
"taskfileinfo_version_data",
"(",
"tfi",
",",
"role",
")"
] |
Return the data for the version that is loaded by the reftrack
:param rt: the :class:`jukeboxcore.reftrack.Reftrack` holds the data
:type rt: :class:`jukeboxcore.reftrack.Reftrack`
:param role: item data role
:type role: QtCore.Qt.ItemDataRole
:returns: data for the version
:rtype: depending on role
:raises: None
|
[
"Return",
"the",
"data",
"for",
"the",
"version",
"that",
"is",
"loaded",
"by",
"the",
"reftrack"
] |
bac2280ca49940355270e4b69400ce9976ab2e6f
|
https://github.com/JukeboxPipeline/jukebox-core/blob/bac2280ca49940355270e4b69400ce9976ab2e6f/src/jukeboxcore/gui/reftrackitemdata.py#L132-L146
|
239,127
|
JukeboxPipeline/jukebox-core
|
src/jukeboxcore/gui/reftrackitemdata.py
|
reftrack_status_data
|
def reftrack_status_data(rt, role):
"""Return the data for the status
:param rt: the :class:`jukeboxcore.reftrack.Reftrack` holds the data
:type rt: :class:`jukeboxcore.reftrack.Reftrack`
:param role: item data role
:type role: QtCore.Qt.ItemDataRole
:returns: data for the status
:rtype: depending on role
:raises: None
"""
status = rt.status()
if role == QtCore.Qt.DisplayRole or role == QtCore.Qt.EditRole:
if status:
return status
else:
return "Not in scene!"
|
python
|
def reftrack_status_data(rt, role):
"""Return the data for the status
:param rt: the :class:`jukeboxcore.reftrack.Reftrack` holds the data
:type rt: :class:`jukeboxcore.reftrack.Reftrack`
:param role: item data role
:type role: QtCore.Qt.ItemDataRole
:returns: data for the status
:rtype: depending on role
:raises: None
"""
status = rt.status()
if role == QtCore.Qt.DisplayRole or role == QtCore.Qt.EditRole:
if status:
return status
else:
return "Not in scene!"
|
[
"def",
"reftrack_status_data",
"(",
"rt",
",",
"role",
")",
":",
"status",
"=",
"rt",
".",
"status",
"(",
")",
"if",
"role",
"==",
"QtCore",
".",
"Qt",
".",
"DisplayRole",
"or",
"role",
"==",
"QtCore",
".",
"Qt",
".",
"EditRole",
":",
"if",
"status",
":",
"return",
"status",
"else",
":",
"return",
"\"Not in scene!\""
] |
Return the data for the status
:param rt: the :class:`jukeboxcore.reftrack.Reftrack` holds the data
:type rt: :class:`jukeboxcore.reftrack.Reftrack`
:param role: item data role
:type role: QtCore.Qt.ItemDataRole
:returns: data for the status
:rtype: depending on role
:raises: None
|
[
"Return",
"the",
"data",
"for",
"the",
"status"
] |
bac2280ca49940355270e4b69400ce9976ab2e6f
|
https://github.com/JukeboxPipeline/jukebox-core/blob/bac2280ca49940355270e4b69400ce9976ab2e6f/src/jukeboxcore/gui/reftrackitemdata.py#L149-L165
|
239,128
|
JukeboxPipeline/jukebox-core
|
src/jukeboxcore/gui/reftrackitemdata.py
|
reftrack_uptodate_data
|
def reftrack_uptodate_data(rt, role):
"""Return the data for the uptodate status
:param rt: the :class:`jukeboxcore.reftrack.Reftrack` holds the data
:type rt: :class:`jukeboxcore.reftrack.Reftrack`
:param role: item data role
:type role: QtCore.Qt.ItemDataRole
:returns: data for the uptodate status
:rtype: depending on role
:raises: None
"""
uptodate = rt.uptodate()
if role == QtCore.Qt.DisplayRole or role == QtCore.Qt.EditRole:
if uptodate:
return "Yes"
else:
return "No"
if role == QtCore.Qt.ForegroundRole:
if uptodate:
return QtGui.QColor(*UPTODATE_RGB)
elif rt.status():
return QtGui.QColor(*OUTDATED_RGB)
|
python
|
def reftrack_uptodate_data(rt, role):
"""Return the data for the uptodate status
:param rt: the :class:`jukeboxcore.reftrack.Reftrack` holds the data
:type rt: :class:`jukeboxcore.reftrack.Reftrack`
:param role: item data role
:type role: QtCore.Qt.ItemDataRole
:returns: data for the uptodate status
:rtype: depending on role
:raises: None
"""
uptodate = rt.uptodate()
if role == QtCore.Qt.DisplayRole or role == QtCore.Qt.EditRole:
if uptodate:
return "Yes"
else:
return "No"
if role == QtCore.Qt.ForegroundRole:
if uptodate:
return QtGui.QColor(*UPTODATE_RGB)
elif rt.status():
return QtGui.QColor(*OUTDATED_RGB)
|
[
"def",
"reftrack_uptodate_data",
"(",
"rt",
",",
"role",
")",
":",
"uptodate",
"=",
"rt",
".",
"uptodate",
"(",
")",
"if",
"role",
"==",
"QtCore",
".",
"Qt",
".",
"DisplayRole",
"or",
"role",
"==",
"QtCore",
".",
"Qt",
".",
"EditRole",
":",
"if",
"uptodate",
":",
"return",
"\"Yes\"",
"else",
":",
"return",
"\"No\"",
"if",
"role",
"==",
"QtCore",
".",
"Qt",
".",
"ForegroundRole",
":",
"if",
"uptodate",
":",
"return",
"QtGui",
".",
"QColor",
"(",
"*",
"UPTODATE_RGB",
")",
"elif",
"rt",
".",
"status",
"(",
")",
":",
"return",
"QtGui",
".",
"QColor",
"(",
"*",
"OUTDATED_RGB",
")"
] |
Return the data for the uptodate status
:param rt: the :class:`jukeboxcore.reftrack.Reftrack` holds the data
:type rt: :class:`jukeboxcore.reftrack.Reftrack`
:param role: item data role
:type role: QtCore.Qt.ItemDataRole
:returns: data for the uptodate status
:rtype: depending on role
:raises: None
|
[
"Return",
"the",
"data",
"for",
"the",
"uptodate",
"status"
] |
bac2280ca49940355270e4b69400ce9976ab2e6f
|
https://github.com/JukeboxPipeline/jukebox-core/blob/bac2280ca49940355270e4b69400ce9976ab2e6f/src/jukeboxcore/gui/reftrackitemdata.py#L168-L189
|
239,129
|
JukeboxPipeline/jukebox-core
|
src/jukeboxcore/gui/reftrackitemdata.py
|
reftrack_alien_data
|
def reftrack_alien_data(rt, role):
"""Return the data for the alien status
:param rt: the :class:`jukeboxcore.reftrack.Reftrack` holds the data
:type rt: :class:`jukeboxcore.reftrack.Reftrack`
:param role: item data role
:type role: QtCore.Qt.ItemDataRole
:returns: data for the alien status
:rtype: depending on role
:raises: None
"""
alien = rt.alien()
if role == QtCore.Qt.DisplayRole or role == QtCore.Qt.EditRole:
if alien:
return "Yes"
else:
return "No"
|
python
|
def reftrack_alien_data(rt, role):
"""Return the data for the alien status
:param rt: the :class:`jukeboxcore.reftrack.Reftrack` holds the data
:type rt: :class:`jukeboxcore.reftrack.Reftrack`
:param role: item data role
:type role: QtCore.Qt.ItemDataRole
:returns: data for the alien status
:rtype: depending on role
:raises: None
"""
alien = rt.alien()
if role == QtCore.Qt.DisplayRole or role == QtCore.Qt.EditRole:
if alien:
return "Yes"
else:
return "No"
|
[
"def",
"reftrack_alien_data",
"(",
"rt",
",",
"role",
")",
":",
"alien",
"=",
"rt",
".",
"alien",
"(",
")",
"if",
"role",
"==",
"QtCore",
".",
"Qt",
".",
"DisplayRole",
"or",
"role",
"==",
"QtCore",
".",
"Qt",
".",
"EditRole",
":",
"if",
"alien",
":",
"return",
"\"Yes\"",
"else",
":",
"return",
"\"No\""
] |
Return the data for the alien status
:param rt: the :class:`jukeboxcore.reftrack.Reftrack` holds the data
:type rt: :class:`jukeboxcore.reftrack.Reftrack`
:param role: item data role
:type role: QtCore.Qt.ItemDataRole
:returns: data for the alien status
:rtype: depending on role
:raises: None
|
[
"Return",
"the",
"data",
"for",
"the",
"alien",
"status"
] |
bac2280ca49940355270e4b69400ce9976ab2e6f
|
https://github.com/JukeboxPipeline/jukebox-core/blob/bac2280ca49940355270e4b69400ce9976ab2e6f/src/jukeboxcore/gui/reftrackitemdata.py#L192-L208
|
239,130
|
JukeboxPipeline/jukebox-core
|
src/jukeboxcore/gui/reftrackitemdata.py
|
reftrack_path_data
|
def reftrack_path_data(rt, role):
"""Return the data for the path that is loaded by the reftrack
:param rt: the :class:`jukeboxcore.reftrack.Reftrack` holds the data
:type rt: :class:`jukeboxcore.reftrack.Reftrack`
:param role: item data role
:type role: QtCore.Qt.ItemDataRole
:returns: data for the path
:rtype: depending on role
:raises: None
"""
tfi = rt.get_taskfileinfo()
if not tfi:
return
return filesysitemdata.taskfileinfo_path_data(tfi, role)
|
python
|
def reftrack_path_data(rt, role):
"""Return the data for the path that is loaded by the reftrack
:param rt: the :class:`jukeboxcore.reftrack.Reftrack` holds the data
:type rt: :class:`jukeboxcore.reftrack.Reftrack`
:param role: item data role
:type role: QtCore.Qt.ItemDataRole
:returns: data for the path
:rtype: depending on role
:raises: None
"""
tfi = rt.get_taskfileinfo()
if not tfi:
return
return filesysitemdata.taskfileinfo_path_data(tfi, role)
|
[
"def",
"reftrack_path_data",
"(",
"rt",
",",
"role",
")",
":",
"tfi",
"=",
"rt",
".",
"get_taskfileinfo",
"(",
")",
"if",
"not",
"tfi",
":",
"return",
"return",
"filesysitemdata",
".",
"taskfileinfo_path_data",
"(",
"tfi",
",",
"role",
")"
] |
Return the data for the path that is loaded by the reftrack
:param rt: the :class:`jukeboxcore.reftrack.Reftrack` holds the data
:type rt: :class:`jukeboxcore.reftrack.Reftrack`
:param role: item data role
:type role: QtCore.Qt.ItemDataRole
:returns: data for the path
:rtype: depending on role
:raises: None
|
[
"Return",
"the",
"data",
"for",
"the",
"path",
"that",
"is",
"loaded",
"by",
"the",
"reftrack"
] |
bac2280ca49940355270e4b69400ce9976ab2e6f
|
https://github.com/JukeboxPipeline/jukebox-core/blob/bac2280ca49940355270e4b69400ce9976ab2e6f/src/jukeboxcore/gui/reftrackitemdata.py#L211-L225
|
239,131
|
JukeboxPipeline/jukebox-core
|
src/jukeboxcore/gui/reftrackitemdata.py
|
reftrack_restricted_data
|
def reftrack_restricted_data(rt, role, attr):
"""Return the data for restriction of the given attr of the given reftrack
:param rt: the :class:`jukeboxcore.reftrack.Reftrack` holds the data
:type rt: :class:`jukeboxcore.reftrack.Reftrack`
:param role: item data role
:type role: QtCore.Qt.ItemDataRole
:returns: data for the restriction
:rtype: depending on role
:raises: None
"""
if role == QtCore.Qt.DisplayRole:
if rt.is_restricted(getattr(rt, attr, None)):
return "Restricted"
else:
return "Allowed"
|
python
|
def reftrack_restricted_data(rt, role, attr):
"""Return the data for restriction of the given attr of the given reftrack
:param rt: the :class:`jukeboxcore.reftrack.Reftrack` holds the data
:type rt: :class:`jukeboxcore.reftrack.Reftrack`
:param role: item data role
:type role: QtCore.Qt.ItemDataRole
:returns: data for the restriction
:rtype: depending on role
:raises: None
"""
if role == QtCore.Qt.DisplayRole:
if rt.is_restricted(getattr(rt, attr, None)):
return "Restricted"
else:
return "Allowed"
|
[
"def",
"reftrack_restricted_data",
"(",
"rt",
",",
"role",
",",
"attr",
")",
":",
"if",
"role",
"==",
"QtCore",
".",
"Qt",
".",
"DisplayRole",
":",
"if",
"rt",
".",
"is_restricted",
"(",
"getattr",
"(",
"rt",
",",
"attr",
",",
"None",
")",
")",
":",
"return",
"\"Restricted\"",
"else",
":",
"return",
"\"Allowed\""
] |
Return the data for restriction of the given attr of the given reftrack
:param rt: the :class:`jukeboxcore.reftrack.Reftrack` holds the data
:type rt: :class:`jukeboxcore.reftrack.Reftrack`
:param role: item data role
:type role: QtCore.Qt.ItemDataRole
:returns: data for the restriction
:rtype: depending on role
:raises: None
|
[
"Return",
"the",
"data",
"for",
"restriction",
"of",
"the",
"given",
"attr",
"of",
"the",
"given",
"reftrack"
] |
bac2280ca49940355270e4b69400ce9976ab2e6f
|
https://github.com/JukeboxPipeline/jukebox-core/blob/bac2280ca49940355270e4b69400ce9976ab2e6f/src/jukeboxcore/gui/reftrackitemdata.py#L228-L243
|
239,132
|
JukeboxPipeline/jukebox-core
|
src/jukeboxcore/gui/reftrackitemdata.py
|
reftrack_object_data
|
def reftrack_object_data(rt, role):
"""Return the reftrack for REFTRACK_OBJECT_ROLE
:param rt: the :class:`jukeboxcore.reftrack.Reftrack` holds the data
:type rt: :class:`jukeboxcore.reftrack.Reftrack`
:param role: item data role
:type role: QtCore.Qt.ItemDataRole
:returns: data for the id
:rtype: depending on the role
:raises: None
"""
if role == QtCore.Qt.DisplayRole:
return str(rt)
if role == REFTRACK_OBJECT_ROLE:
return rt
|
python
|
def reftrack_object_data(rt, role):
"""Return the reftrack for REFTRACK_OBJECT_ROLE
:param rt: the :class:`jukeboxcore.reftrack.Reftrack` holds the data
:type rt: :class:`jukeboxcore.reftrack.Reftrack`
:param role: item data role
:type role: QtCore.Qt.ItemDataRole
:returns: data for the id
:rtype: depending on the role
:raises: None
"""
if role == QtCore.Qt.DisplayRole:
return str(rt)
if role == REFTRACK_OBJECT_ROLE:
return rt
|
[
"def",
"reftrack_object_data",
"(",
"rt",
",",
"role",
")",
":",
"if",
"role",
"==",
"QtCore",
".",
"Qt",
".",
"DisplayRole",
":",
"return",
"str",
"(",
"rt",
")",
"if",
"role",
"==",
"REFTRACK_OBJECT_ROLE",
":",
"return",
"rt"
] |
Return the reftrack for REFTRACK_OBJECT_ROLE
:param rt: the :class:`jukeboxcore.reftrack.Reftrack` holds the data
:type rt: :class:`jukeboxcore.reftrack.Reftrack`
:param role: item data role
:type role: QtCore.Qt.ItemDataRole
:returns: data for the id
:rtype: depending on the role
:raises: None
|
[
"Return",
"the",
"reftrack",
"for",
"REFTRACK_OBJECT_ROLE"
] |
bac2280ca49940355270e4b69400ce9976ab2e6f
|
https://github.com/JukeboxPipeline/jukebox-core/blob/bac2280ca49940355270e4b69400ce9976ab2e6f/src/jukeboxcore/gui/reftrackitemdata.py#L261-L275
|
239,133
|
JukeboxPipeline/jukebox-core
|
src/jukeboxcore/gui/reftrackitemdata.py
|
ReftrackSortFilterModel.filterAcceptsRow
|
def filterAcceptsRow(self, row, parentindex):
"""Return True, if the filter accepts the given row of the parent
:param row: the row to filter
:type row: :class:`int`
:param parentindex: the parent index
:type parentindex: :class:`QtCore.QModelIndex`
:returns: True, if the filter accepts the row
:rtype: :class:`bool`
:raises: None
"""
if not super(ReftrackSortFilterModel, self).filterAcceptsRow(row, parentindex):
return False
if parentindex.isValid():
m = parentindex.model()
else:
m = self.sourceModel()
i = m.index(row, 18, parentindex)
reftrack = i.data(REFTRACK_OBJECT_ROLE)
if not reftrack:
return True
else:
return self.filter_accept_reftrack(reftrack)
|
python
|
def filterAcceptsRow(self, row, parentindex):
"""Return True, if the filter accepts the given row of the parent
:param row: the row to filter
:type row: :class:`int`
:param parentindex: the parent index
:type parentindex: :class:`QtCore.QModelIndex`
:returns: True, if the filter accepts the row
:rtype: :class:`bool`
:raises: None
"""
if not super(ReftrackSortFilterModel, self).filterAcceptsRow(row, parentindex):
return False
if parentindex.isValid():
m = parentindex.model()
else:
m = self.sourceModel()
i = m.index(row, 18, parentindex)
reftrack = i.data(REFTRACK_OBJECT_ROLE)
if not reftrack:
return True
else:
return self.filter_accept_reftrack(reftrack)
|
[
"def",
"filterAcceptsRow",
"(",
"self",
",",
"row",
",",
"parentindex",
")",
":",
"if",
"not",
"super",
"(",
"ReftrackSortFilterModel",
",",
"self",
")",
".",
"filterAcceptsRow",
"(",
"row",
",",
"parentindex",
")",
":",
"return",
"False",
"if",
"parentindex",
".",
"isValid",
"(",
")",
":",
"m",
"=",
"parentindex",
".",
"model",
"(",
")",
"else",
":",
"m",
"=",
"self",
".",
"sourceModel",
"(",
")",
"i",
"=",
"m",
".",
"index",
"(",
"row",
",",
"18",
",",
"parentindex",
")",
"reftrack",
"=",
"i",
".",
"data",
"(",
"REFTRACK_OBJECT_ROLE",
")",
"if",
"not",
"reftrack",
":",
"return",
"True",
"else",
":",
"return",
"self",
".",
"filter_accept_reftrack",
"(",
"reftrack",
")"
] |
Return True, if the filter accepts the given row of the parent
:param row: the row to filter
:type row: :class:`int`
:param parentindex: the parent index
:type parentindex: :class:`QtCore.QModelIndex`
:returns: True, if the filter accepts the row
:rtype: :class:`bool`
:raises: None
|
[
"Return",
"True",
"if",
"the",
"filter",
"accepts",
"the",
"given",
"row",
"of",
"the",
"parent"
] |
bac2280ca49940355270e4b69400ce9976ab2e6f
|
https://github.com/JukeboxPipeline/jukebox-core/blob/bac2280ca49940355270e4b69400ce9976ab2e6f/src/jukeboxcore/gui/reftrackitemdata.py#L378-L401
|
239,134
|
JukeboxPipeline/jukebox-core
|
src/jukeboxcore/gui/reftrackitemdata.py
|
ReftrackSortFilterModel.filter_accept_reftrack
|
def filter_accept_reftrack(self, reftrack):
"""Return True, if the filter accepts the given reftrack
:param reftrack: the reftrack to filter
:type reftrack: :class:`jukeboxcore.reftrack.Reftrack`
:returns: True, if the filter accepts the reftrack
:rtype: :class:`bool`
:raises: None
"""
if reftrack.status() in self._forbidden_status:
return False
if reftrack.get_typ() in self._forbidden_types:
return False
if reftrack.uptodate() in self._forbidden_uptodate:
return False
if reftrack.alien() in self._forbidden_alien:
return False
return True
|
python
|
def filter_accept_reftrack(self, reftrack):
"""Return True, if the filter accepts the given reftrack
:param reftrack: the reftrack to filter
:type reftrack: :class:`jukeboxcore.reftrack.Reftrack`
:returns: True, if the filter accepts the reftrack
:rtype: :class:`bool`
:raises: None
"""
if reftrack.status() in self._forbidden_status:
return False
if reftrack.get_typ() in self._forbidden_types:
return False
if reftrack.uptodate() in self._forbidden_uptodate:
return False
if reftrack.alien() in self._forbidden_alien:
return False
return True
|
[
"def",
"filter_accept_reftrack",
"(",
"self",
",",
"reftrack",
")",
":",
"if",
"reftrack",
".",
"status",
"(",
")",
"in",
"self",
".",
"_forbidden_status",
":",
"return",
"False",
"if",
"reftrack",
".",
"get_typ",
"(",
")",
"in",
"self",
".",
"_forbidden_types",
":",
"return",
"False",
"if",
"reftrack",
".",
"uptodate",
"(",
")",
"in",
"self",
".",
"_forbidden_uptodate",
":",
"return",
"False",
"if",
"reftrack",
".",
"alien",
"(",
")",
"in",
"self",
".",
"_forbidden_alien",
":",
"return",
"False",
"return",
"True"
] |
Return True, if the filter accepts the given reftrack
:param reftrack: the reftrack to filter
:type reftrack: :class:`jukeboxcore.reftrack.Reftrack`
:returns: True, if the filter accepts the reftrack
:rtype: :class:`bool`
:raises: None
|
[
"Return",
"True",
"if",
"the",
"filter",
"accepts",
"the",
"given",
"reftrack"
] |
bac2280ca49940355270e4b69400ce9976ab2e6f
|
https://github.com/JukeboxPipeline/jukebox-core/blob/bac2280ca49940355270e4b69400ce9976ab2e6f/src/jukeboxcore/gui/reftrackitemdata.py#L403-L420
|
239,135
|
JukeboxPipeline/jukebox-core
|
src/jukeboxcore/gui/reftrackitemdata.py
|
ReftrackSortFilterModel.set_forbidden_statuses
|
def set_forbidden_statuses(self, statuses):
"""Set all forbidden status values
:param statuses: a list with forbidden status values
:type statuses: list
:returns: None
:rtype: None
:raises: None
"""
if self._forbidden_status == statuses:
return
self._forbidden_status = statuses
self.invalidateFilter()
|
python
|
def set_forbidden_statuses(self, statuses):
"""Set all forbidden status values
:param statuses: a list with forbidden status values
:type statuses: list
:returns: None
:rtype: None
:raises: None
"""
if self._forbidden_status == statuses:
return
self._forbidden_status = statuses
self.invalidateFilter()
|
[
"def",
"set_forbidden_statuses",
"(",
"self",
",",
"statuses",
")",
":",
"if",
"self",
".",
"_forbidden_status",
"==",
"statuses",
":",
"return",
"self",
".",
"_forbidden_status",
"=",
"statuses",
"self",
".",
"invalidateFilter",
"(",
")"
] |
Set all forbidden status values
:param statuses: a list with forbidden status values
:type statuses: list
:returns: None
:rtype: None
:raises: None
|
[
"Set",
"all",
"forbidden",
"status",
"values"
] |
bac2280ca49940355270e4b69400ce9976ab2e6f
|
https://github.com/JukeboxPipeline/jukebox-core/blob/bac2280ca49940355270e4b69400ce9976ab2e6f/src/jukeboxcore/gui/reftrackitemdata.py#L422-L434
|
239,136
|
JukeboxPipeline/jukebox-core
|
src/jukeboxcore/gui/reftrackitemdata.py
|
ReftrackSortFilterModel.set_forbidden_types
|
def set_forbidden_types(self, types):
"""Set all forbidden type values
:param typees: a list with forbidden type values
:type typees: list
:returns: None
:rtype: None
:raises: None
"""
if self._forbidden_types == types:
return
self._forbidden_types = types
self.invalidateFilter()
|
python
|
def set_forbidden_types(self, types):
"""Set all forbidden type values
:param typees: a list with forbidden type values
:type typees: list
:returns: None
:rtype: None
:raises: None
"""
if self._forbidden_types == types:
return
self._forbidden_types = types
self.invalidateFilter()
|
[
"def",
"set_forbidden_types",
"(",
"self",
",",
"types",
")",
":",
"if",
"self",
".",
"_forbidden_types",
"==",
"types",
":",
"return",
"self",
".",
"_forbidden_types",
"=",
"types",
"self",
".",
"invalidateFilter",
"(",
")"
] |
Set all forbidden type values
:param typees: a list with forbidden type values
:type typees: list
:returns: None
:rtype: None
:raises: None
|
[
"Set",
"all",
"forbidden",
"type",
"values"
] |
bac2280ca49940355270e4b69400ce9976ab2e6f
|
https://github.com/JukeboxPipeline/jukebox-core/blob/bac2280ca49940355270e4b69400ce9976ab2e6f/src/jukeboxcore/gui/reftrackitemdata.py#L445-L457
|
239,137
|
JukeboxPipeline/jukebox-core
|
src/jukeboxcore/gui/reftrackitemdata.py
|
ReftrackSortFilterModel.set_forbidden_uptodate
|
def set_forbidden_uptodate(self, uptodate):
"""Set all forbidden uptodate values
:param uptodatees: a list with forbidden uptodate values
:uptodate uptodatees: list
:returns: None
:ruptodate: None
:raises: None
"""
if self._forbidden_uptodate == uptodate:
return
self._forbidden_uptodate = uptodate
self.invalidateFilter()
|
python
|
def set_forbidden_uptodate(self, uptodate):
"""Set all forbidden uptodate values
:param uptodatees: a list with forbidden uptodate values
:uptodate uptodatees: list
:returns: None
:ruptodate: None
:raises: None
"""
if self._forbidden_uptodate == uptodate:
return
self._forbidden_uptodate = uptodate
self.invalidateFilter()
|
[
"def",
"set_forbidden_uptodate",
"(",
"self",
",",
"uptodate",
")",
":",
"if",
"self",
".",
"_forbidden_uptodate",
"==",
"uptodate",
":",
"return",
"self",
".",
"_forbidden_uptodate",
"=",
"uptodate",
"self",
".",
"invalidateFilter",
"(",
")"
] |
Set all forbidden uptodate values
:param uptodatees: a list with forbidden uptodate values
:uptodate uptodatees: list
:returns: None
:ruptodate: None
:raises: None
|
[
"Set",
"all",
"forbidden",
"uptodate",
"values"
] |
bac2280ca49940355270e4b69400ce9976ab2e6f
|
https://github.com/JukeboxPipeline/jukebox-core/blob/bac2280ca49940355270e4b69400ce9976ab2e6f/src/jukeboxcore/gui/reftrackitemdata.py#L468-L480
|
239,138
|
JukeboxPipeline/jukebox-core
|
src/jukeboxcore/gui/reftrackitemdata.py
|
ReftrackSortFilterModel.set_forbidden_alien
|
def set_forbidden_alien(self, alien):
"""Set all forbidden alien values
:param alienes: a list with forbidden alien values
:alien alienes: list
:returns: None
:ralien: None
:raises: None
"""
if self._forbidden_alien == alien:
return
self._forbidden_alien = alien
self.invalidateFilter()
|
python
|
def set_forbidden_alien(self, alien):
"""Set all forbidden alien values
:param alienes: a list with forbidden alien values
:alien alienes: list
:returns: None
:ralien: None
:raises: None
"""
if self._forbidden_alien == alien:
return
self._forbidden_alien = alien
self.invalidateFilter()
|
[
"def",
"set_forbidden_alien",
"(",
"self",
",",
"alien",
")",
":",
"if",
"self",
".",
"_forbidden_alien",
"==",
"alien",
":",
"return",
"self",
".",
"_forbidden_alien",
"=",
"alien",
"self",
".",
"invalidateFilter",
"(",
")"
] |
Set all forbidden alien values
:param alienes: a list with forbidden alien values
:alien alienes: list
:returns: None
:ralien: None
:raises: None
|
[
"Set",
"all",
"forbidden",
"alien",
"values"
] |
bac2280ca49940355270e4b69400ce9976ab2e6f
|
https://github.com/JukeboxPipeline/jukebox-core/blob/bac2280ca49940355270e4b69400ce9976ab2e6f/src/jukeboxcore/gui/reftrackitemdata.py#L491-L503
|
239,139
|
cnobile2012/pololu-motors
|
pololu/motors/qik2s9v1.py
|
Qik2s9v1.getError
|
def getError(self, device=DEFAULT_DEVICE_ID, message=True):
"""
Get the error message or value stored in the Qik 2s9v1 hardware.
:Keywords:
device : `int`
The device is the integer number of the hardware devices ID and
is only used with the Pololu Protocol. Defaults to the hardware's
default value.
message : `bool`
If set to `True` a text message will be returned, if set to `False`
the integer stored in the Qik will be returned.
:Returns:
A list of text messages, integers, or and empty list. See the
`message` parameter above.
"""
return self._getError(device, message)
|
python
|
def getError(self, device=DEFAULT_DEVICE_ID, message=True):
"""
Get the error message or value stored in the Qik 2s9v1 hardware.
:Keywords:
device : `int`
The device is the integer number of the hardware devices ID and
is only used with the Pololu Protocol. Defaults to the hardware's
default value.
message : `bool`
If set to `True` a text message will be returned, if set to `False`
the integer stored in the Qik will be returned.
:Returns:
A list of text messages, integers, or and empty list. See the
`message` parameter above.
"""
return self._getError(device, message)
|
[
"def",
"getError",
"(",
"self",
",",
"device",
"=",
"DEFAULT_DEVICE_ID",
",",
"message",
"=",
"True",
")",
":",
"return",
"self",
".",
"_getError",
"(",
"device",
",",
"message",
")"
] |
Get the error message or value stored in the Qik 2s9v1 hardware.
:Keywords:
device : `int`
The device is the integer number of the hardware devices ID and
is only used with the Pololu Protocol. Defaults to the hardware's
default value.
message : `bool`
If set to `True` a text message will be returned, if set to `False`
the integer stored in the Qik will be returned.
:Returns:
A list of text messages, integers, or and empty list. See the
`message` parameter above.
|
[
"Get",
"the",
"error",
"message",
"or",
"value",
"stored",
"in",
"the",
"Qik",
"2s9v1",
"hardware",
"."
] |
453d2283a63cfe15cda96cad6dffa73372d52a7c
|
https://github.com/cnobile2012/pololu-motors/blob/453d2283a63cfe15cda96cad6dffa73372d52a7c/pololu/motors/qik2s9v1.py#L106-L123
|
239,140
|
cnobile2012/pololu-motors
|
pololu/motors/qik2s9v1.py
|
Qik2s9v1.getPWMFrequency
|
def getPWMFrequency(self, device=DEFAULT_DEVICE_ID, message=True):
"""
Get the motor shutdown on error status stored on the hardware device.
:Keywords:
device : `int`
The device is the integer number of the hardware devices ID and
is only used with the Pololu Protocol. Defaults to the hardware's
default value.
message : `bool`
If set to `True` a text message will be returned, if set to `False`
the integer stored in the Qik will be returned.
:Returns:
A text message or an int. See the `message` parameter above.
"""
return self._getPWMFrequency(device, message)
|
python
|
def getPWMFrequency(self, device=DEFAULT_DEVICE_ID, message=True):
"""
Get the motor shutdown on error status stored on the hardware device.
:Keywords:
device : `int`
The device is the integer number of the hardware devices ID and
is only used with the Pololu Protocol. Defaults to the hardware's
default value.
message : `bool`
If set to `True` a text message will be returned, if set to `False`
the integer stored in the Qik will be returned.
:Returns:
A text message or an int. See the `message` parameter above.
"""
return self._getPWMFrequency(device, message)
|
[
"def",
"getPWMFrequency",
"(",
"self",
",",
"device",
"=",
"DEFAULT_DEVICE_ID",
",",
"message",
"=",
"True",
")",
":",
"return",
"self",
".",
"_getPWMFrequency",
"(",
"device",
",",
"message",
")"
] |
Get the motor shutdown on error status stored on the hardware device.
:Keywords:
device : `int`
The device is the integer number of the hardware devices ID and
is only used with the Pololu Protocol. Defaults to the hardware's
default value.
message : `bool`
If set to `True` a text message will be returned, if set to `False`
the integer stored in the Qik will be returned.
:Returns:
A text message or an int. See the `message` parameter above.
|
[
"Get",
"the",
"motor",
"shutdown",
"on",
"error",
"status",
"stored",
"on",
"the",
"hardware",
"device",
"."
] |
453d2283a63cfe15cda96cad6dffa73372d52a7c
|
https://github.com/cnobile2012/pololu-motors/blob/453d2283a63cfe15cda96cad6dffa73372d52a7c/pololu/motors/qik2s9v1.py#L140-L156
|
239,141
|
cnobile2012/pololu-motors
|
pololu/motors/qik2s9v1.py
|
Qik2s9v1.setM0Coast
|
def setM0Coast(self, device=DEFAULT_DEVICE_ID):
"""
Set motor 0 to coast.
:Keywords:
device : `int`
The device is the integer number of the hardware devices ID and
is only used with the Pololu Protocol. Defaults to the hardware's
default value.
:Exceptions:
* `SerialTimeoutException`
If the low level serial package times out.
* `SerialException`
IO error when the port is not open.
"""
cmd = self._COMMAND.get('m0-coast')
self._writeData(cmd, device)
|
python
|
def setM0Coast(self, device=DEFAULT_DEVICE_ID):
"""
Set motor 0 to coast.
:Keywords:
device : `int`
The device is the integer number of the hardware devices ID and
is only used with the Pololu Protocol. Defaults to the hardware's
default value.
:Exceptions:
* `SerialTimeoutException`
If the low level serial package times out.
* `SerialException`
IO error when the port is not open.
"""
cmd = self._COMMAND.get('m0-coast')
self._writeData(cmd, device)
|
[
"def",
"setM0Coast",
"(",
"self",
",",
"device",
"=",
"DEFAULT_DEVICE_ID",
")",
":",
"cmd",
"=",
"self",
".",
"_COMMAND",
".",
"get",
"(",
"'m0-coast'",
")",
"self",
".",
"_writeData",
"(",
"cmd",
",",
"device",
")"
] |
Set motor 0 to coast.
:Keywords:
device : `int`
The device is the integer number of the hardware devices ID and
is only used with the Pololu Protocol. Defaults to the hardware's
default value.
:Exceptions:
* `SerialTimeoutException`
If the low level serial package times out.
* `SerialException`
IO error when the port is not open.
|
[
"Set",
"motor",
"0",
"to",
"coast",
"."
] |
453d2283a63cfe15cda96cad6dffa73372d52a7c
|
https://github.com/cnobile2012/pololu-motors/blob/453d2283a63cfe15cda96cad6dffa73372d52a7c/pololu/motors/qik2s9v1.py#L333-L350
|
239,142
|
cnobile2012/pololu-motors
|
pololu/motors/qik2s9v1.py
|
Qik2s9v1.setM1Coast
|
def setM1Coast(self, device=DEFAULT_DEVICE_ID):
"""
Set motor 1 to coast.
:Keywords:
device : `int`
The device is the integer number of the hardware devices ID and
is only used with the Pololu Protocol. Defaults to the hardware's
default value.
:Exceptions:
* `SerialTimeoutException`
If the low level serial package times out.
* `SerialException`
IO error when the port is not open.
"""
cmd = self._COMMAND.get('m1-coast')
self._writeData(cmd, device)
|
python
|
def setM1Coast(self, device=DEFAULT_DEVICE_ID):
"""
Set motor 1 to coast.
:Keywords:
device : `int`
The device is the integer number of the hardware devices ID and
is only used with the Pololu Protocol. Defaults to the hardware's
default value.
:Exceptions:
* `SerialTimeoutException`
If the low level serial package times out.
* `SerialException`
IO error when the port is not open.
"""
cmd = self._COMMAND.get('m1-coast')
self._writeData(cmd, device)
|
[
"def",
"setM1Coast",
"(",
"self",
",",
"device",
"=",
"DEFAULT_DEVICE_ID",
")",
":",
"cmd",
"=",
"self",
".",
"_COMMAND",
".",
"get",
"(",
"'m1-coast'",
")",
"self",
".",
"_writeData",
"(",
"cmd",
",",
"device",
")"
] |
Set motor 1 to coast.
:Keywords:
device : `int`
The device is the integer number of the hardware devices ID and
is only used with the Pololu Protocol. Defaults to the hardware's
default value.
:Exceptions:
* `SerialTimeoutException`
If the low level serial package times out.
* `SerialException`
IO error when the port is not open.
|
[
"Set",
"motor",
"1",
"to",
"coast",
"."
] |
453d2283a63cfe15cda96cad6dffa73372d52a7c
|
https://github.com/cnobile2012/pololu-motors/blob/453d2283a63cfe15cda96cad6dffa73372d52a7c/pololu/motors/qik2s9v1.py#L352-L369
|
239,143
|
JukeboxPipeline/jukebox-core
|
src/jukeboxcore/gui/actionreport.py
|
create_action_model
|
def create_action_model(actioncollection):
"""Create and return a new model for the given actioncollection
:param actioncollection: the action collection that should get a model
:type actioncollection: :class:`jukeboxcore.action.ActionCollection`
:returns: the created model
:rtype: :class:`TreeModel`
:raises: None
"""
rootdata = ListItemData(["Name", "Description", "Status", "Message", "Traceback"])
root = TreeItem(rootdata)
for au in actioncollection.actions:
adata = ActionItemData(au)
TreeItem(adata, parent=root)
return TreeModel(root)
|
python
|
def create_action_model(actioncollection):
"""Create and return a new model for the given actioncollection
:param actioncollection: the action collection that should get a model
:type actioncollection: :class:`jukeboxcore.action.ActionCollection`
:returns: the created model
:rtype: :class:`TreeModel`
:raises: None
"""
rootdata = ListItemData(["Name", "Description", "Status", "Message", "Traceback"])
root = TreeItem(rootdata)
for au in actioncollection.actions:
adata = ActionItemData(au)
TreeItem(adata, parent=root)
return TreeModel(root)
|
[
"def",
"create_action_model",
"(",
"actioncollection",
")",
":",
"rootdata",
"=",
"ListItemData",
"(",
"[",
"\"Name\"",
",",
"\"Description\"",
",",
"\"Status\"",
",",
"\"Message\"",
",",
"\"Traceback\"",
"]",
")",
"root",
"=",
"TreeItem",
"(",
"rootdata",
")",
"for",
"au",
"in",
"actioncollection",
".",
"actions",
":",
"adata",
"=",
"ActionItemData",
"(",
"au",
")",
"TreeItem",
"(",
"adata",
",",
"parent",
"=",
"root",
")",
"return",
"TreeModel",
"(",
"root",
")"
] |
Create and return a new model for the given actioncollection
:param actioncollection: the action collection that should get a model
:type actioncollection: :class:`jukeboxcore.action.ActionCollection`
:returns: the created model
:rtype: :class:`TreeModel`
:raises: None
|
[
"Create",
"and",
"return",
"a",
"new",
"model",
"for",
"the",
"given",
"actioncollection"
] |
bac2280ca49940355270e4b69400ce9976ab2e6f
|
https://github.com/JukeboxPipeline/jukebox-core/blob/bac2280ca49940355270e4b69400ce9976ab2e6f/src/jukeboxcore/gui/actionreport.py#L96-L110
|
239,144
|
ericflo/hurricane
|
hurricane/handlers/base.py
|
BaseHandler.auto_subscribe
|
def auto_subscribe(self, app_manager):
"""Called to subscribe the handlers on init."""
for handler in app_manager.handler_classes:
app_manager.subscribe(handler.channel(), self)
|
python
|
def auto_subscribe(self, app_manager):
"""Called to subscribe the handlers on init."""
for handler in app_manager.handler_classes:
app_manager.subscribe(handler.channel(), self)
|
[
"def",
"auto_subscribe",
"(",
"self",
",",
"app_manager",
")",
":",
"for",
"handler",
"in",
"app_manager",
".",
"handler_classes",
":",
"app_manager",
".",
"subscribe",
"(",
"handler",
".",
"channel",
"(",
")",
",",
"self",
")"
] |
Called to subscribe the handlers on init.
|
[
"Called",
"to",
"subscribe",
"the",
"handlers",
"on",
"init",
"."
] |
c192b711b2b1c06a386d1a1a47f538b13a659cde
|
https://github.com/ericflo/hurricane/blob/c192b711b2b1c06a386d1a1a47f538b13a659cde/hurricane/handlers/base.py#L23-L26
|
239,145
|
GearPlug/paymentsos-python
|
paymentsos/payments.py
|
Payment.create_payment
|
def create_payment(self, *, amount, currency, order=None, customer_id=None, billing_address=None,
shipping_address=None, additional_details=None, statement_soft_descriptor=None):
"""
Creates a payment object, which provides a single reference to all the transactions that make up a payment.
This is the first step for all financial transactions.
Args:
amount: Amount must be greater than 0. The amount is formatted in Minor Units format.
currency: The three character currency code in ISO-4217 format.
order: Details of the order.
customer_id: Identifier of the customer associated with this payment.
billing_address: Billing address details. This will only be sent to providers who support
billing addresses, in requests that support them. Note: The billing address details will be sent "as is",
without any corrections or substitutions from the billing address in the token resource.
shipping_address: Shipping address details. This will only be sent to providers who support
shipping addresses, in requests that support them. Note: The shipping address details will be sent "as is",
without any corrections or substitutions from the shipping address in the customer resource.
additional_details: Optional additional data stored in key/value pairs.
statement_soft_descriptor: The transaction description that will appear in the
customer's credit card statement, which identifies the merchant and payment.
Check the relevant provider sites to see if this field is supported.
If so, see the required content and format. Note: This transaction description is generated by you.
Providing a clear description helps your customers recognize their transactions, and reduces chargebacks.
Returns:
"""
headers = self.client._get_private_headers()
payload = {
"amount": amount,
"currency": currency,
"order": order,
"customer_id": customer_id,
"billing_address": billing_address,
"shipping_address": shipping_address,
"additional_details": additional_details,
"statement_soft_descriptor": statement_soft_descriptor,
}
endpoint = '/payments'
return self.client._post(self.client.URL_BASE + endpoint, json=payload, headers=headers)
|
python
|
def create_payment(self, *, amount, currency, order=None, customer_id=None, billing_address=None,
shipping_address=None, additional_details=None, statement_soft_descriptor=None):
"""
Creates a payment object, which provides a single reference to all the transactions that make up a payment.
This is the first step for all financial transactions.
Args:
amount: Amount must be greater than 0. The amount is formatted in Minor Units format.
currency: The three character currency code in ISO-4217 format.
order: Details of the order.
customer_id: Identifier of the customer associated with this payment.
billing_address: Billing address details. This will only be sent to providers who support
billing addresses, in requests that support them. Note: The billing address details will be sent "as is",
without any corrections or substitutions from the billing address in the token resource.
shipping_address: Shipping address details. This will only be sent to providers who support
shipping addresses, in requests that support them. Note: The shipping address details will be sent "as is",
without any corrections or substitutions from the shipping address in the customer resource.
additional_details: Optional additional data stored in key/value pairs.
statement_soft_descriptor: The transaction description that will appear in the
customer's credit card statement, which identifies the merchant and payment.
Check the relevant provider sites to see if this field is supported.
If so, see the required content and format. Note: This transaction description is generated by you.
Providing a clear description helps your customers recognize their transactions, and reduces chargebacks.
Returns:
"""
headers = self.client._get_private_headers()
payload = {
"amount": amount,
"currency": currency,
"order": order,
"customer_id": customer_id,
"billing_address": billing_address,
"shipping_address": shipping_address,
"additional_details": additional_details,
"statement_soft_descriptor": statement_soft_descriptor,
}
endpoint = '/payments'
return self.client._post(self.client.URL_BASE + endpoint, json=payload, headers=headers)
|
[
"def",
"create_payment",
"(",
"self",
",",
"*",
",",
"amount",
",",
"currency",
",",
"order",
"=",
"None",
",",
"customer_id",
"=",
"None",
",",
"billing_address",
"=",
"None",
",",
"shipping_address",
"=",
"None",
",",
"additional_details",
"=",
"None",
",",
"statement_soft_descriptor",
"=",
"None",
")",
":",
"headers",
"=",
"self",
".",
"client",
".",
"_get_private_headers",
"(",
")",
"payload",
"=",
"{",
"\"amount\"",
":",
"amount",
",",
"\"currency\"",
":",
"currency",
",",
"\"order\"",
":",
"order",
",",
"\"customer_id\"",
":",
"customer_id",
",",
"\"billing_address\"",
":",
"billing_address",
",",
"\"shipping_address\"",
":",
"shipping_address",
",",
"\"additional_details\"",
":",
"additional_details",
",",
"\"statement_soft_descriptor\"",
":",
"statement_soft_descriptor",
",",
"}",
"endpoint",
"=",
"'/payments'",
"return",
"self",
".",
"client",
".",
"_post",
"(",
"self",
".",
"client",
".",
"URL_BASE",
"+",
"endpoint",
",",
"json",
"=",
"payload",
",",
"headers",
"=",
"headers",
")"
] |
Creates a payment object, which provides a single reference to all the transactions that make up a payment.
This is the first step for all financial transactions.
Args:
amount: Amount must be greater than 0. The amount is formatted in Minor Units format.
currency: The three character currency code in ISO-4217 format.
order: Details of the order.
customer_id: Identifier of the customer associated with this payment.
billing_address: Billing address details. This will only be sent to providers who support
billing addresses, in requests that support them. Note: The billing address details will be sent "as is",
without any corrections or substitutions from the billing address in the token resource.
shipping_address: Shipping address details. This will only be sent to providers who support
shipping addresses, in requests that support them. Note: The shipping address details will be sent "as is",
without any corrections or substitutions from the shipping address in the customer resource.
additional_details: Optional additional data stored in key/value pairs.
statement_soft_descriptor: The transaction description that will appear in the
customer's credit card statement, which identifies the merchant and payment.
Check the relevant provider sites to see if this field is supported.
If so, see the required content and format. Note: This transaction description is generated by you.
Providing a clear description helps your customers recognize their transactions, and reduces chargebacks.
Returns:
|
[
"Creates",
"a",
"payment",
"object",
"which",
"provides",
"a",
"single",
"reference",
"to",
"all",
"the",
"transactions",
"that",
"make",
"up",
"a",
"payment",
".",
"This",
"is",
"the",
"first",
"step",
"for",
"all",
"financial",
"transactions",
"."
] |
2f32ba83ae890c96799b71d49fc6740bc1081f89
|
https://github.com/GearPlug/paymentsos-python/blob/2f32ba83ae890c96799b71d49fc6740bc1081f89/paymentsos/payments.py#L6-L45
|
239,146
|
zmiller91/aws-lambda-api-builder
|
api_builder/zlab.py
|
get_module_parser
|
def get_module_parser(mod, modname, parents=[], add_help=True):
"""
Returns an argument parser for the sub-command's CLI.
:param mod: the sub-command's python module
:param modnam: the string name of the python module
:return: ArgumentParser
"""
return argparse.ArgumentParser(
usage=configuration.EXECUTABLE_NAME + ' ' + modname + ' [options]',
description=mod.get_description(), parents=parents,
add_help=add_help)
|
python
|
def get_module_parser(mod, modname, parents=[], add_help=True):
"""
Returns an argument parser for the sub-command's CLI.
:param mod: the sub-command's python module
:param modnam: the string name of the python module
:return: ArgumentParser
"""
return argparse.ArgumentParser(
usage=configuration.EXECUTABLE_NAME + ' ' + modname + ' [options]',
description=mod.get_description(), parents=parents,
add_help=add_help)
|
[
"def",
"get_module_parser",
"(",
"mod",
",",
"modname",
",",
"parents",
"=",
"[",
"]",
",",
"add_help",
"=",
"True",
")",
":",
"return",
"argparse",
".",
"ArgumentParser",
"(",
"usage",
"=",
"configuration",
".",
"EXECUTABLE_NAME",
"+",
"' '",
"+",
"modname",
"+",
"' [options]'",
",",
"description",
"=",
"mod",
".",
"get_description",
"(",
")",
",",
"parents",
"=",
"parents",
",",
"add_help",
"=",
"add_help",
")"
] |
Returns an argument parser for the sub-command's CLI.
:param mod: the sub-command's python module
:param modnam: the string name of the python module
:return: ArgumentParser
|
[
"Returns",
"an",
"argument",
"parser",
"for",
"the",
"sub",
"-",
"command",
"s",
"CLI",
"."
] |
86026b5c134faa33eaa1e1268e0206cb074e3285
|
https://github.com/zmiller91/aws-lambda-api-builder/blob/86026b5c134faa33eaa1e1268e0206cb074e3285/api_builder/zlab.py#L8-L19
|
239,147
|
zmiller91/aws-lambda-api-builder
|
api_builder/zlab.py
|
get_application_parser
|
def get_application_parser(commands):
"""
Builds an argument parser for the application's CLI.
:param commands:
:return: ArgumentParser
"""
parser = argparse.ArgumentParser(
description=configuration.APPLICATION_DESCRIPTION,
usage =configuration.EXECUTABLE_NAME + ' [sub-command] [options]',
add_help=False)
parser.add_argument(
'sub_command',
choices=[name for name in commands],
nargs="?")
parser.add_argument("-h", "--help", action="store_true")
return parser
|
python
|
def get_application_parser(commands):
"""
Builds an argument parser for the application's CLI.
:param commands:
:return: ArgumentParser
"""
parser = argparse.ArgumentParser(
description=configuration.APPLICATION_DESCRIPTION,
usage =configuration.EXECUTABLE_NAME + ' [sub-command] [options]',
add_help=False)
parser.add_argument(
'sub_command',
choices=[name for name in commands],
nargs="?")
parser.add_argument("-h", "--help", action="store_true")
return parser
|
[
"def",
"get_application_parser",
"(",
"commands",
")",
":",
"parser",
"=",
"argparse",
".",
"ArgumentParser",
"(",
"description",
"=",
"configuration",
".",
"APPLICATION_DESCRIPTION",
",",
"usage",
"=",
"configuration",
".",
"EXECUTABLE_NAME",
"+",
"' [sub-command] [options]'",
",",
"add_help",
"=",
"False",
")",
"parser",
".",
"add_argument",
"(",
"'sub_command'",
",",
"choices",
"=",
"[",
"name",
"for",
"name",
"in",
"commands",
"]",
",",
"nargs",
"=",
"\"?\"",
")",
"parser",
".",
"add_argument",
"(",
"\"-h\"",
",",
"\"--help\"",
",",
"action",
"=",
"\"store_true\"",
")",
"return",
"parser"
] |
Builds an argument parser for the application's CLI.
:param commands:
:return: ArgumentParser
|
[
"Builds",
"an",
"argument",
"parser",
"for",
"the",
"application",
"s",
"CLI",
"."
] |
86026b5c134faa33eaa1e1268e0206cb074e3285
|
https://github.com/zmiller91/aws-lambda-api-builder/blob/86026b5c134faa33eaa1e1268e0206cb074e3285/api_builder/zlab.py#L22-L41
|
239,148
|
botswana-harvard/edc-registration
|
edc_registration/model_mixins/updates_or_creates_registered_subject_model_mixin.py
|
UpdatesOrCreatesRegistrationModelMixin.registration_update_or_create
|
def registration_update_or_create(self):
"""Creates or Updates the registration model with attributes
from this instance.
Called from the signal
"""
if not getattr(self, self.registration_unique_field):
raise UpdatesOrCreatesRegistrationModelError(
f'Cannot update or create RegisteredSubject. '
f'Field value for \'{self.registration_unique_field}\' is None.')
registration_value = getattr(self, self.registration_unique_field)
registration_value = self.to_string(registration_value)
try:
obj = self.registration_model.objects.get(
**{self.registered_subject_unique_field: registration_value})
except self.registration_model.DoesNotExist:
pass
else:
self.registration_raise_on_illegal_value_change(obj)
registered_subject, created = self.registration_model.objects.update_or_create(
**{self.registered_subject_unique_field: registration_value},
defaults=self.registration_options)
return registered_subject, created
|
python
|
def registration_update_or_create(self):
"""Creates or Updates the registration model with attributes
from this instance.
Called from the signal
"""
if not getattr(self, self.registration_unique_field):
raise UpdatesOrCreatesRegistrationModelError(
f'Cannot update or create RegisteredSubject. '
f'Field value for \'{self.registration_unique_field}\' is None.')
registration_value = getattr(self, self.registration_unique_field)
registration_value = self.to_string(registration_value)
try:
obj = self.registration_model.objects.get(
**{self.registered_subject_unique_field: registration_value})
except self.registration_model.DoesNotExist:
pass
else:
self.registration_raise_on_illegal_value_change(obj)
registered_subject, created = self.registration_model.objects.update_or_create(
**{self.registered_subject_unique_field: registration_value},
defaults=self.registration_options)
return registered_subject, created
|
[
"def",
"registration_update_or_create",
"(",
"self",
")",
":",
"if",
"not",
"getattr",
"(",
"self",
",",
"self",
".",
"registration_unique_field",
")",
":",
"raise",
"UpdatesOrCreatesRegistrationModelError",
"(",
"f'Cannot update or create RegisteredSubject. '",
"f'Field value for \\'{self.registration_unique_field}\\' is None.'",
")",
"registration_value",
"=",
"getattr",
"(",
"self",
",",
"self",
".",
"registration_unique_field",
")",
"registration_value",
"=",
"self",
".",
"to_string",
"(",
"registration_value",
")",
"try",
":",
"obj",
"=",
"self",
".",
"registration_model",
".",
"objects",
".",
"get",
"(",
"*",
"*",
"{",
"self",
".",
"registered_subject_unique_field",
":",
"registration_value",
"}",
")",
"except",
"self",
".",
"registration_model",
".",
"DoesNotExist",
":",
"pass",
"else",
":",
"self",
".",
"registration_raise_on_illegal_value_change",
"(",
"obj",
")",
"registered_subject",
",",
"created",
"=",
"self",
".",
"registration_model",
".",
"objects",
".",
"update_or_create",
"(",
"*",
"*",
"{",
"self",
".",
"registered_subject_unique_field",
":",
"registration_value",
"}",
",",
"defaults",
"=",
"self",
".",
"registration_options",
")",
"return",
"registered_subject",
",",
"created"
] |
Creates or Updates the registration model with attributes
from this instance.
Called from the signal
|
[
"Creates",
"or",
"Updates",
"the",
"registration",
"model",
"with",
"attributes",
"from",
"this",
"instance",
"."
] |
3daca624a496945fd4536488f6f80790bbecc081
|
https://github.com/botswana-harvard/edc-registration/blob/3daca624a496945fd4536488f6f80790bbecc081/edc_registration/model_mixins/updates_or_creates_registered_subject_model_mixin.py#L22-L46
|
239,149
|
botswana-harvard/edc-registration
|
edc_registration/model_mixins/updates_or_creates_registered_subject_model_mixin.py
|
UpdatesOrCreatesRegistrationModelMixin.registration_options
|
def registration_options(self):
"""Gathers values for common attributes between the
registration model and this instance.
"""
registration_options = {}
rs = self.registration_model()
for k, v in self.__dict__.items():
if k not in DEFAULT_BASE_FIELDS + ['_state']:
try:
getattr(rs, k)
registration_options.update({k: v})
except AttributeError:
pass
registration_identifier = registration_options.get(
'registration_identifier')
if registration_identifier:
registration_options['registration_identifier'] = self.to_string(
registration_identifier)
return registration_options
|
python
|
def registration_options(self):
"""Gathers values for common attributes between the
registration model and this instance.
"""
registration_options = {}
rs = self.registration_model()
for k, v in self.__dict__.items():
if k not in DEFAULT_BASE_FIELDS + ['_state']:
try:
getattr(rs, k)
registration_options.update({k: v})
except AttributeError:
pass
registration_identifier = registration_options.get(
'registration_identifier')
if registration_identifier:
registration_options['registration_identifier'] = self.to_string(
registration_identifier)
return registration_options
|
[
"def",
"registration_options",
"(",
"self",
")",
":",
"registration_options",
"=",
"{",
"}",
"rs",
"=",
"self",
".",
"registration_model",
"(",
")",
"for",
"k",
",",
"v",
"in",
"self",
".",
"__dict__",
".",
"items",
"(",
")",
":",
"if",
"k",
"not",
"in",
"DEFAULT_BASE_FIELDS",
"+",
"[",
"'_state'",
"]",
":",
"try",
":",
"getattr",
"(",
"rs",
",",
"k",
")",
"registration_options",
".",
"update",
"(",
"{",
"k",
":",
"v",
"}",
")",
"except",
"AttributeError",
":",
"pass",
"registration_identifier",
"=",
"registration_options",
".",
"get",
"(",
"'registration_identifier'",
")",
"if",
"registration_identifier",
":",
"registration_options",
"[",
"'registration_identifier'",
"]",
"=",
"self",
".",
"to_string",
"(",
"registration_identifier",
")",
"return",
"registration_options"
] |
Gathers values for common attributes between the
registration model and this instance.
|
[
"Gathers",
"values",
"for",
"common",
"attributes",
"between",
"the",
"registration",
"model",
"and",
"this",
"instance",
"."
] |
3daca624a496945fd4536488f6f80790bbecc081
|
https://github.com/botswana-harvard/edc-registration/blob/3daca624a496945fd4536488f6f80790bbecc081/edc_registration/model_mixins/updates_or_creates_registered_subject_model_mixin.py#L82-L100
|
239,150
|
lbusoni/pysilico
|
pysilico/gui/image_show_widget/image_show_basic_widget.py
|
ImageShowBasicWidget._getProcessedImage
|
def _getProcessedImage(self):
"""Returns the image data after it has been processed by any normalization options in use.
This method also sets the attributes self.levelMin and self.levelMax
to indicate the range of data in the image."""
if self.imageDisp is None:
self.imageDisp = self.image
self.levelMin, self.levelMax = self._quickLevels(
self.imageDisp)
#list( map(float, self._quickLevels(self.imageDisp)))
return self.imageDisp
|
python
|
def _getProcessedImage(self):
"""Returns the image data after it has been processed by any normalization options in use.
This method also sets the attributes self.levelMin and self.levelMax
to indicate the range of data in the image."""
if self.imageDisp is None:
self.imageDisp = self.image
self.levelMin, self.levelMax = self._quickLevels(
self.imageDisp)
#list( map(float, self._quickLevels(self.imageDisp)))
return self.imageDisp
|
[
"def",
"_getProcessedImage",
"(",
"self",
")",
":",
"if",
"self",
".",
"imageDisp",
"is",
"None",
":",
"self",
".",
"imageDisp",
"=",
"self",
".",
"image",
"self",
".",
"levelMin",
",",
"self",
".",
"levelMax",
"=",
"self",
".",
"_quickLevels",
"(",
"self",
".",
"imageDisp",
")",
"#list( map(float, self._quickLevels(self.imageDisp)))",
"return",
"self",
".",
"imageDisp"
] |
Returns the image data after it has been processed by any normalization options in use.
This method also sets the attributes self.levelMin and self.levelMax
to indicate the range of data in the image.
|
[
"Returns",
"the",
"image",
"data",
"after",
"it",
"has",
"been",
"processed",
"by",
"any",
"normalization",
"options",
"in",
"use",
".",
"This",
"method",
"also",
"sets",
"the",
"attributes",
"self",
".",
"levelMin",
"and",
"self",
".",
"levelMax",
"to",
"indicate",
"the",
"range",
"of",
"data",
"in",
"the",
"image",
"."
] |
44872c8c202bedc8af5d7ac0cd2971912a59a365
|
https://github.com/lbusoni/pysilico/blob/44872c8c202bedc8af5d7ac0cd2971912a59a365/pysilico/gui/image_show_widget/image_show_basic_widget.py#L504-L513
|
239,151
|
lbusoni/pysilico
|
pysilico/gui/image_show_widget/image_show_basic_widget.py
|
ImageShowBasicWidget.close
|
def close(self):
"""Closes the widget nicely, making sure to clear the graphics scene and release memory."""
self.ui.graphicsView.close()
self.scene.clear()
del self.image
del self.imageDisp
super(ImageShowBasicWidget, self).close()
self.setParent(None)
|
python
|
def close(self):
"""Closes the widget nicely, making sure to clear the graphics scene and release memory."""
self.ui.graphicsView.close()
self.scene.clear()
del self.image
del self.imageDisp
super(ImageShowBasicWidget, self).close()
self.setParent(None)
|
[
"def",
"close",
"(",
"self",
")",
":",
"self",
".",
"ui",
".",
"graphicsView",
".",
"close",
"(",
")",
"self",
".",
"scene",
".",
"clear",
"(",
")",
"del",
"self",
".",
"image",
"del",
"self",
".",
"imageDisp",
"super",
"(",
"ImageShowBasicWidget",
",",
"self",
")",
".",
"close",
"(",
")",
"self",
".",
"setParent",
"(",
"None",
")"
] |
Closes the widget nicely, making sure to clear the graphics scene and release memory.
|
[
"Closes",
"the",
"widget",
"nicely",
"making",
"sure",
"to",
"clear",
"the",
"graphics",
"scene",
"and",
"release",
"memory",
"."
] |
44872c8c202bedc8af5d7ac0cd2971912a59a365
|
https://github.com/lbusoni/pysilico/blob/44872c8c202bedc8af5d7ac0cd2971912a59a365/pysilico/gui/image_show_widget/image_show_basic_widget.py#L555-L562
|
239,152
|
JukeboxPipeline/jukebox-core
|
src/jukeboxcore/addons/guerilla/guerillamgmt.py
|
ProjectCreatorDialog.create_prj
|
def create_prj(self, ):
"""Create a project and store it in the self.project
:returns: None
:rtype: None
:raises: None
"""
name = self.name_le.text()
short = self.short_le.text()
path = self.path_le.text()
semester = self.semester_le.text()
try:
prj = djadapter.models.Project(name=name, short=short, path=path, semester=semester)
prj.save()
self.project = prj
self.accept()
except:
log.exception("Could not create new project")
|
python
|
def create_prj(self, ):
"""Create a project and store it in the self.project
:returns: None
:rtype: None
:raises: None
"""
name = self.name_le.text()
short = self.short_le.text()
path = self.path_le.text()
semester = self.semester_le.text()
try:
prj = djadapter.models.Project(name=name, short=short, path=path, semester=semester)
prj.save()
self.project = prj
self.accept()
except:
log.exception("Could not create new project")
|
[
"def",
"create_prj",
"(",
"self",
",",
")",
":",
"name",
"=",
"self",
".",
"name_le",
".",
"text",
"(",
")",
"short",
"=",
"self",
".",
"short_le",
".",
"text",
"(",
")",
"path",
"=",
"self",
".",
"path_le",
".",
"text",
"(",
")",
"semester",
"=",
"self",
".",
"semester_le",
".",
"text",
"(",
")",
"try",
":",
"prj",
"=",
"djadapter",
".",
"models",
".",
"Project",
"(",
"name",
"=",
"name",
",",
"short",
"=",
"short",
",",
"path",
"=",
"path",
",",
"semester",
"=",
"semester",
")",
"prj",
".",
"save",
"(",
")",
"self",
".",
"project",
"=",
"prj",
"self",
".",
"accept",
"(",
")",
"except",
":",
"log",
".",
"exception",
"(",
"\"Could not create new project\"",
")"
] |
Create a project and store it in the self.project
:returns: None
:rtype: None
:raises: None
|
[
"Create",
"a",
"project",
"and",
"store",
"it",
"in",
"the",
"self",
".",
"project"
] |
bac2280ca49940355270e4b69400ce9976ab2e6f
|
https://github.com/JukeboxPipeline/jukebox-core/blob/bac2280ca49940355270e4b69400ce9976ab2e6f/src/jukeboxcore/addons/guerilla/guerillamgmt.py#L46-L63
|
239,153
|
JukeboxPipeline/jukebox-core
|
src/jukeboxcore/addons/guerilla/guerillamgmt.py
|
ProjectAdderDialog.add_project
|
def add_project(self, ):
"""Add a project and store it in the self.projects
:returns: None
:rtype: None
:raises: None
"""
i = self.prj_tablev.currentIndex()
item = i.internalPointer()
if item:
project = item.internal_data()
if self._atype:
self._atype.projects.add(project)
elif self._dep:
self._dep.projects.add(project)
else:
project.users.add(self._user)
self.projects.append(project)
item.set_parent(None)
|
python
|
def add_project(self, ):
"""Add a project and store it in the self.projects
:returns: None
:rtype: None
:raises: None
"""
i = self.prj_tablev.currentIndex()
item = i.internalPointer()
if item:
project = item.internal_data()
if self._atype:
self._atype.projects.add(project)
elif self._dep:
self._dep.projects.add(project)
else:
project.users.add(self._user)
self.projects.append(project)
item.set_parent(None)
|
[
"def",
"add_project",
"(",
"self",
",",
")",
":",
"i",
"=",
"self",
".",
"prj_tablev",
".",
"currentIndex",
"(",
")",
"item",
"=",
"i",
".",
"internalPointer",
"(",
")",
"if",
"item",
":",
"project",
"=",
"item",
".",
"internal_data",
"(",
")",
"if",
"self",
".",
"_atype",
":",
"self",
".",
"_atype",
".",
"projects",
".",
"add",
"(",
"project",
")",
"elif",
"self",
".",
"_dep",
":",
"self",
".",
"_dep",
".",
"projects",
".",
"add",
"(",
"project",
")",
"else",
":",
"project",
".",
"users",
".",
"add",
"(",
"self",
".",
"_user",
")",
"self",
".",
"projects",
".",
"append",
"(",
"project",
")",
"item",
".",
"set_parent",
"(",
"None",
")"
] |
Add a project and store it in the self.projects
:returns: None
:rtype: None
:raises: None
|
[
"Add",
"a",
"project",
"and",
"store",
"it",
"in",
"the",
"self",
".",
"projects"
] |
bac2280ca49940355270e4b69400ce9976ab2e6f
|
https://github.com/JukeboxPipeline/jukebox-core/blob/bac2280ca49940355270e4b69400ce9976ab2e6f/src/jukeboxcore/addons/guerilla/guerillamgmt.py#L108-L126
|
239,154
|
JukeboxPipeline/jukebox-core
|
src/jukeboxcore/addons/guerilla/guerillamgmt.py
|
SequenceCreatorDialog.create_seq
|
def create_seq(self, ):
"""Create a sequence and store it in the self.sequence
:returns: None
:rtype: None
:raises: None
"""
name = self.name_le.text()
desc = self.desc_pte.toPlainText()
try:
seq = djadapter.models.Sequence(name=name, project=self._project, description=desc)
seq.save()
self.sequence = seq
self.accept()
except:
log.exception("Could not create new sequence")
|
python
|
def create_seq(self, ):
"""Create a sequence and store it in the self.sequence
:returns: None
:rtype: None
:raises: None
"""
name = self.name_le.text()
desc = self.desc_pte.toPlainText()
try:
seq = djadapter.models.Sequence(name=name, project=self._project, description=desc)
seq.save()
self.sequence = seq
self.accept()
except:
log.exception("Could not create new sequence")
|
[
"def",
"create_seq",
"(",
"self",
",",
")",
":",
"name",
"=",
"self",
".",
"name_le",
".",
"text",
"(",
")",
"desc",
"=",
"self",
".",
"desc_pte",
".",
"toPlainText",
"(",
")",
"try",
":",
"seq",
"=",
"djadapter",
".",
"models",
".",
"Sequence",
"(",
"name",
"=",
"name",
",",
"project",
"=",
"self",
".",
"_project",
",",
"description",
"=",
"desc",
")",
"seq",
".",
"save",
"(",
")",
"self",
".",
"sequence",
"=",
"seq",
"self",
".",
"accept",
"(",
")",
"except",
":",
"log",
".",
"exception",
"(",
"\"Could not create new sequence\"",
")"
] |
Create a sequence and store it in the self.sequence
:returns: None
:rtype: None
:raises: None
|
[
"Create",
"a",
"sequence",
"and",
"store",
"it",
"in",
"the",
"self",
".",
"sequence"
] |
bac2280ca49940355270e4b69400ce9976ab2e6f
|
https://github.com/JukeboxPipeline/jukebox-core/blob/bac2280ca49940355270e4b69400ce9976ab2e6f/src/jukeboxcore/addons/guerilla/guerillamgmt.py#L150-L165
|
239,155
|
JukeboxPipeline/jukebox-core
|
src/jukeboxcore/addons/guerilla/guerillamgmt.py
|
AtypeCreatorDialog.create_atype
|
def create_atype(self, ):
"""Create a atype and store it in the self.atype
:returns: None
:rtype: None
:raises: None
"""
name = self.name_le.text()
desc = self.desc_pte.toPlainText()
try:
atype = djadapter.models.Atype(name=name, description=desc)
atype.save()
for prj in self.projects:
atype.projects.add(prj)
self.atype = atype
self.accept()
except:
log.exception("Could not create new assettype")
|
python
|
def create_atype(self, ):
"""Create a atype and store it in the self.atype
:returns: None
:rtype: None
:raises: None
"""
name = self.name_le.text()
desc = self.desc_pte.toPlainText()
try:
atype = djadapter.models.Atype(name=name, description=desc)
atype.save()
for prj in self.projects:
atype.projects.add(prj)
self.atype = atype
self.accept()
except:
log.exception("Could not create new assettype")
|
[
"def",
"create_atype",
"(",
"self",
",",
")",
":",
"name",
"=",
"self",
".",
"name_le",
".",
"text",
"(",
")",
"desc",
"=",
"self",
".",
"desc_pte",
".",
"toPlainText",
"(",
")",
"try",
":",
"atype",
"=",
"djadapter",
".",
"models",
".",
"Atype",
"(",
"name",
"=",
"name",
",",
"description",
"=",
"desc",
")",
"atype",
".",
"save",
"(",
")",
"for",
"prj",
"in",
"self",
".",
"projects",
":",
"atype",
".",
"projects",
".",
"add",
"(",
"prj",
")",
"self",
".",
"atype",
"=",
"atype",
"self",
".",
"accept",
"(",
")",
"except",
":",
"log",
".",
"exception",
"(",
"\"Could not create new assettype\"",
")"
] |
Create a atype and store it in the self.atype
:returns: None
:rtype: None
:raises: None
|
[
"Create",
"a",
"atype",
"and",
"store",
"it",
"in",
"the",
"self",
".",
"atype"
] |
bac2280ca49940355270e4b69400ce9976ab2e6f
|
https://github.com/JukeboxPipeline/jukebox-core/blob/bac2280ca49940355270e4b69400ce9976ab2e6f/src/jukeboxcore/addons/guerilla/guerillamgmt.py#L187-L204
|
239,156
|
JukeboxPipeline/jukebox-core
|
src/jukeboxcore/addons/guerilla/guerillamgmt.py
|
AtypeAdderDialog.add_atype
|
def add_atype(self, ):
"""Add a atype and store it in the self.atypes
:returns: None
:rtype: None
:raises: None
"""
i = self.atype_tablev.currentIndex()
item = i.internalPointer()
if item:
atype = item.internal_data()
atype.projects.add(self._project)
self.atypes.append(atype)
item.set_parent(None)
|
python
|
def add_atype(self, ):
"""Add a atype and store it in the self.atypes
:returns: None
:rtype: None
:raises: None
"""
i = self.atype_tablev.currentIndex()
item = i.internalPointer()
if item:
atype = item.internal_data()
atype.projects.add(self._project)
self.atypes.append(atype)
item.set_parent(None)
|
[
"def",
"add_atype",
"(",
"self",
",",
")",
":",
"i",
"=",
"self",
".",
"atype_tablev",
".",
"currentIndex",
"(",
")",
"item",
"=",
"i",
".",
"internalPointer",
"(",
")",
"if",
"item",
":",
"atype",
"=",
"item",
".",
"internal_data",
"(",
")",
"atype",
".",
"projects",
".",
"add",
"(",
"self",
".",
"_project",
")",
"self",
".",
"atypes",
".",
"append",
"(",
"atype",
")",
"item",
".",
"set_parent",
"(",
"None",
")"
] |
Add a atype and store it in the self.atypes
:returns: None
:rtype: None
:raises: None
|
[
"Add",
"a",
"atype",
"and",
"store",
"it",
"in",
"the",
"self",
".",
"atypes"
] |
bac2280ca49940355270e4b69400ce9976ab2e6f
|
https://github.com/JukeboxPipeline/jukebox-core/blob/bac2280ca49940355270e4b69400ce9976ab2e6f/src/jukeboxcore/addons/guerilla/guerillamgmt.py#L237-L250
|
239,157
|
JukeboxPipeline/jukebox-core
|
src/jukeboxcore/addons/guerilla/guerillamgmt.py
|
DepCreatorDialog.create_dep
|
def create_dep(self, ):
"""Create a dep and store it in the self.dep
:returns: None
:rtype: None
:raises: None
"""
name = self.name_le.text()
short = self.short_le.text()
assetflag = self.asset_rb.isChecked()
ordervalue = self.ordervalue_sb.value()
desc = self.desc_pte.toPlainText()
try:
dep = djadapter.models.Department(name=name, short=short, assetflag=assetflag, ordervalue=ordervalue, description=desc)
dep.save()
for prj in self.projects:
dep.projects.add(prj)
self.dep = dep
self.accept()
except:
log.exception("Could not create new department.")
|
python
|
def create_dep(self, ):
"""Create a dep and store it in the self.dep
:returns: None
:rtype: None
:raises: None
"""
name = self.name_le.text()
short = self.short_le.text()
assetflag = self.asset_rb.isChecked()
ordervalue = self.ordervalue_sb.value()
desc = self.desc_pte.toPlainText()
try:
dep = djadapter.models.Department(name=name, short=short, assetflag=assetflag, ordervalue=ordervalue, description=desc)
dep.save()
for prj in self.projects:
dep.projects.add(prj)
self.dep = dep
self.accept()
except:
log.exception("Could not create new department.")
|
[
"def",
"create_dep",
"(",
"self",
",",
")",
":",
"name",
"=",
"self",
".",
"name_le",
".",
"text",
"(",
")",
"short",
"=",
"self",
".",
"short_le",
".",
"text",
"(",
")",
"assetflag",
"=",
"self",
".",
"asset_rb",
".",
"isChecked",
"(",
")",
"ordervalue",
"=",
"self",
".",
"ordervalue_sb",
".",
"value",
"(",
")",
"desc",
"=",
"self",
".",
"desc_pte",
".",
"toPlainText",
"(",
")",
"try",
":",
"dep",
"=",
"djadapter",
".",
"models",
".",
"Department",
"(",
"name",
"=",
"name",
",",
"short",
"=",
"short",
",",
"assetflag",
"=",
"assetflag",
",",
"ordervalue",
"=",
"ordervalue",
",",
"description",
"=",
"desc",
")",
"dep",
".",
"save",
"(",
")",
"for",
"prj",
"in",
"self",
".",
"projects",
":",
"dep",
".",
"projects",
".",
"add",
"(",
"prj",
")",
"self",
".",
"dep",
"=",
"dep",
"self",
".",
"accept",
"(",
")",
"except",
":",
"log",
".",
"exception",
"(",
"\"Could not create new department.\"",
")"
] |
Create a dep and store it in the self.dep
:returns: None
:rtype: None
:raises: None
|
[
"Create",
"a",
"dep",
"and",
"store",
"it",
"in",
"the",
"self",
".",
"dep"
] |
bac2280ca49940355270e4b69400ce9976ab2e6f
|
https://github.com/JukeboxPipeline/jukebox-core/blob/bac2280ca49940355270e4b69400ce9976ab2e6f/src/jukeboxcore/addons/guerilla/guerillamgmt.py#L272-L292
|
239,158
|
JukeboxPipeline/jukebox-core
|
src/jukeboxcore/addons/guerilla/guerillamgmt.py
|
DepAdderDialog.add_dep
|
def add_dep(self, ):
"""Add a dep and store it in the self.deps
:returns: None
:rtype: None
:raises: None
"""
i = self.dep_tablev.currentIndex()
item = i.internalPointer()
if item:
dep = item.internal_data()
dep.projects.add(self._project)
self.deps.append(dep)
item.set_parent(None)
|
python
|
def add_dep(self, ):
"""Add a dep and store it in the self.deps
:returns: None
:rtype: None
:raises: None
"""
i = self.dep_tablev.currentIndex()
item = i.internalPointer()
if item:
dep = item.internal_data()
dep.projects.add(self._project)
self.deps.append(dep)
item.set_parent(None)
|
[
"def",
"add_dep",
"(",
"self",
",",
")",
":",
"i",
"=",
"self",
".",
"dep_tablev",
".",
"currentIndex",
"(",
")",
"item",
"=",
"i",
".",
"internalPointer",
"(",
")",
"if",
"item",
":",
"dep",
"=",
"item",
".",
"internal_data",
"(",
")",
"dep",
".",
"projects",
".",
"add",
"(",
"self",
".",
"_project",
")",
"self",
".",
"deps",
".",
"append",
"(",
"dep",
")",
"item",
".",
"set_parent",
"(",
"None",
")"
] |
Add a dep and store it in the self.deps
:returns: None
:rtype: None
:raises: None
|
[
"Add",
"a",
"dep",
"and",
"store",
"it",
"in",
"the",
"self",
".",
"deps"
] |
bac2280ca49940355270e4b69400ce9976ab2e6f
|
https://github.com/JukeboxPipeline/jukebox-core/blob/bac2280ca49940355270e4b69400ce9976ab2e6f/src/jukeboxcore/addons/guerilla/guerillamgmt.py#L325-L338
|
239,159
|
JukeboxPipeline/jukebox-core
|
src/jukeboxcore/addons/guerilla/guerillamgmt.py
|
UserCreatorDialog.create_user
|
def create_user(self, ):
"""Create a user and store it in the self.user
:returns: None
:rtype: None
:raises: None
"""
name = self.username_le.text()
if not name:
self.username_le.setPlaceholderText("Please provide a username.")
return
first = self.first_le.text()
last = self.last_le.text()
email = self.email_le.text()
try:
user = djadapter.models.User(username=name, first_name=first, last_name=last, email=email)
user.save()
for prj in self.projects:
prj.users.add(user)
for task in self.tasks:
task.users.add(user)
self.user = user
self.accept()
except:
log.exception("Could not create new assettype")
|
python
|
def create_user(self, ):
"""Create a user and store it in the self.user
:returns: None
:rtype: None
:raises: None
"""
name = self.username_le.text()
if not name:
self.username_le.setPlaceholderText("Please provide a username.")
return
first = self.first_le.text()
last = self.last_le.text()
email = self.email_le.text()
try:
user = djadapter.models.User(username=name, first_name=first, last_name=last, email=email)
user.save()
for prj in self.projects:
prj.users.add(user)
for task in self.tasks:
task.users.add(user)
self.user = user
self.accept()
except:
log.exception("Could not create new assettype")
|
[
"def",
"create_user",
"(",
"self",
",",
")",
":",
"name",
"=",
"self",
".",
"username_le",
".",
"text",
"(",
")",
"if",
"not",
"name",
":",
"self",
".",
"username_le",
".",
"setPlaceholderText",
"(",
"\"Please provide a username.\"",
")",
"return",
"first",
"=",
"self",
".",
"first_le",
".",
"text",
"(",
")",
"last",
"=",
"self",
".",
"last_le",
".",
"text",
"(",
")",
"email",
"=",
"self",
".",
"email_le",
".",
"text",
"(",
")",
"try",
":",
"user",
"=",
"djadapter",
".",
"models",
".",
"User",
"(",
"username",
"=",
"name",
",",
"first_name",
"=",
"first",
",",
"last_name",
"=",
"last",
",",
"email",
"=",
"email",
")",
"user",
".",
"save",
"(",
")",
"for",
"prj",
"in",
"self",
".",
"projects",
":",
"prj",
".",
"users",
".",
"add",
"(",
"user",
")",
"for",
"task",
"in",
"self",
".",
"tasks",
":",
"task",
".",
"users",
".",
"add",
"(",
"user",
")",
"self",
".",
"user",
"=",
"user",
"self",
".",
"accept",
"(",
")",
"except",
":",
"log",
".",
"exception",
"(",
"\"Could not create new assettype\"",
")"
] |
Create a user and store it in the self.user
:returns: None
:rtype: None
:raises: None
|
[
"Create",
"a",
"user",
"and",
"store",
"it",
"in",
"the",
"self",
".",
"user"
] |
bac2280ca49940355270e4b69400ce9976ab2e6f
|
https://github.com/JukeboxPipeline/jukebox-core/blob/bac2280ca49940355270e4b69400ce9976ab2e6f/src/jukeboxcore/addons/guerilla/guerillamgmt.py#L365-L389
|
239,160
|
JukeboxPipeline/jukebox-core
|
src/jukeboxcore/addons/guerilla/guerillamgmt.py
|
UserAdderDialog.add_user
|
def add_user(self, ):
"""Add a user and store it in the self.users
:returns: None
:rtype: None
:raises: None
"""
i = self.user_tablev.currentIndex()
item = i.internalPointer()
if item:
user = item.internal_data()
if self._project:
self._project.users.add(user)
else:
self._task.users.add(user)
self.users.append(user)
item.set_parent(None)
|
python
|
def add_user(self, ):
"""Add a user and store it in the self.users
:returns: None
:rtype: None
:raises: None
"""
i = self.user_tablev.currentIndex()
item = i.internalPointer()
if item:
user = item.internal_data()
if self._project:
self._project.users.add(user)
else:
self._task.users.add(user)
self.users.append(user)
item.set_parent(None)
|
[
"def",
"add_user",
"(",
"self",
",",
")",
":",
"i",
"=",
"self",
".",
"user_tablev",
".",
"currentIndex",
"(",
")",
"item",
"=",
"i",
".",
"internalPointer",
"(",
")",
"if",
"item",
":",
"user",
"=",
"item",
".",
"internal_data",
"(",
")",
"if",
"self",
".",
"_project",
":",
"self",
".",
"_project",
".",
"users",
".",
"add",
"(",
"user",
")",
"else",
":",
"self",
".",
"_task",
".",
"users",
".",
"add",
"(",
"user",
")",
"self",
".",
"users",
".",
"append",
"(",
"user",
")",
"item",
".",
"set_parent",
"(",
"None",
")"
] |
Add a user and store it in the self.users
:returns: None
:rtype: None
:raises: None
|
[
"Add",
"a",
"user",
"and",
"store",
"it",
"in",
"the",
"self",
".",
"users"
] |
bac2280ca49940355270e4b69400ce9976ab2e6f
|
https://github.com/JukeboxPipeline/jukebox-core/blob/bac2280ca49940355270e4b69400ce9976ab2e6f/src/jukeboxcore/addons/guerilla/guerillamgmt.py#L428-L444
|
239,161
|
JukeboxPipeline/jukebox-core
|
src/jukeboxcore/addons/guerilla/guerillamgmt.py
|
ShotCreatorDialog.create_shot
|
def create_shot(self, ):
"""Create a shot and store it in the self.shot
:returns: None
:rtype: None
:raises: None
"""
name = self.name_le.text()
if not name:
self.name_le.setPlaceholderText("Please enter a name!")
return
desc = self.desc_pte.toPlainText()
try:
shot = djadapter.models.Shot(sequence=self.sequence, project=self.sequence.project, name=name, description=desc)
shot.save()
self.shot = shot
self.accept()
except:
log.exception("Could not create new shot")
|
python
|
def create_shot(self, ):
"""Create a shot and store it in the self.shot
:returns: None
:rtype: None
:raises: None
"""
name = self.name_le.text()
if not name:
self.name_le.setPlaceholderText("Please enter a name!")
return
desc = self.desc_pte.toPlainText()
try:
shot = djadapter.models.Shot(sequence=self.sequence, project=self.sequence.project, name=name, description=desc)
shot.save()
self.shot = shot
self.accept()
except:
log.exception("Could not create new shot")
|
[
"def",
"create_shot",
"(",
"self",
",",
")",
":",
"name",
"=",
"self",
".",
"name_le",
".",
"text",
"(",
")",
"if",
"not",
"name",
":",
"self",
".",
"name_le",
".",
"setPlaceholderText",
"(",
"\"Please enter a name!\"",
")",
"return",
"desc",
"=",
"self",
".",
"desc_pte",
".",
"toPlainText",
"(",
")",
"try",
":",
"shot",
"=",
"djadapter",
".",
"models",
".",
"Shot",
"(",
"sequence",
"=",
"self",
".",
"sequence",
",",
"project",
"=",
"self",
".",
"sequence",
".",
"project",
",",
"name",
"=",
"name",
",",
"description",
"=",
"desc",
")",
"shot",
".",
"save",
"(",
")",
"self",
".",
"shot",
"=",
"shot",
"self",
".",
"accept",
"(",
")",
"except",
":",
"log",
".",
"exception",
"(",
"\"Could not create new shot\"",
")"
] |
Create a shot and store it in the self.shot
:returns: None
:rtype: None
:raises: None
|
[
"Create",
"a",
"shot",
"and",
"store",
"it",
"in",
"the",
"self",
".",
"shot"
] |
bac2280ca49940355270e4b69400ce9976ab2e6f
|
https://github.com/JukeboxPipeline/jukebox-core/blob/bac2280ca49940355270e4b69400ce9976ab2e6f/src/jukeboxcore/addons/guerilla/guerillamgmt.py#L468-L486
|
239,162
|
JukeboxPipeline/jukebox-core
|
src/jukeboxcore/addons/guerilla/guerillamgmt.py
|
AssetCreatorDialog.create_asset
|
def create_asset(self, ):
"""Create a asset and store it in the self.asset
:returns: None
:rtype: None
:raises: None
"""
name = self.name_le.text()
if not name:
self.name_le.setPlaceholderText("Please enter a name!")
return
desc = self.desc_pte.toPlainText()
if not self.atype:
atypei = self.atype_cb.currentIndex()
assert atypei >= 0
self.atype = self.atypes[atypei]
try:
asset = djadapter.models.Asset(atype=self.atype, project=self.project, name=name, description=desc)
asset.save()
self.asset = asset
self.accept()
except:
log.exception("Could not create new asset")
|
python
|
def create_asset(self, ):
"""Create a asset and store it in the self.asset
:returns: None
:rtype: None
:raises: None
"""
name = self.name_le.text()
if not name:
self.name_le.setPlaceholderText("Please enter a name!")
return
desc = self.desc_pte.toPlainText()
if not self.atype:
atypei = self.atype_cb.currentIndex()
assert atypei >= 0
self.atype = self.atypes[atypei]
try:
asset = djadapter.models.Asset(atype=self.atype, project=self.project, name=name, description=desc)
asset.save()
self.asset = asset
self.accept()
except:
log.exception("Could not create new asset")
|
[
"def",
"create_asset",
"(",
"self",
",",
")",
":",
"name",
"=",
"self",
".",
"name_le",
".",
"text",
"(",
")",
"if",
"not",
"name",
":",
"self",
".",
"name_le",
".",
"setPlaceholderText",
"(",
"\"Please enter a name!\"",
")",
"return",
"desc",
"=",
"self",
".",
"desc_pte",
".",
"toPlainText",
"(",
")",
"if",
"not",
"self",
".",
"atype",
":",
"atypei",
"=",
"self",
".",
"atype_cb",
".",
"currentIndex",
"(",
")",
"assert",
"atypei",
">=",
"0",
"self",
".",
"atype",
"=",
"self",
".",
"atypes",
"[",
"atypei",
"]",
"try",
":",
"asset",
"=",
"djadapter",
".",
"models",
".",
"Asset",
"(",
"atype",
"=",
"self",
".",
"atype",
",",
"project",
"=",
"self",
".",
"project",
",",
"name",
"=",
"name",
",",
"description",
"=",
"desc",
")",
"asset",
".",
"save",
"(",
")",
"self",
".",
"asset",
"=",
"asset",
"self",
".",
"accept",
"(",
")",
"except",
":",
"log",
".",
"exception",
"(",
"\"Could not create new asset\"",
")"
] |
Create a asset and store it in the self.asset
:returns: None
:rtype: None
:raises: None
|
[
"Create",
"a",
"asset",
"and",
"store",
"it",
"in",
"the",
"self",
".",
"asset"
] |
bac2280ca49940355270e4b69400ce9976ab2e6f
|
https://github.com/JukeboxPipeline/jukebox-core/blob/bac2280ca49940355270e4b69400ce9976ab2e6f/src/jukeboxcore/addons/guerilla/guerillamgmt.py#L524-L546
|
239,163
|
JukeboxPipeline/jukebox-core
|
src/jukeboxcore/addons/guerilla/guerillamgmt.py
|
AssetAdderDialog.add_asset
|
def add_asset(self, ):
"""Add a asset and store it in the self.assets
:returns: None
:rtype: None
:raises: None
"""
i = self.asset_treev.currentIndex()
item = i.internalPointer()
if item:
asset = item.internal_data()
if not isinstance(asset, djadapter.models.Asset):
return
if self._shot:
self._shot.assets.add(asset)
else:
self._asset.assets.add(asset)
self.assets.append(asset)
item.set_parent(None)
|
python
|
def add_asset(self, ):
"""Add a asset and store it in the self.assets
:returns: None
:rtype: None
:raises: None
"""
i = self.asset_treev.currentIndex()
item = i.internalPointer()
if item:
asset = item.internal_data()
if not isinstance(asset, djadapter.models.Asset):
return
if self._shot:
self._shot.assets.add(asset)
else:
self._asset.assets.add(asset)
self.assets.append(asset)
item.set_parent(None)
|
[
"def",
"add_asset",
"(",
"self",
",",
")",
":",
"i",
"=",
"self",
".",
"asset_treev",
".",
"currentIndex",
"(",
")",
"item",
"=",
"i",
".",
"internalPointer",
"(",
")",
"if",
"item",
":",
"asset",
"=",
"item",
".",
"internal_data",
"(",
")",
"if",
"not",
"isinstance",
"(",
"asset",
",",
"djadapter",
".",
"models",
".",
"Asset",
")",
":",
"return",
"if",
"self",
".",
"_shot",
":",
"self",
".",
"_shot",
".",
"assets",
".",
"add",
"(",
"asset",
")",
"else",
":",
"self",
".",
"_asset",
".",
"assets",
".",
"add",
"(",
"asset",
")",
"self",
".",
"assets",
".",
"append",
"(",
"asset",
")",
"item",
".",
"set_parent",
"(",
"None",
")"
] |
Add a asset and store it in the self.assets
:returns: None
:rtype: None
:raises: None
|
[
"Add",
"a",
"asset",
"and",
"store",
"it",
"in",
"the",
"self",
".",
"assets"
] |
bac2280ca49940355270e4b69400ce9976ab2e6f
|
https://github.com/JukeboxPipeline/jukebox-core/blob/bac2280ca49940355270e4b69400ce9976ab2e6f/src/jukeboxcore/addons/guerilla/guerillamgmt.py#L592-L610
|
239,164
|
JukeboxPipeline/jukebox-core
|
src/jukeboxcore/addons/guerilla/guerillamgmt.py
|
TaskCreatorDialog.create_task
|
def create_task(self, ):
"""Create a task and store it in the self.task
:returns: None
:rtype: None
:raises: None
"""
depi = self.dep_cb.currentIndex()
assert depi >= 0
dep = self.deps[depi]
deadline = self.deadline_de.dateTime().toPython()
try:
task = djadapter.models.Task(department=dep, project=self.element.project, element=self.element, deadline=deadline)
task.save()
self.task = task
self.accept()
except:
log.exception("Could not create new task")
|
python
|
def create_task(self, ):
"""Create a task and store it in the self.task
:returns: None
:rtype: None
:raises: None
"""
depi = self.dep_cb.currentIndex()
assert depi >= 0
dep = self.deps[depi]
deadline = self.deadline_de.dateTime().toPython()
try:
task = djadapter.models.Task(department=dep, project=self.element.project, element=self.element, deadline=deadline)
task.save()
self.task = task
self.accept()
except:
log.exception("Could not create new task")
|
[
"def",
"create_task",
"(",
"self",
",",
")",
":",
"depi",
"=",
"self",
".",
"dep_cb",
".",
"currentIndex",
"(",
")",
"assert",
"depi",
">=",
"0",
"dep",
"=",
"self",
".",
"deps",
"[",
"depi",
"]",
"deadline",
"=",
"self",
".",
"deadline_de",
".",
"dateTime",
"(",
")",
".",
"toPython",
"(",
")",
"try",
":",
"task",
"=",
"djadapter",
".",
"models",
".",
"Task",
"(",
"department",
"=",
"dep",
",",
"project",
"=",
"self",
".",
"element",
".",
"project",
",",
"element",
"=",
"self",
".",
"element",
",",
"deadline",
"=",
"deadline",
")",
"task",
".",
"save",
"(",
")",
"self",
".",
"task",
"=",
"task",
"self",
".",
"accept",
"(",
")",
"except",
":",
"log",
".",
"exception",
"(",
"\"Could not create new task\"",
")"
] |
Create a task and store it in the self.task
:returns: None
:rtype: None
:raises: None
|
[
"Create",
"a",
"task",
"and",
"store",
"it",
"in",
"the",
"self",
".",
"task"
] |
bac2280ca49940355270e4b69400ce9976ab2e6f
|
https://github.com/JukeboxPipeline/jukebox-core/blob/bac2280ca49940355270e4b69400ce9976ab2e6f/src/jukeboxcore/addons/guerilla/guerillamgmt.py#L646-L663
|
239,165
|
JukeboxPipeline/jukebox-core
|
src/jukeboxcore/addons/guerilla/guerillamgmt.py
|
GuerillaMGMTWin.setup_ui
|
def setup_ui(self, ):
"""Create all necessary ui elements for the tool
:returns: None
:rtype: None
:raises: None
"""
log.debug("Setting up the ui")
self.setup_prjs_page()
self.setup_prj_page()
self.setup_seq_page()
self.setup_shot_page()
self.setup_atype_page()
self.setup_asset_page()
self.setup_dep_page()
self.setup_task_page()
self.setup_users_page()
self.setup_user_page()
|
python
|
def setup_ui(self, ):
"""Create all necessary ui elements for the tool
:returns: None
:rtype: None
:raises: None
"""
log.debug("Setting up the ui")
self.setup_prjs_page()
self.setup_prj_page()
self.setup_seq_page()
self.setup_shot_page()
self.setup_atype_page()
self.setup_asset_page()
self.setup_dep_page()
self.setup_task_page()
self.setup_users_page()
self.setup_user_page()
|
[
"def",
"setup_ui",
"(",
"self",
",",
")",
":",
"log",
".",
"debug",
"(",
"\"Setting up the ui\"",
")",
"self",
".",
"setup_prjs_page",
"(",
")",
"self",
".",
"setup_prj_page",
"(",
")",
"self",
".",
"setup_seq_page",
"(",
")",
"self",
".",
"setup_shot_page",
"(",
")",
"self",
".",
"setup_atype_page",
"(",
")",
"self",
".",
"setup_asset_page",
"(",
")",
"self",
".",
"setup_dep_page",
"(",
")",
"self",
".",
"setup_task_page",
"(",
")",
"self",
".",
"setup_users_page",
"(",
")",
"self",
".",
"setup_user_page",
"(",
")"
] |
Create all necessary ui elements for the tool
:returns: None
:rtype: None
:raises: None
|
[
"Create",
"all",
"necessary",
"ui",
"elements",
"for",
"the",
"tool"
] |
bac2280ca49940355270e4b69400ce9976ab2e6f
|
https://github.com/JukeboxPipeline/jukebox-core/blob/bac2280ca49940355270e4b69400ce9976ab2e6f/src/jukeboxcore/addons/guerilla/guerillamgmt.py#L696-L713
|
239,166
|
JukeboxPipeline/jukebox-core
|
src/jukeboxcore/addons/guerilla/guerillamgmt.py
|
GuerillaMGMTWin.setup_prjs_page
|
def setup_prjs_page(self, ):
"""Create and set the model on the projects page
:returns: None
:rtype: None
:raises: None
"""
self.prjs_tablev.horizontalHeader().setResizeMode(QtGui.QHeaderView.ResizeToContents)
log.debug("Loading projects for projects page.")
rootdata = treemodel.ListItemData(['Name', 'Short', 'Path', 'Created', 'Semester', 'Status', 'Resolution', 'FPS', 'Scale'])
rootitem = treemodel.TreeItem(rootdata)
prjs = djadapter.projects.all()
for prj in prjs:
prjdata = djitemdata.ProjectItemData(prj)
treemodel.TreeItem(prjdata, rootitem)
self.prjs_model = treemodel.TreeModel(rootitem)
self.prjs_tablev.setModel(self.prjs_model)
|
python
|
def setup_prjs_page(self, ):
"""Create and set the model on the projects page
:returns: None
:rtype: None
:raises: None
"""
self.prjs_tablev.horizontalHeader().setResizeMode(QtGui.QHeaderView.ResizeToContents)
log.debug("Loading projects for projects page.")
rootdata = treemodel.ListItemData(['Name', 'Short', 'Path', 'Created', 'Semester', 'Status', 'Resolution', 'FPS', 'Scale'])
rootitem = treemodel.TreeItem(rootdata)
prjs = djadapter.projects.all()
for prj in prjs:
prjdata = djitemdata.ProjectItemData(prj)
treemodel.TreeItem(prjdata, rootitem)
self.prjs_model = treemodel.TreeModel(rootitem)
self.prjs_tablev.setModel(self.prjs_model)
|
[
"def",
"setup_prjs_page",
"(",
"self",
",",
")",
":",
"self",
".",
"prjs_tablev",
".",
"horizontalHeader",
"(",
")",
".",
"setResizeMode",
"(",
"QtGui",
".",
"QHeaderView",
".",
"ResizeToContents",
")",
"log",
".",
"debug",
"(",
"\"Loading projects for projects page.\"",
")",
"rootdata",
"=",
"treemodel",
".",
"ListItemData",
"(",
"[",
"'Name'",
",",
"'Short'",
",",
"'Path'",
",",
"'Created'",
",",
"'Semester'",
",",
"'Status'",
",",
"'Resolution'",
",",
"'FPS'",
",",
"'Scale'",
"]",
")",
"rootitem",
"=",
"treemodel",
".",
"TreeItem",
"(",
"rootdata",
")",
"prjs",
"=",
"djadapter",
".",
"projects",
".",
"all",
"(",
")",
"for",
"prj",
"in",
"prjs",
":",
"prjdata",
"=",
"djitemdata",
".",
"ProjectItemData",
"(",
"prj",
")",
"treemodel",
".",
"TreeItem",
"(",
"prjdata",
",",
"rootitem",
")",
"self",
".",
"prjs_model",
"=",
"treemodel",
".",
"TreeModel",
"(",
"rootitem",
")",
"self",
".",
"prjs_tablev",
".",
"setModel",
"(",
"self",
".",
"prjs_model",
")"
] |
Create and set the model on the projects page
:returns: None
:rtype: None
:raises: None
|
[
"Create",
"and",
"set",
"the",
"model",
"on",
"the",
"projects",
"page"
] |
bac2280ca49940355270e4b69400ce9976ab2e6f
|
https://github.com/JukeboxPipeline/jukebox-core/blob/bac2280ca49940355270e4b69400ce9976ab2e6f/src/jukeboxcore/addons/guerilla/guerillamgmt.py#L715-L731
|
239,167
|
JukeboxPipeline/jukebox-core
|
src/jukeboxcore/addons/guerilla/guerillamgmt.py
|
GuerillaMGMTWin.setup_prj_page
|
def setup_prj_page(self, ):
"""Create and set the model on the project page
:returns: None
:rtype: None
:raises: None
"""
self.prj_seq_tablev.horizontalHeader().setResizeMode(QtGui.QHeaderView.ResizeToContents)
self.prj_atype_tablev.horizontalHeader().setResizeMode(QtGui.QHeaderView.ResizeToContents)
self.prj_dep_tablev.horizontalHeader().setResizeMode(QtGui.QHeaderView.ResizeToContents)
self.prj_user_tablev.horizontalHeader().setResizeMode(QtGui.QHeaderView.ResizeToContents)
|
python
|
def setup_prj_page(self, ):
"""Create and set the model on the project page
:returns: None
:rtype: None
:raises: None
"""
self.prj_seq_tablev.horizontalHeader().setResizeMode(QtGui.QHeaderView.ResizeToContents)
self.prj_atype_tablev.horizontalHeader().setResizeMode(QtGui.QHeaderView.ResizeToContents)
self.prj_dep_tablev.horizontalHeader().setResizeMode(QtGui.QHeaderView.ResizeToContents)
self.prj_user_tablev.horizontalHeader().setResizeMode(QtGui.QHeaderView.ResizeToContents)
|
[
"def",
"setup_prj_page",
"(",
"self",
",",
")",
":",
"self",
".",
"prj_seq_tablev",
".",
"horizontalHeader",
"(",
")",
".",
"setResizeMode",
"(",
"QtGui",
".",
"QHeaderView",
".",
"ResizeToContents",
")",
"self",
".",
"prj_atype_tablev",
".",
"horizontalHeader",
"(",
")",
".",
"setResizeMode",
"(",
"QtGui",
".",
"QHeaderView",
".",
"ResizeToContents",
")",
"self",
".",
"prj_dep_tablev",
".",
"horizontalHeader",
"(",
")",
".",
"setResizeMode",
"(",
"QtGui",
".",
"QHeaderView",
".",
"ResizeToContents",
")",
"self",
".",
"prj_user_tablev",
".",
"horizontalHeader",
"(",
")",
".",
"setResizeMode",
"(",
"QtGui",
".",
"QHeaderView",
".",
"ResizeToContents",
")"
] |
Create and set the model on the project page
:returns: None
:rtype: None
:raises: None
|
[
"Create",
"and",
"set",
"the",
"model",
"on",
"the",
"project",
"page"
] |
bac2280ca49940355270e4b69400ce9976ab2e6f
|
https://github.com/JukeboxPipeline/jukebox-core/blob/bac2280ca49940355270e4b69400ce9976ab2e6f/src/jukeboxcore/addons/guerilla/guerillamgmt.py#L733-L743
|
239,168
|
JukeboxPipeline/jukebox-core
|
src/jukeboxcore/addons/guerilla/guerillamgmt.py
|
GuerillaMGMTWin.setup_shot_page
|
def setup_shot_page(self, ):
"""Create and set the model on the shot page
:returns: None
:rtype: None
:raises: None
"""
self.shot_asset_treev.header().setResizeMode(QtGui.QHeaderView.ResizeToContents)
self.shot_task_tablev.horizontalHeader().setResizeMode(QtGui.QHeaderView.ResizeToContents)
|
python
|
def setup_shot_page(self, ):
"""Create and set the model on the shot page
:returns: None
:rtype: None
:raises: None
"""
self.shot_asset_treev.header().setResizeMode(QtGui.QHeaderView.ResizeToContents)
self.shot_task_tablev.horizontalHeader().setResizeMode(QtGui.QHeaderView.ResizeToContents)
|
[
"def",
"setup_shot_page",
"(",
"self",
",",
")",
":",
"self",
".",
"shot_asset_treev",
".",
"header",
"(",
")",
".",
"setResizeMode",
"(",
"QtGui",
".",
"QHeaderView",
".",
"ResizeToContents",
")",
"self",
".",
"shot_task_tablev",
".",
"horizontalHeader",
"(",
")",
".",
"setResizeMode",
"(",
"QtGui",
".",
"QHeaderView",
".",
"ResizeToContents",
")"
] |
Create and set the model on the shot page
:returns: None
:rtype: None
:raises: None
|
[
"Create",
"and",
"set",
"the",
"model",
"on",
"the",
"shot",
"page"
] |
bac2280ca49940355270e4b69400ce9976ab2e6f
|
https://github.com/JukeboxPipeline/jukebox-core/blob/bac2280ca49940355270e4b69400ce9976ab2e6f/src/jukeboxcore/addons/guerilla/guerillamgmt.py#L754-L762
|
239,169
|
JukeboxPipeline/jukebox-core
|
src/jukeboxcore/addons/guerilla/guerillamgmt.py
|
GuerillaMGMTWin.setup_asset_page
|
def setup_asset_page(self, ):
"""Create and set the model on the asset page
:returns: None
:rtype: None
:raises: None
"""
self.asset_asset_treev.header().setResizeMode(QtGui.QHeaderView.ResizeToContents)
self.asset_task_tablev.horizontalHeader().setResizeMode(QtGui.QHeaderView.ResizeToContents)
|
python
|
def setup_asset_page(self, ):
"""Create and set the model on the asset page
:returns: None
:rtype: None
:raises: None
"""
self.asset_asset_treev.header().setResizeMode(QtGui.QHeaderView.ResizeToContents)
self.asset_task_tablev.horizontalHeader().setResizeMode(QtGui.QHeaderView.ResizeToContents)
|
[
"def",
"setup_asset_page",
"(",
"self",
",",
")",
":",
"self",
".",
"asset_asset_treev",
".",
"header",
"(",
")",
".",
"setResizeMode",
"(",
"QtGui",
".",
"QHeaderView",
".",
"ResizeToContents",
")",
"self",
".",
"asset_task_tablev",
".",
"horizontalHeader",
"(",
")",
".",
"setResizeMode",
"(",
"QtGui",
".",
"QHeaderView",
".",
"ResizeToContents",
")"
] |
Create and set the model on the asset page
:returns: None
:rtype: None
:raises: None
|
[
"Create",
"and",
"set",
"the",
"model",
"on",
"the",
"asset",
"page"
] |
bac2280ca49940355270e4b69400ce9976ab2e6f
|
https://github.com/JukeboxPipeline/jukebox-core/blob/bac2280ca49940355270e4b69400ce9976ab2e6f/src/jukeboxcore/addons/guerilla/guerillamgmt.py#L773-L781
|
239,170
|
JukeboxPipeline/jukebox-core
|
src/jukeboxcore/addons/guerilla/guerillamgmt.py
|
GuerillaMGMTWin.setup_users_page
|
def setup_users_page(self, ):
"""Create and set the model on the users page
:returns: None
:rtype: None
:raises: None
"""
self.users_tablev.horizontalHeader().setResizeMode(QtGui.QHeaderView.ResizeToContents)
log.debug("Loading users for users page.")
rootdata = treemodel.ListItemData(['Username', 'First', 'Last', 'Email'])
rootitem = treemodel.TreeItem(rootdata)
users = djadapter.users.all()
for usr in users:
usrdata = djitemdata.UserItemData(usr)
treemodel.TreeItem(usrdata, rootitem)
self.users_model = treemodel.TreeModel(rootitem)
self.users_tablev.setModel(self.users_model)
|
python
|
def setup_users_page(self, ):
"""Create and set the model on the users page
:returns: None
:rtype: None
:raises: None
"""
self.users_tablev.horizontalHeader().setResizeMode(QtGui.QHeaderView.ResizeToContents)
log.debug("Loading users for users page.")
rootdata = treemodel.ListItemData(['Username', 'First', 'Last', 'Email'])
rootitem = treemodel.TreeItem(rootdata)
users = djadapter.users.all()
for usr in users:
usrdata = djitemdata.UserItemData(usr)
treemodel.TreeItem(usrdata, rootitem)
self.users_model = treemodel.TreeModel(rootitem)
self.users_tablev.setModel(self.users_model)
|
[
"def",
"setup_users_page",
"(",
"self",
",",
")",
":",
"self",
".",
"users_tablev",
".",
"horizontalHeader",
"(",
")",
".",
"setResizeMode",
"(",
"QtGui",
".",
"QHeaderView",
".",
"ResizeToContents",
")",
"log",
".",
"debug",
"(",
"\"Loading users for users page.\"",
")",
"rootdata",
"=",
"treemodel",
".",
"ListItemData",
"(",
"[",
"'Username'",
",",
"'First'",
",",
"'Last'",
",",
"'Email'",
"]",
")",
"rootitem",
"=",
"treemodel",
".",
"TreeItem",
"(",
"rootdata",
")",
"users",
"=",
"djadapter",
".",
"users",
".",
"all",
"(",
")",
"for",
"usr",
"in",
"users",
":",
"usrdata",
"=",
"djitemdata",
".",
"UserItemData",
"(",
"usr",
")",
"treemodel",
".",
"TreeItem",
"(",
"usrdata",
",",
"rootitem",
")",
"self",
".",
"users_model",
"=",
"treemodel",
".",
"TreeModel",
"(",
"rootitem",
")",
"self",
".",
"users_tablev",
".",
"setModel",
"(",
"self",
".",
"users_model",
")"
] |
Create and set the model on the users page
:returns: None
:rtype: None
:raises: None
|
[
"Create",
"and",
"set",
"the",
"model",
"on",
"the",
"users",
"page"
] |
bac2280ca49940355270e4b69400ce9976ab2e6f
|
https://github.com/JukeboxPipeline/jukebox-core/blob/bac2280ca49940355270e4b69400ce9976ab2e6f/src/jukeboxcore/addons/guerilla/guerillamgmt.py#L801-L817
|
239,171
|
JukeboxPipeline/jukebox-core
|
src/jukeboxcore/addons/guerilla/guerillamgmt.py
|
GuerillaMGMTWin.setup_user_page
|
def setup_user_page(self, ):
"""Create and set the model on the user page
:returns: None
:rtype: None
:raises: None
"""
self.user_prj_tablev.horizontalHeader().setResizeMode(QtGui.QHeaderView.ResizeToContents)
self.user_task_treev.header().setResizeMode(QtGui.QHeaderView.ResizeToContents)
|
python
|
def setup_user_page(self, ):
"""Create and set the model on the user page
:returns: None
:rtype: None
:raises: None
"""
self.user_prj_tablev.horizontalHeader().setResizeMode(QtGui.QHeaderView.ResizeToContents)
self.user_task_treev.header().setResizeMode(QtGui.QHeaderView.ResizeToContents)
|
[
"def",
"setup_user_page",
"(",
"self",
",",
")",
":",
"self",
".",
"user_prj_tablev",
".",
"horizontalHeader",
"(",
")",
".",
"setResizeMode",
"(",
"QtGui",
".",
"QHeaderView",
".",
"ResizeToContents",
")",
"self",
".",
"user_task_treev",
".",
"header",
"(",
")",
".",
"setResizeMode",
"(",
"QtGui",
".",
"QHeaderView",
".",
"ResizeToContents",
")"
] |
Create and set the model on the user page
:returns: None
:rtype: None
:raises: None
|
[
"Create",
"and",
"set",
"the",
"model",
"on",
"the",
"user",
"page"
] |
bac2280ca49940355270e4b69400ce9976ab2e6f
|
https://github.com/JukeboxPipeline/jukebox-core/blob/bac2280ca49940355270e4b69400ce9976ab2e6f/src/jukeboxcore/addons/guerilla/guerillamgmt.py#L819-L827
|
239,172
|
JukeboxPipeline/jukebox-core
|
src/jukeboxcore/addons/guerilla/guerillamgmt.py
|
GuerillaMGMTWin.setup_prjs_signals
|
def setup_prjs_signals(self, ):
"""Setup the signals for the projects page
:returns: None
:rtype: None
:raises: None
"""
log.debug("Setting up projects page signals.")
self.prjs_prj_view_pb.clicked.connect(self.prjs_view_prj)
self.prjs_prj_create_pb.clicked.connect(self.prjs_create_prj)
|
python
|
def setup_prjs_signals(self, ):
"""Setup the signals for the projects page
:returns: None
:rtype: None
:raises: None
"""
log.debug("Setting up projects page signals.")
self.prjs_prj_view_pb.clicked.connect(self.prjs_view_prj)
self.prjs_prj_create_pb.clicked.connect(self.prjs_create_prj)
|
[
"def",
"setup_prjs_signals",
"(",
"self",
",",
")",
":",
"log",
".",
"debug",
"(",
"\"Setting up projects page signals.\"",
")",
"self",
".",
"prjs_prj_view_pb",
".",
"clicked",
".",
"connect",
"(",
"self",
".",
"prjs_view_prj",
")",
"self",
".",
"prjs_prj_create_pb",
".",
"clicked",
".",
"connect",
"(",
"self",
".",
"prjs_create_prj",
")"
] |
Setup the signals for the projects page
:returns: None
:rtype: None
:raises: None
|
[
"Setup",
"the",
"signals",
"for",
"the",
"projects",
"page"
] |
bac2280ca49940355270e4b69400ce9976ab2e6f
|
https://github.com/JukeboxPipeline/jukebox-core/blob/bac2280ca49940355270e4b69400ce9976ab2e6f/src/jukeboxcore/addons/guerilla/guerillamgmt.py#L849-L858
|
239,173
|
JukeboxPipeline/jukebox-core
|
src/jukeboxcore/addons/guerilla/guerillamgmt.py
|
GuerillaMGMTWin.setup_prj_signals
|
def setup_prj_signals(self, ):
"""Setup the signals for the project page
:returns: None
:rtype: None
:raises: None
"""
log.debug("Setting up project page signals.")
self.prj_seq_view_pb.clicked.connect(self.prj_view_seq)
self.prj_seq_create_pb.clicked.connect(self.prj_create_seq)
self.prj_atype_view_pb.clicked.connect(self.prj_view_atype)
self.prj_atype_add_pb.clicked.connect(self.prj_add_atype)
self.prj_atype_create_pb.clicked.connect(self.prj_create_atype)
self.prj_dep_view_pb.clicked.connect(self.prj_view_dep)
self.prj_dep_add_pb.clicked.connect(self.prj_add_dep)
self.prj_dep_create_pb.clicked.connect(self.prj_create_dep)
self.prj_user_view_pb.clicked.connect(self.prj_view_user)
self.prj_user_add_pb.clicked.connect(self.prj_add_user)
self.prj_user_remove_pb.clicked.connect(self.prj_remove_user)
self.prj_user_create_pb.clicked.connect(self.prj_create_user)
self.prj_path_view_pb.clicked.connect(self.prj_show_path)
self.prj_desc_pte.textChanged.connect(self.prj_save)
self.prj_semester_le.editingFinished.connect(self.prj_save)
self.prj_fps_dsb.valueChanged.connect(self.prj_save)
self.prj_res_x_sb.valueChanged.connect(self.prj_save)
self.prj_res_y_sb.valueChanged.connect(self.prj_save)
self.prj_scale_cb.currentIndexChanged.connect(self.prj_save)
|
python
|
def setup_prj_signals(self, ):
"""Setup the signals for the project page
:returns: None
:rtype: None
:raises: None
"""
log.debug("Setting up project page signals.")
self.prj_seq_view_pb.clicked.connect(self.prj_view_seq)
self.prj_seq_create_pb.clicked.connect(self.prj_create_seq)
self.prj_atype_view_pb.clicked.connect(self.prj_view_atype)
self.prj_atype_add_pb.clicked.connect(self.prj_add_atype)
self.prj_atype_create_pb.clicked.connect(self.prj_create_atype)
self.prj_dep_view_pb.clicked.connect(self.prj_view_dep)
self.prj_dep_add_pb.clicked.connect(self.prj_add_dep)
self.prj_dep_create_pb.clicked.connect(self.prj_create_dep)
self.prj_user_view_pb.clicked.connect(self.prj_view_user)
self.prj_user_add_pb.clicked.connect(self.prj_add_user)
self.prj_user_remove_pb.clicked.connect(self.prj_remove_user)
self.prj_user_create_pb.clicked.connect(self.prj_create_user)
self.prj_path_view_pb.clicked.connect(self.prj_show_path)
self.prj_desc_pte.textChanged.connect(self.prj_save)
self.prj_semester_le.editingFinished.connect(self.prj_save)
self.prj_fps_dsb.valueChanged.connect(self.prj_save)
self.prj_res_x_sb.valueChanged.connect(self.prj_save)
self.prj_res_y_sb.valueChanged.connect(self.prj_save)
self.prj_scale_cb.currentIndexChanged.connect(self.prj_save)
|
[
"def",
"setup_prj_signals",
"(",
"self",
",",
")",
":",
"log",
".",
"debug",
"(",
"\"Setting up project page signals.\"",
")",
"self",
".",
"prj_seq_view_pb",
".",
"clicked",
".",
"connect",
"(",
"self",
".",
"prj_view_seq",
")",
"self",
".",
"prj_seq_create_pb",
".",
"clicked",
".",
"connect",
"(",
"self",
".",
"prj_create_seq",
")",
"self",
".",
"prj_atype_view_pb",
".",
"clicked",
".",
"connect",
"(",
"self",
".",
"prj_view_atype",
")",
"self",
".",
"prj_atype_add_pb",
".",
"clicked",
".",
"connect",
"(",
"self",
".",
"prj_add_atype",
")",
"self",
".",
"prj_atype_create_pb",
".",
"clicked",
".",
"connect",
"(",
"self",
".",
"prj_create_atype",
")",
"self",
".",
"prj_dep_view_pb",
".",
"clicked",
".",
"connect",
"(",
"self",
".",
"prj_view_dep",
")",
"self",
".",
"prj_dep_add_pb",
".",
"clicked",
".",
"connect",
"(",
"self",
".",
"prj_add_dep",
")",
"self",
".",
"prj_dep_create_pb",
".",
"clicked",
".",
"connect",
"(",
"self",
".",
"prj_create_dep",
")",
"self",
".",
"prj_user_view_pb",
".",
"clicked",
".",
"connect",
"(",
"self",
".",
"prj_view_user",
")",
"self",
".",
"prj_user_add_pb",
".",
"clicked",
".",
"connect",
"(",
"self",
".",
"prj_add_user",
")",
"self",
".",
"prj_user_remove_pb",
".",
"clicked",
".",
"connect",
"(",
"self",
".",
"prj_remove_user",
")",
"self",
".",
"prj_user_create_pb",
".",
"clicked",
".",
"connect",
"(",
"self",
".",
"prj_create_user",
")",
"self",
".",
"prj_path_view_pb",
".",
"clicked",
".",
"connect",
"(",
"self",
".",
"prj_show_path",
")",
"self",
".",
"prj_desc_pte",
".",
"textChanged",
".",
"connect",
"(",
"self",
".",
"prj_save",
")",
"self",
".",
"prj_semester_le",
".",
"editingFinished",
".",
"connect",
"(",
"self",
".",
"prj_save",
")",
"self",
".",
"prj_fps_dsb",
".",
"valueChanged",
".",
"connect",
"(",
"self",
".",
"prj_save",
")",
"self",
".",
"prj_res_x_sb",
".",
"valueChanged",
".",
"connect",
"(",
"self",
".",
"prj_save",
")",
"self",
".",
"prj_res_y_sb",
".",
"valueChanged",
".",
"connect",
"(",
"self",
".",
"prj_save",
")",
"self",
".",
"prj_scale_cb",
".",
"currentIndexChanged",
".",
"connect",
"(",
"self",
".",
"prj_save",
")"
] |
Setup the signals for the project page
:returns: None
:rtype: None
:raises: None
|
[
"Setup",
"the",
"signals",
"for",
"the",
"project",
"page"
] |
bac2280ca49940355270e4b69400ce9976ab2e6f
|
https://github.com/JukeboxPipeline/jukebox-core/blob/bac2280ca49940355270e4b69400ce9976ab2e6f/src/jukeboxcore/addons/guerilla/guerillamgmt.py#L860-L886
|
239,174
|
JukeboxPipeline/jukebox-core
|
src/jukeboxcore/addons/guerilla/guerillamgmt.py
|
GuerillaMGMTWin.setup_seq_signals
|
def setup_seq_signals(self, ):
"""Setup the signals for the sequence page
:returns: None
:rtype: None
:raises: None
"""
log.debug("Setting up sequence page signals.")
self.seq_prj_view_pb.clicked.connect(self.seq_view_prj)
self.seq_shot_view_pb.clicked.connect(self.seq_view_shot)
self.seq_shot_create_pb.clicked.connect(self.seq_create_shot)
self.seq_desc_pte.textChanged.connect(self.seq_save)
|
python
|
def setup_seq_signals(self, ):
"""Setup the signals for the sequence page
:returns: None
:rtype: None
:raises: None
"""
log.debug("Setting up sequence page signals.")
self.seq_prj_view_pb.clicked.connect(self.seq_view_prj)
self.seq_shot_view_pb.clicked.connect(self.seq_view_shot)
self.seq_shot_create_pb.clicked.connect(self.seq_create_shot)
self.seq_desc_pte.textChanged.connect(self.seq_save)
|
[
"def",
"setup_seq_signals",
"(",
"self",
",",
")",
":",
"log",
".",
"debug",
"(",
"\"Setting up sequence page signals.\"",
")",
"self",
".",
"seq_prj_view_pb",
".",
"clicked",
".",
"connect",
"(",
"self",
".",
"seq_view_prj",
")",
"self",
".",
"seq_shot_view_pb",
".",
"clicked",
".",
"connect",
"(",
"self",
".",
"seq_view_shot",
")",
"self",
".",
"seq_shot_create_pb",
".",
"clicked",
".",
"connect",
"(",
"self",
".",
"seq_create_shot",
")",
"self",
".",
"seq_desc_pte",
".",
"textChanged",
".",
"connect",
"(",
"self",
".",
"seq_save",
")"
] |
Setup the signals for the sequence page
:returns: None
:rtype: None
:raises: None
|
[
"Setup",
"the",
"signals",
"for",
"the",
"sequence",
"page"
] |
bac2280ca49940355270e4b69400ce9976ab2e6f
|
https://github.com/JukeboxPipeline/jukebox-core/blob/bac2280ca49940355270e4b69400ce9976ab2e6f/src/jukeboxcore/addons/guerilla/guerillamgmt.py#L888-L899
|
239,175
|
JukeboxPipeline/jukebox-core
|
src/jukeboxcore/addons/guerilla/guerillamgmt.py
|
GuerillaMGMTWin.setup_shot_signals
|
def setup_shot_signals(self, ):
"""Setup the signals for the shot page
:returns: None
:rtype: None
:raises: None
"""
log.debug("Setting up shot page signals.")
self.shot_prj_view_pb.clicked.connect(self.shot_view_prj)
self.shot_seq_view_pb.clicked.connect(self.shot_view_seq)
self.shot_asset_view_pb.clicked.connect(self.shot_view_asset)
self.shot_asset_create_pb.clicked.connect(self.shot_create_asset)
self.shot_asset_add_pb.clicked.connect(self.shot_add_asset)
self.shot_asset_remove_pb.clicked.connect(self.shot_remove_asset)
self.shot_task_view_pb.clicked.connect(self.shot_view_task)
self.shot_task_create_pb.clicked.connect(self.shot_create_task)
self.shot_start_sb.valueChanged.connect(self.shot_save)
self.shot_end_sb.valueChanged.connect(self.shot_save)
self.shot_handle_sb.valueChanged.connect(self.shot_save)
self.shot_desc_pte.textChanged.connect(self.shot_save)
|
python
|
def setup_shot_signals(self, ):
"""Setup the signals for the shot page
:returns: None
:rtype: None
:raises: None
"""
log.debug("Setting up shot page signals.")
self.shot_prj_view_pb.clicked.connect(self.shot_view_prj)
self.shot_seq_view_pb.clicked.connect(self.shot_view_seq)
self.shot_asset_view_pb.clicked.connect(self.shot_view_asset)
self.shot_asset_create_pb.clicked.connect(self.shot_create_asset)
self.shot_asset_add_pb.clicked.connect(self.shot_add_asset)
self.shot_asset_remove_pb.clicked.connect(self.shot_remove_asset)
self.shot_task_view_pb.clicked.connect(self.shot_view_task)
self.shot_task_create_pb.clicked.connect(self.shot_create_task)
self.shot_start_sb.valueChanged.connect(self.shot_save)
self.shot_end_sb.valueChanged.connect(self.shot_save)
self.shot_handle_sb.valueChanged.connect(self.shot_save)
self.shot_desc_pte.textChanged.connect(self.shot_save)
|
[
"def",
"setup_shot_signals",
"(",
"self",
",",
")",
":",
"log",
".",
"debug",
"(",
"\"Setting up shot page signals.\"",
")",
"self",
".",
"shot_prj_view_pb",
".",
"clicked",
".",
"connect",
"(",
"self",
".",
"shot_view_prj",
")",
"self",
".",
"shot_seq_view_pb",
".",
"clicked",
".",
"connect",
"(",
"self",
".",
"shot_view_seq",
")",
"self",
".",
"shot_asset_view_pb",
".",
"clicked",
".",
"connect",
"(",
"self",
".",
"shot_view_asset",
")",
"self",
".",
"shot_asset_create_pb",
".",
"clicked",
".",
"connect",
"(",
"self",
".",
"shot_create_asset",
")",
"self",
".",
"shot_asset_add_pb",
".",
"clicked",
".",
"connect",
"(",
"self",
".",
"shot_add_asset",
")",
"self",
".",
"shot_asset_remove_pb",
".",
"clicked",
".",
"connect",
"(",
"self",
".",
"shot_remove_asset",
")",
"self",
".",
"shot_task_view_pb",
".",
"clicked",
".",
"connect",
"(",
"self",
".",
"shot_view_task",
")",
"self",
".",
"shot_task_create_pb",
".",
"clicked",
".",
"connect",
"(",
"self",
".",
"shot_create_task",
")",
"self",
".",
"shot_start_sb",
".",
"valueChanged",
".",
"connect",
"(",
"self",
".",
"shot_save",
")",
"self",
".",
"shot_end_sb",
".",
"valueChanged",
".",
"connect",
"(",
"self",
".",
"shot_save",
")",
"self",
".",
"shot_handle_sb",
".",
"valueChanged",
".",
"connect",
"(",
"self",
".",
"shot_save",
")",
"self",
".",
"shot_desc_pte",
".",
"textChanged",
".",
"connect",
"(",
"self",
".",
"shot_save",
")"
] |
Setup the signals for the shot page
:returns: None
:rtype: None
:raises: None
|
[
"Setup",
"the",
"signals",
"for",
"the",
"shot",
"page"
] |
bac2280ca49940355270e4b69400ce9976ab2e6f
|
https://github.com/JukeboxPipeline/jukebox-core/blob/bac2280ca49940355270e4b69400ce9976ab2e6f/src/jukeboxcore/addons/guerilla/guerillamgmt.py#L901-L920
|
239,176
|
JukeboxPipeline/jukebox-core
|
src/jukeboxcore/addons/guerilla/guerillamgmt.py
|
GuerillaMGMTWin.setup_atype_signals
|
def setup_atype_signals(self, ):
"""Setup the signals for the assettype page
:returns: None
:rtype: None
:raises: None
"""
log.debug("Setting up atype page signals.")
self.asset_prj_view_pb.clicked.connect(self.asset_view_prj)
self.asset_atype_view_pb.clicked.connect(self.asset_view_atype)
self.atype_asset_view_pb.clicked.connect(self.atype_view_asset)
self.atype_asset_create_pb.clicked.connect(self.atype_create_asset)
self.atype_desc_pte.textChanged.connect(self.atype_save)
|
python
|
def setup_atype_signals(self, ):
"""Setup the signals for the assettype page
:returns: None
:rtype: None
:raises: None
"""
log.debug("Setting up atype page signals.")
self.asset_prj_view_pb.clicked.connect(self.asset_view_prj)
self.asset_atype_view_pb.clicked.connect(self.asset_view_atype)
self.atype_asset_view_pb.clicked.connect(self.atype_view_asset)
self.atype_asset_create_pb.clicked.connect(self.atype_create_asset)
self.atype_desc_pte.textChanged.connect(self.atype_save)
|
[
"def",
"setup_atype_signals",
"(",
"self",
",",
")",
":",
"log",
".",
"debug",
"(",
"\"Setting up atype page signals.\"",
")",
"self",
".",
"asset_prj_view_pb",
".",
"clicked",
".",
"connect",
"(",
"self",
".",
"asset_view_prj",
")",
"self",
".",
"asset_atype_view_pb",
".",
"clicked",
".",
"connect",
"(",
"self",
".",
"asset_view_atype",
")",
"self",
".",
"atype_asset_view_pb",
".",
"clicked",
".",
"connect",
"(",
"self",
".",
"atype_view_asset",
")",
"self",
".",
"atype_asset_create_pb",
".",
"clicked",
".",
"connect",
"(",
"self",
".",
"atype_create_asset",
")",
"self",
".",
"atype_desc_pte",
".",
"textChanged",
".",
"connect",
"(",
"self",
".",
"atype_save",
")"
] |
Setup the signals for the assettype page
:returns: None
:rtype: None
:raises: None
|
[
"Setup",
"the",
"signals",
"for",
"the",
"assettype",
"page"
] |
bac2280ca49940355270e4b69400ce9976ab2e6f
|
https://github.com/JukeboxPipeline/jukebox-core/blob/bac2280ca49940355270e4b69400ce9976ab2e6f/src/jukeboxcore/addons/guerilla/guerillamgmt.py#L922-L934
|
239,177
|
JukeboxPipeline/jukebox-core
|
src/jukeboxcore/addons/guerilla/guerillamgmt.py
|
GuerillaMGMTWin.setup_asset_signals
|
def setup_asset_signals(self, ):
"""Setup the signals for the asset page
:returns: None
:rtype: None
:raises: None
"""
log.debug("Setting up asset signals.")
self.asset_asset_view_pb.clicked.connect(self.asset_view_asset)
self.asset_asset_create_pb.clicked.connect(self.asset_create_asset)
self.asset_asset_add_pb.clicked.connect(self.asset_add_asset)
self.asset_asset_remove_pb.clicked.connect(self.asset_remove_asset)
self.asset_task_view_pb.clicked.connect(self.asset_view_task)
self.asset_task_create_pb.clicked.connect(self.asset_create_task)
self.asset_desc_pte.textChanged.connect(self.asset_save)
|
python
|
def setup_asset_signals(self, ):
"""Setup the signals for the asset page
:returns: None
:rtype: None
:raises: None
"""
log.debug("Setting up asset signals.")
self.asset_asset_view_pb.clicked.connect(self.asset_view_asset)
self.asset_asset_create_pb.clicked.connect(self.asset_create_asset)
self.asset_asset_add_pb.clicked.connect(self.asset_add_asset)
self.asset_asset_remove_pb.clicked.connect(self.asset_remove_asset)
self.asset_task_view_pb.clicked.connect(self.asset_view_task)
self.asset_task_create_pb.clicked.connect(self.asset_create_task)
self.asset_desc_pte.textChanged.connect(self.asset_save)
|
[
"def",
"setup_asset_signals",
"(",
"self",
",",
")",
":",
"log",
".",
"debug",
"(",
"\"Setting up asset signals.\"",
")",
"self",
".",
"asset_asset_view_pb",
".",
"clicked",
".",
"connect",
"(",
"self",
".",
"asset_view_asset",
")",
"self",
".",
"asset_asset_create_pb",
".",
"clicked",
".",
"connect",
"(",
"self",
".",
"asset_create_asset",
")",
"self",
".",
"asset_asset_add_pb",
".",
"clicked",
".",
"connect",
"(",
"self",
".",
"asset_add_asset",
")",
"self",
".",
"asset_asset_remove_pb",
".",
"clicked",
".",
"connect",
"(",
"self",
".",
"asset_remove_asset",
")",
"self",
".",
"asset_task_view_pb",
".",
"clicked",
".",
"connect",
"(",
"self",
".",
"asset_view_task",
")",
"self",
".",
"asset_task_create_pb",
".",
"clicked",
".",
"connect",
"(",
"self",
".",
"asset_create_task",
")",
"self",
".",
"asset_desc_pte",
".",
"textChanged",
".",
"connect",
"(",
"self",
".",
"asset_save",
")"
] |
Setup the signals for the asset page
:returns: None
:rtype: None
:raises: None
|
[
"Setup",
"the",
"signals",
"for",
"the",
"asset",
"page"
] |
bac2280ca49940355270e4b69400ce9976ab2e6f
|
https://github.com/JukeboxPipeline/jukebox-core/blob/bac2280ca49940355270e4b69400ce9976ab2e6f/src/jukeboxcore/addons/guerilla/guerillamgmt.py#L936-L950
|
239,178
|
JukeboxPipeline/jukebox-core
|
src/jukeboxcore/addons/guerilla/guerillamgmt.py
|
GuerillaMGMTWin.setup_dep_signals
|
def setup_dep_signals(self, ):
"""Setup the signals for the department page
:returns: None
:rtype: None
:raises: None
"""
log.debug("Setting up department page signals.")
self.dep_prj_view_pb.clicked.connect(self.dep_view_prj)
self.dep_prj_add_pb.clicked.connect(self.dep_add_prj)
self.dep_prj_remove_pb.clicked.connect(self.dep_remove_prj)
self.dep_desc_pte.textChanged.connect(self.dep_save)
self.dep_ordervalue_sb.valueChanged.connect(self.dep_save)
|
python
|
def setup_dep_signals(self, ):
"""Setup the signals for the department page
:returns: None
:rtype: None
:raises: None
"""
log.debug("Setting up department page signals.")
self.dep_prj_view_pb.clicked.connect(self.dep_view_prj)
self.dep_prj_add_pb.clicked.connect(self.dep_add_prj)
self.dep_prj_remove_pb.clicked.connect(self.dep_remove_prj)
self.dep_desc_pte.textChanged.connect(self.dep_save)
self.dep_ordervalue_sb.valueChanged.connect(self.dep_save)
|
[
"def",
"setup_dep_signals",
"(",
"self",
",",
")",
":",
"log",
".",
"debug",
"(",
"\"Setting up department page signals.\"",
")",
"self",
".",
"dep_prj_view_pb",
".",
"clicked",
".",
"connect",
"(",
"self",
".",
"dep_view_prj",
")",
"self",
".",
"dep_prj_add_pb",
".",
"clicked",
".",
"connect",
"(",
"self",
".",
"dep_add_prj",
")",
"self",
".",
"dep_prj_remove_pb",
".",
"clicked",
".",
"connect",
"(",
"self",
".",
"dep_remove_prj",
")",
"self",
".",
"dep_desc_pte",
".",
"textChanged",
".",
"connect",
"(",
"self",
".",
"dep_save",
")",
"self",
".",
"dep_ordervalue_sb",
".",
"valueChanged",
".",
"connect",
"(",
"self",
".",
"dep_save",
")"
] |
Setup the signals for the department page
:returns: None
:rtype: None
:raises: None
|
[
"Setup",
"the",
"signals",
"for",
"the",
"department",
"page"
] |
bac2280ca49940355270e4b69400ce9976ab2e6f
|
https://github.com/JukeboxPipeline/jukebox-core/blob/bac2280ca49940355270e4b69400ce9976ab2e6f/src/jukeboxcore/addons/guerilla/guerillamgmt.py#L952-L964
|
239,179
|
JukeboxPipeline/jukebox-core
|
src/jukeboxcore/addons/guerilla/guerillamgmt.py
|
GuerillaMGMTWin.setup_task_signals
|
def setup_task_signals(self, ):
"""Setup the signals for the task page
:returns: None
:rtype: None
:raises: None
"""
log.debug("Setting up task page signals.")
self.task_user_view_pb.clicked.connect(self.task_view_user)
self.task_user_add_pb.clicked.connect(self.task_add_user)
self.task_user_remove_pb.clicked.connect(self.task_remove_user)
self.task_dep_view_pb.clicked.connect(self.task_view_dep)
self.task_link_view_pb.clicked.connect(self.task_view_link)
self.task_deadline_de.dateChanged.connect(self.task_save)
self.task_status_cb.currentIndexChanged.connect(self.task_save)
|
python
|
def setup_task_signals(self, ):
"""Setup the signals for the task page
:returns: None
:rtype: None
:raises: None
"""
log.debug("Setting up task page signals.")
self.task_user_view_pb.clicked.connect(self.task_view_user)
self.task_user_add_pb.clicked.connect(self.task_add_user)
self.task_user_remove_pb.clicked.connect(self.task_remove_user)
self.task_dep_view_pb.clicked.connect(self.task_view_dep)
self.task_link_view_pb.clicked.connect(self.task_view_link)
self.task_deadline_de.dateChanged.connect(self.task_save)
self.task_status_cb.currentIndexChanged.connect(self.task_save)
|
[
"def",
"setup_task_signals",
"(",
"self",
",",
")",
":",
"log",
".",
"debug",
"(",
"\"Setting up task page signals.\"",
")",
"self",
".",
"task_user_view_pb",
".",
"clicked",
".",
"connect",
"(",
"self",
".",
"task_view_user",
")",
"self",
".",
"task_user_add_pb",
".",
"clicked",
".",
"connect",
"(",
"self",
".",
"task_add_user",
")",
"self",
".",
"task_user_remove_pb",
".",
"clicked",
".",
"connect",
"(",
"self",
".",
"task_remove_user",
")",
"self",
".",
"task_dep_view_pb",
".",
"clicked",
".",
"connect",
"(",
"self",
".",
"task_view_dep",
")",
"self",
".",
"task_link_view_pb",
".",
"clicked",
".",
"connect",
"(",
"self",
".",
"task_view_link",
")",
"self",
".",
"task_deadline_de",
".",
"dateChanged",
".",
"connect",
"(",
"self",
".",
"task_save",
")",
"self",
".",
"task_status_cb",
".",
"currentIndexChanged",
".",
"connect",
"(",
"self",
".",
"task_save",
")"
] |
Setup the signals for the task page
:returns: None
:rtype: None
:raises: None
|
[
"Setup",
"the",
"signals",
"for",
"the",
"task",
"page"
] |
bac2280ca49940355270e4b69400ce9976ab2e6f
|
https://github.com/JukeboxPipeline/jukebox-core/blob/bac2280ca49940355270e4b69400ce9976ab2e6f/src/jukeboxcore/addons/guerilla/guerillamgmt.py#L966-L980
|
239,180
|
JukeboxPipeline/jukebox-core
|
src/jukeboxcore/addons/guerilla/guerillamgmt.py
|
GuerillaMGMTWin.setup_users_signals
|
def setup_users_signals(self, ):
"""Setup the signals for the users page
:returns: None
:rtype: None
:raises: None
"""
log.debug("Setting up users page signals.")
self.users_user_view_pb.clicked.connect(self.users_view_user)
self.users_user_create_pb.clicked.connect(self.create_user)
|
python
|
def setup_users_signals(self, ):
"""Setup the signals for the users page
:returns: None
:rtype: None
:raises: None
"""
log.debug("Setting up users page signals.")
self.users_user_view_pb.clicked.connect(self.users_view_user)
self.users_user_create_pb.clicked.connect(self.create_user)
|
[
"def",
"setup_users_signals",
"(",
"self",
",",
")",
":",
"log",
".",
"debug",
"(",
"\"Setting up users page signals.\"",
")",
"self",
".",
"users_user_view_pb",
".",
"clicked",
".",
"connect",
"(",
"self",
".",
"users_view_user",
")",
"self",
".",
"users_user_create_pb",
".",
"clicked",
".",
"connect",
"(",
"self",
".",
"create_user",
")"
] |
Setup the signals for the users page
:returns: None
:rtype: None
:raises: None
|
[
"Setup",
"the",
"signals",
"for",
"the",
"users",
"page"
] |
bac2280ca49940355270e4b69400ce9976ab2e6f
|
https://github.com/JukeboxPipeline/jukebox-core/blob/bac2280ca49940355270e4b69400ce9976ab2e6f/src/jukeboxcore/addons/guerilla/guerillamgmt.py#L982-L991
|
239,181
|
JukeboxPipeline/jukebox-core
|
src/jukeboxcore/addons/guerilla/guerillamgmt.py
|
GuerillaMGMTWin.setup_user_signals
|
def setup_user_signals(self, ):
"""Setup the signals for the user page
:returns: None
:rtype: None
:raises: None
"""
log.debug("Setting up user page signals.")
self.user_task_view_pb.clicked.connect(self.user_view_task)
self.user_prj_view_pb.clicked.connect(self.user_view_prj)
self.user_prj_add_pb.clicked.connect(self.user_add_prj)
self.user_prj_remove_pb.clicked.connect(self.user_remove_prj)
self.user_username_le.editingFinished.connect(self.user_save)
self.user_first_le.editingFinished.connect(self.user_save)
self.user_last_le.editingFinished.connect(self.user_save)
self.user_email_le.editingFinished.connect(self.user_save)
|
python
|
def setup_user_signals(self, ):
"""Setup the signals for the user page
:returns: None
:rtype: None
:raises: None
"""
log.debug("Setting up user page signals.")
self.user_task_view_pb.clicked.connect(self.user_view_task)
self.user_prj_view_pb.clicked.connect(self.user_view_prj)
self.user_prj_add_pb.clicked.connect(self.user_add_prj)
self.user_prj_remove_pb.clicked.connect(self.user_remove_prj)
self.user_username_le.editingFinished.connect(self.user_save)
self.user_first_le.editingFinished.connect(self.user_save)
self.user_last_le.editingFinished.connect(self.user_save)
self.user_email_le.editingFinished.connect(self.user_save)
|
[
"def",
"setup_user_signals",
"(",
"self",
",",
")",
":",
"log",
".",
"debug",
"(",
"\"Setting up user page signals.\"",
")",
"self",
".",
"user_task_view_pb",
".",
"clicked",
".",
"connect",
"(",
"self",
".",
"user_view_task",
")",
"self",
".",
"user_prj_view_pb",
".",
"clicked",
".",
"connect",
"(",
"self",
".",
"user_view_prj",
")",
"self",
".",
"user_prj_add_pb",
".",
"clicked",
".",
"connect",
"(",
"self",
".",
"user_add_prj",
")",
"self",
".",
"user_prj_remove_pb",
".",
"clicked",
".",
"connect",
"(",
"self",
".",
"user_remove_prj",
")",
"self",
".",
"user_username_le",
".",
"editingFinished",
".",
"connect",
"(",
"self",
".",
"user_save",
")",
"self",
".",
"user_first_le",
".",
"editingFinished",
".",
"connect",
"(",
"self",
".",
"user_save",
")",
"self",
".",
"user_last_le",
".",
"editingFinished",
".",
"connect",
"(",
"self",
".",
"user_save",
")",
"self",
".",
"user_email_le",
".",
"editingFinished",
".",
"connect",
"(",
"self",
".",
"user_save",
")"
] |
Setup the signals for the user page
:returns: None
:rtype: None
:raises: None
|
[
"Setup",
"the",
"signals",
"for",
"the",
"user",
"page"
] |
bac2280ca49940355270e4b69400ce9976ab2e6f
|
https://github.com/JukeboxPipeline/jukebox-core/blob/bac2280ca49940355270e4b69400ce9976ab2e6f/src/jukeboxcore/addons/guerilla/guerillamgmt.py#L993-L1008
|
239,182
|
JukeboxPipeline/jukebox-core
|
src/jukeboxcore/addons/guerilla/guerillamgmt.py
|
GuerillaMGMTWin.prjs_view_prj
|
def prjs_view_prj(self, *args, **kwargs):
"""View the, in the projects table view selected, project.
:returns: None
:rtype: None
:raises: None
"""
i = self.prjs_tablev.currentIndex()
item = i.internalPointer()
if item:
prj = item.internal_data()
self.view_prj(prj)
|
python
|
def prjs_view_prj(self, *args, **kwargs):
"""View the, in the projects table view selected, project.
:returns: None
:rtype: None
:raises: None
"""
i = self.prjs_tablev.currentIndex()
item = i.internalPointer()
if item:
prj = item.internal_data()
self.view_prj(prj)
|
[
"def",
"prjs_view_prj",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"i",
"=",
"self",
".",
"prjs_tablev",
".",
"currentIndex",
"(",
")",
"item",
"=",
"i",
".",
"internalPointer",
"(",
")",
"if",
"item",
":",
"prj",
"=",
"item",
".",
"internal_data",
"(",
")",
"self",
".",
"view_prj",
"(",
"prj",
")"
] |
View the, in the projects table view selected, project.
:returns: None
:rtype: None
:raises: None
|
[
"View",
"the",
"in",
"the",
"projects",
"table",
"view",
"selected",
"project",
"."
] |
bac2280ca49940355270e4b69400ce9976ab2e6f
|
https://github.com/JukeboxPipeline/jukebox-core/blob/bac2280ca49940355270e4b69400ce9976ab2e6f/src/jukeboxcore/addons/guerilla/guerillamgmt.py#L1010-L1021
|
239,183
|
JukeboxPipeline/jukebox-core
|
src/jukeboxcore/addons/guerilla/guerillamgmt.py
|
GuerillaMGMTWin.view_prj
|
def view_prj(self, prj):
"""View the given project on the project page
:param prj: the project to view
:type prj: :class:`jukeboxcore.djadapter.models.Project`
:returns: None
:rtype: None
:raises: None
"""
log.debug('Viewing project %s', prj.name)
self.cur_prj = None
self.pages_tabw.setCurrentIndex(1)
self.prj_name_le.setText(prj.name)
self.prj_short_le.setText(prj.short)
self.prj_path_le.setText(prj.path)
self.prj_desc_pte.setPlainText(prj.description)
self.prj_created_dte.setDateTime(dt_to_qdatetime(prj.date_created))
self.prj_semester_le.setText(prj.semester)
self.prj_fps_dsb.setValue(prj.framerate)
self.prj_res_x_sb.setValue(prj.resx)
self.prj_res_y_sb.setValue(prj.resy)
scalemap = {"m": 2, "meter": 2, "mm": 0, "millimeter": 0, "cm": 1, "centimeter": 1,
"km": 3, "kilometer": 3, "inch": 4, "foot": 5, "yard": 6, "mile": 7}
scaleindex = scalemap.get(prj.scale, -1)
log.debug("Setting index of project scale combobox to %s. Scale is %s", scaleindex, prj.scale)
self.prj_scale_cb.setCurrentIndex(scaleindex)
seqrootdata = treemodel.ListItemData(['Name', "Description"])
seqrootitem = treemodel.TreeItem(seqrootdata)
for seq in prj.sequence_set.all():
seqdata = djitemdata.SequenceItemData(seq)
treemodel.TreeItem(seqdata, seqrootitem)
self.prj_seq_model = treemodel.TreeModel(seqrootitem)
self.prj_seq_tablev.setModel(self.prj_seq_model)
atyperootdata = treemodel.ListItemData(['Name', "Description"])
atyperootitem = treemodel.TreeItem(atyperootdata)
for atype in prj.atype_set.all():
atypedata = djitemdata.AtypeItemData(atype)
treemodel.TreeItem(atypedata, atyperootitem)
self.prj_atype_model = treemodel.TreeModel(atyperootitem)
self.prj_atype_tablev.setModel(self.prj_atype_model)
deprootdata = treemodel.ListItemData(['Name', "Description", "Ordervalue"])
deprootitem = treemodel.TreeItem(deprootdata)
for dep in prj.department_set.all():
depdata = djitemdata.DepartmentItemData(dep)
treemodel.TreeItem(depdata, deprootitem)
self.prj_dep_model = treemodel.TreeModel(deprootitem)
self.prj_dep_tablev.setModel(self.prj_dep_model)
userrootdata = treemodel.ListItemData(['Username', 'First', 'Last', 'Email'])
userrootitem = treemodel.TreeItem(userrootdata)
for user in prj.users.all():
userdata = djitemdata.UserItemData(user)
treemodel.TreeItem(userdata, userrootitem)
self.prj_user_model = treemodel.TreeModel(userrootitem)
self.prj_user_tablev.setModel(self.prj_user_model)
self.cur_prj = prj
|
python
|
def view_prj(self, prj):
"""View the given project on the project page
:param prj: the project to view
:type prj: :class:`jukeboxcore.djadapter.models.Project`
:returns: None
:rtype: None
:raises: None
"""
log.debug('Viewing project %s', prj.name)
self.cur_prj = None
self.pages_tabw.setCurrentIndex(1)
self.prj_name_le.setText(prj.name)
self.prj_short_le.setText(prj.short)
self.prj_path_le.setText(prj.path)
self.prj_desc_pte.setPlainText(prj.description)
self.prj_created_dte.setDateTime(dt_to_qdatetime(prj.date_created))
self.prj_semester_le.setText(prj.semester)
self.prj_fps_dsb.setValue(prj.framerate)
self.prj_res_x_sb.setValue(prj.resx)
self.prj_res_y_sb.setValue(prj.resy)
scalemap = {"m": 2, "meter": 2, "mm": 0, "millimeter": 0, "cm": 1, "centimeter": 1,
"km": 3, "kilometer": 3, "inch": 4, "foot": 5, "yard": 6, "mile": 7}
scaleindex = scalemap.get(prj.scale, -1)
log.debug("Setting index of project scale combobox to %s. Scale is %s", scaleindex, prj.scale)
self.prj_scale_cb.setCurrentIndex(scaleindex)
seqrootdata = treemodel.ListItemData(['Name', "Description"])
seqrootitem = treemodel.TreeItem(seqrootdata)
for seq in prj.sequence_set.all():
seqdata = djitemdata.SequenceItemData(seq)
treemodel.TreeItem(seqdata, seqrootitem)
self.prj_seq_model = treemodel.TreeModel(seqrootitem)
self.prj_seq_tablev.setModel(self.prj_seq_model)
atyperootdata = treemodel.ListItemData(['Name', "Description"])
atyperootitem = treemodel.TreeItem(atyperootdata)
for atype in prj.atype_set.all():
atypedata = djitemdata.AtypeItemData(atype)
treemodel.TreeItem(atypedata, atyperootitem)
self.prj_atype_model = treemodel.TreeModel(atyperootitem)
self.prj_atype_tablev.setModel(self.prj_atype_model)
deprootdata = treemodel.ListItemData(['Name', "Description", "Ordervalue"])
deprootitem = treemodel.TreeItem(deprootdata)
for dep in prj.department_set.all():
depdata = djitemdata.DepartmentItemData(dep)
treemodel.TreeItem(depdata, deprootitem)
self.prj_dep_model = treemodel.TreeModel(deprootitem)
self.prj_dep_tablev.setModel(self.prj_dep_model)
userrootdata = treemodel.ListItemData(['Username', 'First', 'Last', 'Email'])
userrootitem = treemodel.TreeItem(userrootdata)
for user in prj.users.all():
userdata = djitemdata.UserItemData(user)
treemodel.TreeItem(userdata, userrootitem)
self.prj_user_model = treemodel.TreeModel(userrootitem)
self.prj_user_tablev.setModel(self.prj_user_model)
self.cur_prj = prj
|
[
"def",
"view_prj",
"(",
"self",
",",
"prj",
")",
":",
"log",
".",
"debug",
"(",
"'Viewing project %s'",
",",
"prj",
".",
"name",
")",
"self",
".",
"cur_prj",
"=",
"None",
"self",
".",
"pages_tabw",
".",
"setCurrentIndex",
"(",
"1",
")",
"self",
".",
"prj_name_le",
".",
"setText",
"(",
"prj",
".",
"name",
")",
"self",
".",
"prj_short_le",
".",
"setText",
"(",
"prj",
".",
"short",
")",
"self",
".",
"prj_path_le",
".",
"setText",
"(",
"prj",
".",
"path",
")",
"self",
".",
"prj_desc_pte",
".",
"setPlainText",
"(",
"prj",
".",
"description",
")",
"self",
".",
"prj_created_dte",
".",
"setDateTime",
"(",
"dt_to_qdatetime",
"(",
"prj",
".",
"date_created",
")",
")",
"self",
".",
"prj_semester_le",
".",
"setText",
"(",
"prj",
".",
"semester",
")",
"self",
".",
"prj_fps_dsb",
".",
"setValue",
"(",
"prj",
".",
"framerate",
")",
"self",
".",
"prj_res_x_sb",
".",
"setValue",
"(",
"prj",
".",
"resx",
")",
"self",
".",
"prj_res_y_sb",
".",
"setValue",
"(",
"prj",
".",
"resy",
")",
"scalemap",
"=",
"{",
"\"m\"",
":",
"2",
",",
"\"meter\"",
":",
"2",
",",
"\"mm\"",
":",
"0",
",",
"\"millimeter\"",
":",
"0",
",",
"\"cm\"",
":",
"1",
",",
"\"centimeter\"",
":",
"1",
",",
"\"km\"",
":",
"3",
",",
"\"kilometer\"",
":",
"3",
",",
"\"inch\"",
":",
"4",
",",
"\"foot\"",
":",
"5",
",",
"\"yard\"",
":",
"6",
",",
"\"mile\"",
":",
"7",
"}",
"scaleindex",
"=",
"scalemap",
".",
"get",
"(",
"prj",
".",
"scale",
",",
"-",
"1",
")",
"log",
".",
"debug",
"(",
"\"Setting index of project scale combobox to %s. Scale is %s\"",
",",
"scaleindex",
",",
"prj",
".",
"scale",
")",
"self",
".",
"prj_scale_cb",
".",
"setCurrentIndex",
"(",
"scaleindex",
")",
"seqrootdata",
"=",
"treemodel",
".",
"ListItemData",
"(",
"[",
"'Name'",
",",
"\"Description\"",
"]",
")",
"seqrootitem",
"=",
"treemodel",
".",
"TreeItem",
"(",
"seqrootdata",
")",
"for",
"seq",
"in",
"prj",
".",
"sequence_set",
".",
"all",
"(",
")",
":",
"seqdata",
"=",
"djitemdata",
".",
"SequenceItemData",
"(",
"seq",
")",
"treemodel",
".",
"TreeItem",
"(",
"seqdata",
",",
"seqrootitem",
")",
"self",
".",
"prj_seq_model",
"=",
"treemodel",
".",
"TreeModel",
"(",
"seqrootitem",
")",
"self",
".",
"prj_seq_tablev",
".",
"setModel",
"(",
"self",
".",
"prj_seq_model",
")",
"atyperootdata",
"=",
"treemodel",
".",
"ListItemData",
"(",
"[",
"'Name'",
",",
"\"Description\"",
"]",
")",
"atyperootitem",
"=",
"treemodel",
".",
"TreeItem",
"(",
"atyperootdata",
")",
"for",
"atype",
"in",
"prj",
".",
"atype_set",
".",
"all",
"(",
")",
":",
"atypedata",
"=",
"djitemdata",
".",
"AtypeItemData",
"(",
"atype",
")",
"treemodel",
".",
"TreeItem",
"(",
"atypedata",
",",
"atyperootitem",
")",
"self",
".",
"prj_atype_model",
"=",
"treemodel",
".",
"TreeModel",
"(",
"atyperootitem",
")",
"self",
".",
"prj_atype_tablev",
".",
"setModel",
"(",
"self",
".",
"prj_atype_model",
")",
"deprootdata",
"=",
"treemodel",
".",
"ListItemData",
"(",
"[",
"'Name'",
",",
"\"Description\"",
",",
"\"Ordervalue\"",
"]",
")",
"deprootitem",
"=",
"treemodel",
".",
"TreeItem",
"(",
"deprootdata",
")",
"for",
"dep",
"in",
"prj",
".",
"department_set",
".",
"all",
"(",
")",
":",
"depdata",
"=",
"djitemdata",
".",
"DepartmentItemData",
"(",
"dep",
")",
"treemodel",
".",
"TreeItem",
"(",
"depdata",
",",
"deprootitem",
")",
"self",
".",
"prj_dep_model",
"=",
"treemodel",
".",
"TreeModel",
"(",
"deprootitem",
")",
"self",
".",
"prj_dep_tablev",
".",
"setModel",
"(",
"self",
".",
"prj_dep_model",
")",
"userrootdata",
"=",
"treemodel",
".",
"ListItemData",
"(",
"[",
"'Username'",
",",
"'First'",
",",
"'Last'",
",",
"'Email'",
"]",
")",
"userrootitem",
"=",
"treemodel",
".",
"TreeItem",
"(",
"userrootdata",
")",
"for",
"user",
"in",
"prj",
".",
"users",
".",
"all",
"(",
")",
":",
"userdata",
"=",
"djitemdata",
".",
"UserItemData",
"(",
"user",
")",
"treemodel",
".",
"TreeItem",
"(",
"userdata",
",",
"userrootitem",
")",
"self",
".",
"prj_user_model",
"=",
"treemodel",
".",
"TreeModel",
"(",
"userrootitem",
")",
"self",
".",
"prj_user_tablev",
".",
"setModel",
"(",
"self",
".",
"prj_user_model",
")",
"self",
".",
"cur_prj",
"=",
"prj"
] |
View the given project on the project page
:param prj: the project to view
:type prj: :class:`jukeboxcore.djadapter.models.Project`
:returns: None
:rtype: None
:raises: None
|
[
"View",
"the",
"given",
"project",
"on",
"the",
"project",
"page"
] |
bac2280ca49940355270e4b69400ce9976ab2e6f
|
https://github.com/JukeboxPipeline/jukebox-core/blob/bac2280ca49940355270e4b69400ce9976ab2e6f/src/jukeboxcore/addons/guerilla/guerillamgmt.py#L1032-L1090
|
239,184
|
JukeboxPipeline/jukebox-core
|
src/jukeboxcore/addons/guerilla/guerillamgmt.py
|
GuerillaMGMTWin.create_prj
|
def create_prj(self, atypes=None, deps=None):
"""Create and return a new project
:param atypes: add the given atypes to the project
:type atypes: list | None
:param deps: add the given departmetns to the project
:type deps: list | None
:returns: The created project or None
:rtype: None | :class:`jukeboxcore.djadapter.models.Project`
:raises: None
"""
dialog = ProjectCreatorDialog(parent=self)
dialog.exec_()
prj = dialog.project
if prj and atypes:
for at in atypes:
at.projects.add(prj)
at.save()
if prj and deps:
for dep in deps:
dep.projects.add(prj)
dep.save()
if prj:
prjdata = djitemdata.ProjectItemData(prj)
treemodel.TreeItem(prjdata, self.prjs_model.root)
return prj
|
python
|
def create_prj(self, atypes=None, deps=None):
"""Create and return a new project
:param atypes: add the given atypes to the project
:type atypes: list | None
:param deps: add the given departmetns to the project
:type deps: list | None
:returns: The created project or None
:rtype: None | :class:`jukeboxcore.djadapter.models.Project`
:raises: None
"""
dialog = ProjectCreatorDialog(parent=self)
dialog.exec_()
prj = dialog.project
if prj and atypes:
for at in atypes:
at.projects.add(prj)
at.save()
if prj and deps:
for dep in deps:
dep.projects.add(prj)
dep.save()
if prj:
prjdata = djitemdata.ProjectItemData(prj)
treemodel.TreeItem(prjdata, self.prjs_model.root)
return prj
|
[
"def",
"create_prj",
"(",
"self",
",",
"atypes",
"=",
"None",
",",
"deps",
"=",
"None",
")",
":",
"dialog",
"=",
"ProjectCreatorDialog",
"(",
"parent",
"=",
"self",
")",
"dialog",
".",
"exec_",
"(",
")",
"prj",
"=",
"dialog",
".",
"project",
"if",
"prj",
"and",
"atypes",
":",
"for",
"at",
"in",
"atypes",
":",
"at",
".",
"projects",
".",
"add",
"(",
"prj",
")",
"at",
".",
"save",
"(",
")",
"if",
"prj",
"and",
"deps",
":",
"for",
"dep",
"in",
"deps",
":",
"dep",
".",
"projects",
".",
"add",
"(",
"prj",
")",
"dep",
".",
"save",
"(",
")",
"if",
"prj",
":",
"prjdata",
"=",
"djitemdata",
".",
"ProjectItemData",
"(",
"prj",
")",
"treemodel",
".",
"TreeItem",
"(",
"prjdata",
",",
"self",
".",
"prjs_model",
".",
"root",
")",
"return",
"prj"
] |
Create and return a new project
:param atypes: add the given atypes to the project
:type atypes: list | None
:param deps: add the given departmetns to the project
:type deps: list | None
:returns: The created project or None
:rtype: None | :class:`jukeboxcore.djadapter.models.Project`
:raises: None
|
[
"Create",
"and",
"return",
"a",
"new",
"project"
] |
bac2280ca49940355270e4b69400ce9976ab2e6f
|
https://github.com/JukeboxPipeline/jukebox-core/blob/bac2280ca49940355270e4b69400ce9976ab2e6f/src/jukeboxcore/addons/guerilla/guerillamgmt.py#L1092-L1117
|
239,185
|
JukeboxPipeline/jukebox-core
|
src/jukeboxcore/addons/guerilla/guerillamgmt.py
|
GuerillaMGMTWin.prj_view_seq
|
def prj_view_seq(self, *args, **kwargs):
"""View the, in the prj_seq_tablev selected, sequence.
:returns: None
:rtype: None
:raises: None
"""
if not self.cur_prj:
return
i = self.prj_seq_tablev.currentIndex()
item = i.internalPointer()
if item:
seq = item.internal_data()
self.view_seq(seq)
|
python
|
def prj_view_seq(self, *args, **kwargs):
"""View the, in the prj_seq_tablev selected, sequence.
:returns: None
:rtype: None
:raises: None
"""
if not self.cur_prj:
return
i = self.prj_seq_tablev.currentIndex()
item = i.internalPointer()
if item:
seq = item.internal_data()
self.view_seq(seq)
|
[
"def",
"prj_view_seq",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"not",
"self",
".",
"cur_prj",
":",
"return",
"i",
"=",
"self",
".",
"prj_seq_tablev",
".",
"currentIndex",
"(",
")",
"item",
"=",
"i",
".",
"internalPointer",
"(",
")",
"if",
"item",
":",
"seq",
"=",
"item",
".",
"internal_data",
"(",
")",
"self",
".",
"view_seq",
"(",
"seq",
")"
] |
View the, in the prj_seq_tablev selected, sequence.
:returns: None
:rtype: None
:raises: None
|
[
"View",
"the",
"in",
"the",
"prj_seq_tablev",
"selected",
"sequence",
"."
] |
bac2280ca49940355270e4b69400ce9976ab2e6f
|
https://github.com/JukeboxPipeline/jukebox-core/blob/bac2280ca49940355270e4b69400ce9976ab2e6f/src/jukeboxcore/addons/guerilla/guerillamgmt.py#L1119-L1132
|
239,186
|
JukeboxPipeline/jukebox-core
|
src/jukeboxcore/addons/guerilla/guerillamgmt.py
|
GuerillaMGMTWin.prj_create_seq
|
def prj_create_seq(self, *args, **kwargs):
"""Create a new Sequence for the current project
:returns: None
:rtype: None
:raises: None
"""
if not self.cur_prj:
return
seq = self.create_seq(project=self.cur_prj)
if seq:
seqdata = djitemdata.SequenceItemData(seq)
treemodel.TreeItem(seqdata, self.prj_seq_model.root)
|
python
|
def prj_create_seq(self, *args, **kwargs):
"""Create a new Sequence for the current project
:returns: None
:rtype: None
:raises: None
"""
if not self.cur_prj:
return
seq = self.create_seq(project=self.cur_prj)
if seq:
seqdata = djitemdata.SequenceItemData(seq)
treemodel.TreeItem(seqdata, self.prj_seq_model.root)
|
[
"def",
"prj_create_seq",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"not",
"self",
".",
"cur_prj",
":",
"return",
"seq",
"=",
"self",
".",
"create_seq",
"(",
"project",
"=",
"self",
".",
"cur_prj",
")",
"if",
"seq",
":",
"seqdata",
"=",
"djitemdata",
".",
"SequenceItemData",
"(",
"seq",
")",
"treemodel",
".",
"TreeItem",
"(",
"seqdata",
",",
"self",
".",
"prj_seq_model",
".",
"root",
")"
] |
Create a new Sequence for the current project
:returns: None
:rtype: None
:raises: None
|
[
"Create",
"a",
"new",
"Sequence",
"for",
"the",
"current",
"project"
] |
bac2280ca49940355270e4b69400ce9976ab2e6f
|
https://github.com/JukeboxPipeline/jukebox-core/blob/bac2280ca49940355270e4b69400ce9976ab2e6f/src/jukeboxcore/addons/guerilla/guerillamgmt.py#L1134-L1146
|
239,187
|
JukeboxPipeline/jukebox-core
|
src/jukeboxcore/addons/guerilla/guerillamgmt.py
|
GuerillaMGMTWin.view_seq
|
def view_seq(self, seq):
"""View the given sequence on the sequence page
:param seq: the sequence to view
:type seq: :class:`jukeboxcore.djadapter.models.Sequence`
:returns: None
:rtype: None
:raises: None
"""
log.debug('Viewing sequence %s', seq.name)
self.cur_seq = None
self.pages_tabw.setCurrentIndex(2)
self.seq_name_le.setText(seq.name)
self.seq_prj_le.setText(seq.project.name)
self.seq_desc_pte.setPlainText(seq.description)
shotrootdata = treemodel.ListItemData(['Name', "Description", "Duration", "Start", "End"])
shotrootitem = treemodel.TreeItem(shotrootdata)
for shot in seq.shot_set.all():
shotdata = djitemdata.ShotItemData(shot)
treemodel.TreeItem(shotdata, shotrootitem)
self.seq_shot_model = treemodel.TreeModel(shotrootitem)
self.seq_shot_tablev.setModel(self.seq_shot_model)
self.cur_seq = seq
|
python
|
def view_seq(self, seq):
"""View the given sequence on the sequence page
:param seq: the sequence to view
:type seq: :class:`jukeboxcore.djadapter.models.Sequence`
:returns: None
:rtype: None
:raises: None
"""
log.debug('Viewing sequence %s', seq.name)
self.cur_seq = None
self.pages_tabw.setCurrentIndex(2)
self.seq_name_le.setText(seq.name)
self.seq_prj_le.setText(seq.project.name)
self.seq_desc_pte.setPlainText(seq.description)
shotrootdata = treemodel.ListItemData(['Name', "Description", "Duration", "Start", "End"])
shotrootitem = treemodel.TreeItem(shotrootdata)
for shot in seq.shot_set.all():
shotdata = djitemdata.ShotItemData(shot)
treemodel.TreeItem(shotdata, shotrootitem)
self.seq_shot_model = treemodel.TreeModel(shotrootitem)
self.seq_shot_tablev.setModel(self.seq_shot_model)
self.cur_seq = seq
|
[
"def",
"view_seq",
"(",
"self",
",",
"seq",
")",
":",
"log",
".",
"debug",
"(",
"'Viewing sequence %s'",
",",
"seq",
".",
"name",
")",
"self",
".",
"cur_seq",
"=",
"None",
"self",
".",
"pages_tabw",
".",
"setCurrentIndex",
"(",
"2",
")",
"self",
".",
"seq_name_le",
".",
"setText",
"(",
"seq",
".",
"name",
")",
"self",
".",
"seq_prj_le",
".",
"setText",
"(",
"seq",
".",
"project",
".",
"name",
")",
"self",
".",
"seq_desc_pte",
".",
"setPlainText",
"(",
"seq",
".",
"description",
")",
"shotrootdata",
"=",
"treemodel",
".",
"ListItemData",
"(",
"[",
"'Name'",
",",
"\"Description\"",
",",
"\"Duration\"",
",",
"\"Start\"",
",",
"\"End\"",
"]",
")",
"shotrootitem",
"=",
"treemodel",
".",
"TreeItem",
"(",
"shotrootdata",
")",
"for",
"shot",
"in",
"seq",
".",
"shot_set",
".",
"all",
"(",
")",
":",
"shotdata",
"=",
"djitemdata",
".",
"ShotItemData",
"(",
"shot",
")",
"treemodel",
".",
"TreeItem",
"(",
"shotdata",
",",
"shotrootitem",
")",
"self",
".",
"seq_shot_model",
"=",
"treemodel",
".",
"TreeModel",
"(",
"shotrootitem",
")",
"self",
".",
"seq_shot_tablev",
".",
"setModel",
"(",
"self",
".",
"seq_shot_model",
")",
"self",
".",
"cur_seq",
"=",
"seq"
] |
View the given sequence on the sequence page
:param seq: the sequence to view
:type seq: :class:`jukeboxcore.djadapter.models.Sequence`
:returns: None
:rtype: None
:raises: None
|
[
"View",
"the",
"given",
"sequence",
"on",
"the",
"sequence",
"page"
] |
bac2280ca49940355270e4b69400ce9976ab2e6f
|
https://github.com/JukeboxPipeline/jukebox-core/blob/bac2280ca49940355270e4b69400ce9976ab2e6f/src/jukeboxcore/addons/guerilla/guerillamgmt.py#L1148-L1171
|
239,188
|
JukeboxPipeline/jukebox-core
|
src/jukeboxcore/addons/guerilla/guerillamgmt.py
|
GuerillaMGMTWin.create_seq
|
def create_seq(self, project):
"""Create and return a new sequence
:param project: the project for the sequence
:type deps: :class:`jukeboxcore.djadapter.models.Project`
:returns: The created sequence or None
:rtype: None | :class:`jukeboxcore.djadapter.models.Sequence`
:raises: None
"""
dialog = SequenceCreatorDialog(project=project, parent=self)
dialog.exec_()
seq = dialog.sequence
return seq
|
python
|
def create_seq(self, project):
"""Create and return a new sequence
:param project: the project for the sequence
:type deps: :class:`jukeboxcore.djadapter.models.Project`
:returns: The created sequence or None
:rtype: None | :class:`jukeboxcore.djadapter.models.Sequence`
:raises: None
"""
dialog = SequenceCreatorDialog(project=project, parent=self)
dialog.exec_()
seq = dialog.sequence
return seq
|
[
"def",
"create_seq",
"(",
"self",
",",
"project",
")",
":",
"dialog",
"=",
"SequenceCreatorDialog",
"(",
"project",
"=",
"project",
",",
"parent",
"=",
"self",
")",
"dialog",
".",
"exec_",
"(",
")",
"seq",
"=",
"dialog",
".",
"sequence",
"return",
"seq"
] |
Create and return a new sequence
:param project: the project for the sequence
:type deps: :class:`jukeboxcore.djadapter.models.Project`
:returns: The created sequence or None
:rtype: None | :class:`jukeboxcore.djadapter.models.Sequence`
:raises: None
|
[
"Create",
"and",
"return",
"a",
"new",
"sequence"
] |
bac2280ca49940355270e4b69400ce9976ab2e6f
|
https://github.com/JukeboxPipeline/jukebox-core/blob/bac2280ca49940355270e4b69400ce9976ab2e6f/src/jukeboxcore/addons/guerilla/guerillamgmt.py#L1173-L1185
|
239,189
|
JukeboxPipeline/jukebox-core
|
src/jukeboxcore/addons/guerilla/guerillamgmt.py
|
GuerillaMGMTWin.prj_view_atype
|
def prj_view_atype(self, *args, **kwargs):
"""View the, in the atype table view selected, assettype.
:returns: None
:rtype: None
:raises: None
"""
if not self.cur_prj:
return
i = self.prj_atype_tablev.currentIndex()
item = i.internalPointer()
if item:
atype = item.internal_data()
self.view_atype(atype)
|
python
|
def prj_view_atype(self, *args, **kwargs):
"""View the, in the atype table view selected, assettype.
:returns: None
:rtype: None
:raises: None
"""
if not self.cur_prj:
return
i = self.prj_atype_tablev.currentIndex()
item = i.internalPointer()
if item:
atype = item.internal_data()
self.view_atype(atype)
|
[
"def",
"prj_view_atype",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"not",
"self",
".",
"cur_prj",
":",
"return",
"i",
"=",
"self",
".",
"prj_atype_tablev",
".",
"currentIndex",
"(",
")",
"item",
"=",
"i",
".",
"internalPointer",
"(",
")",
"if",
"item",
":",
"atype",
"=",
"item",
".",
"internal_data",
"(",
")",
"self",
".",
"view_atype",
"(",
"atype",
")"
] |
View the, in the atype table view selected, assettype.
:returns: None
:rtype: None
:raises: None
|
[
"View",
"the",
"in",
"the",
"atype",
"table",
"view",
"selected",
"assettype",
"."
] |
bac2280ca49940355270e4b69400ce9976ab2e6f
|
https://github.com/JukeboxPipeline/jukebox-core/blob/bac2280ca49940355270e4b69400ce9976ab2e6f/src/jukeboxcore/addons/guerilla/guerillamgmt.py#L1187-L1200
|
239,190
|
JukeboxPipeline/jukebox-core
|
src/jukeboxcore/addons/guerilla/guerillamgmt.py
|
GuerillaMGMTWin.prj_add_atype
|
def prj_add_atype(self, *args, **kwargs):
"""Add more assettypes to the project.
:returns: None
:rtype: None
:raises: None
"""
if not self.cur_prj:
return
dialog = AtypeAdderDialog(project=self.cur_prj)
dialog.exec_()
atypes = dialog.atypes
for atype in atypes:
atypedata = djitemdata.AtypeItemData(atype)
treemodel.TreeItem(atypedata, self.prj_atype_model.root)
|
python
|
def prj_add_atype(self, *args, **kwargs):
"""Add more assettypes to the project.
:returns: None
:rtype: None
:raises: None
"""
if not self.cur_prj:
return
dialog = AtypeAdderDialog(project=self.cur_prj)
dialog.exec_()
atypes = dialog.atypes
for atype in atypes:
atypedata = djitemdata.AtypeItemData(atype)
treemodel.TreeItem(atypedata, self.prj_atype_model.root)
|
[
"def",
"prj_add_atype",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"not",
"self",
".",
"cur_prj",
":",
"return",
"dialog",
"=",
"AtypeAdderDialog",
"(",
"project",
"=",
"self",
".",
"cur_prj",
")",
"dialog",
".",
"exec_",
"(",
")",
"atypes",
"=",
"dialog",
".",
"atypes",
"for",
"atype",
"in",
"atypes",
":",
"atypedata",
"=",
"djitemdata",
".",
"AtypeItemData",
"(",
"atype",
")",
"treemodel",
".",
"TreeItem",
"(",
"atypedata",
",",
"self",
".",
"prj_atype_model",
".",
"root",
")"
] |
Add more assettypes to the project.
:returns: None
:rtype: None
:raises: None
|
[
"Add",
"more",
"assettypes",
"to",
"the",
"project",
"."
] |
bac2280ca49940355270e4b69400ce9976ab2e6f
|
https://github.com/JukeboxPipeline/jukebox-core/blob/bac2280ca49940355270e4b69400ce9976ab2e6f/src/jukeboxcore/addons/guerilla/guerillamgmt.py#L1202-L1216
|
239,191
|
JukeboxPipeline/jukebox-core
|
src/jukeboxcore/addons/guerilla/guerillamgmt.py
|
GuerillaMGMTWin.create_atype
|
def create_atype(self, projects):
"""Create and return a new atype
:param projects: the projects for the atype
:type projects: :class:`jukeboxcore.djadapter.models.Project`
:returns: The created atype or None
:rtype: None | :class:`jukeboxcore.djadapter.models.Atype`
:raises: None
"""
dialog = AtypeCreatorDialog(projects=projects, parent=self)
dialog.exec_()
atype = dialog.atype
return atype
|
python
|
def create_atype(self, projects):
"""Create and return a new atype
:param projects: the projects for the atype
:type projects: :class:`jukeboxcore.djadapter.models.Project`
:returns: The created atype or None
:rtype: None | :class:`jukeboxcore.djadapter.models.Atype`
:raises: None
"""
dialog = AtypeCreatorDialog(projects=projects, parent=self)
dialog.exec_()
atype = dialog.atype
return atype
|
[
"def",
"create_atype",
"(",
"self",
",",
"projects",
")",
":",
"dialog",
"=",
"AtypeCreatorDialog",
"(",
"projects",
"=",
"projects",
",",
"parent",
"=",
"self",
")",
"dialog",
".",
"exec_",
"(",
")",
"atype",
"=",
"dialog",
".",
"atype",
"return",
"atype"
] |
Create and return a new atype
:param projects: the projects for the atype
:type projects: :class:`jukeboxcore.djadapter.models.Project`
:returns: The created atype or None
:rtype: None | :class:`jukeboxcore.djadapter.models.Atype`
:raises: None
|
[
"Create",
"and",
"return",
"a",
"new",
"atype"
] |
bac2280ca49940355270e4b69400ce9976ab2e6f
|
https://github.com/JukeboxPipeline/jukebox-core/blob/bac2280ca49940355270e4b69400ce9976ab2e6f/src/jukeboxcore/addons/guerilla/guerillamgmt.py#L1232-L1244
|
239,192
|
JukeboxPipeline/jukebox-core
|
src/jukeboxcore/addons/guerilla/guerillamgmt.py
|
GuerillaMGMTWin.view_atype
|
def view_atype(self, atype):
"""View the given atype on the atype page
:param atype: the atype to view
:type atype: :class:`jukeboxcore.djadapter.models.Atype`
:returns: None
:rtype: None
:raises: None
"""
if not self.cur_prj:
return
log.debug('Viewing atype %s', atype.name)
self.cur_atype = None
self.pages_tabw.setCurrentIndex(4)
self.atype_name_le.setText(atype.name)
self.atype_desc_pte.setPlainText(atype.description)
assetrootdata = treemodel.ListItemData(['Name', 'Description'])
assetrootitem = treemodel.TreeItem(assetrootdata)
self.atype_asset_model = treemodel.TreeModel(assetrootitem)
self.atype_asset_treev.setModel(self.atype_asset_model)
for a in djadapter.assets.filter(project=self.cur_prj, atype=atype):
assetdata = djitemdata.AssetItemData(a)
treemodel.TreeItem(assetdata, assetrootitem)
self.cur_atype = atype
|
python
|
def view_atype(self, atype):
"""View the given atype on the atype page
:param atype: the atype to view
:type atype: :class:`jukeboxcore.djadapter.models.Atype`
:returns: None
:rtype: None
:raises: None
"""
if not self.cur_prj:
return
log.debug('Viewing atype %s', atype.name)
self.cur_atype = None
self.pages_tabw.setCurrentIndex(4)
self.atype_name_le.setText(atype.name)
self.atype_desc_pte.setPlainText(atype.description)
assetrootdata = treemodel.ListItemData(['Name', 'Description'])
assetrootitem = treemodel.TreeItem(assetrootdata)
self.atype_asset_model = treemodel.TreeModel(assetrootitem)
self.atype_asset_treev.setModel(self.atype_asset_model)
for a in djadapter.assets.filter(project=self.cur_prj, atype=atype):
assetdata = djitemdata.AssetItemData(a)
treemodel.TreeItem(assetdata, assetrootitem)
self.cur_atype = atype
|
[
"def",
"view_atype",
"(",
"self",
",",
"atype",
")",
":",
"if",
"not",
"self",
".",
"cur_prj",
":",
"return",
"log",
".",
"debug",
"(",
"'Viewing atype %s'",
",",
"atype",
".",
"name",
")",
"self",
".",
"cur_atype",
"=",
"None",
"self",
".",
"pages_tabw",
".",
"setCurrentIndex",
"(",
"4",
")",
"self",
".",
"atype_name_le",
".",
"setText",
"(",
"atype",
".",
"name",
")",
"self",
".",
"atype_desc_pte",
".",
"setPlainText",
"(",
"atype",
".",
"description",
")",
"assetrootdata",
"=",
"treemodel",
".",
"ListItemData",
"(",
"[",
"'Name'",
",",
"'Description'",
"]",
")",
"assetrootitem",
"=",
"treemodel",
".",
"TreeItem",
"(",
"assetrootdata",
")",
"self",
".",
"atype_asset_model",
"=",
"treemodel",
".",
"TreeModel",
"(",
"assetrootitem",
")",
"self",
".",
"atype_asset_treev",
".",
"setModel",
"(",
"self",
".",
"atype_asset_model",
")",
"for",
"a",
"in",
"djadapter",
".",
"assets",
".",
"filter",
"(",
"project",
"=",
"self",
".",
"cur_prj",
",",
"atype",
"=",
"atype",
")",
":",
"assetdata",
"=",
"djitemdata",
".",
"AssetItemData",
"(",
"a",
")",
"treemodel",
".",
"TreeItem",
"(",
"assetdata",
",",
"assetrootitem",
")",
"self",
".",
"cur_atype",
"=",
"atype"
] |
View the given atype on the atype page
:param atype: the atype to view
:type atype: :class:`jukeboxcore.djadapter.models.Atype`
:returns: None
:rtype: None
:raises: None
|
[
"View",
"the",
"given",
"atype",
"on",
"the",
"atype",
"page"
] |
bac2280ca49940355270e4b69400ce9976ab2e6f
|
https://github.com/JukeboxPipeline/jukebox-core/blob/bac2280ca49940355270e4b69400ce9976ab2e6f/src/jukeboxcore/addons/guerilla/guerillamgmt.py#L1246-L1272
|
239,193
|
JukeboxPipeline/jukebox-core
|
src/jukeboxcore/addons/guerilla/guerillamgmt.py
|
GuerillaMGMTWin.prj_view_dep
|
def prj_view_dep(self, *args, **kwargs):
"""View the, in the dep table view selected, department.
:returns: None
:rtype: None
:raises: None
"""
if not self.cur_prj:
return
i = self.prj_dep_tablev.currentIndex()
item = i.internalPointer()
if item:
dep = item.internal_data()
self.view_dep(dep)
|
python
|
def prj_view_dep(self, *args, **kwargs):
"""View the, in the dep table view selected, department.
:returns: None
:rtype: None
:raises: None
"""
if not self.cur_prj:
return
i = self.prj_dep_tablev.currentIndex()
item = i.internalPointer()
if item:
dep = item.internal_data()
self.view_dep(dep)
|
[
"def",
"prj_view_dep",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"not",
"self",
".",
"cur_prj",
":",
"return",
"i",
"=",
"self",
".",
"prj_dep_tablev",
".",
"currentIndex",
"(",
")",
"item",
"=",
"i",
".",
"internalPointer",
"(",
")",
"if",
"item",
":",
"dep",
"=",
"item",
".",
"internal_data",
"(",
")",
"self",
".",
"view_dep",
"(",
"dep",
")"
] |
View the, in the dep table view selected, department.
:returns: None
:rtype: None
:raises: None
|
[
"View",
"the",
"in",
"the",
"dep",
"table",
"view",
"selected",
"department",
"."
] |
bac2280ca49940355270e4b69400ce9976ab2e6f
|
https://github.com/JukeboxPipeline/jukebox-core/blob/bac2280ca49940355270e4b69400ce9976ab2e6f/src/jukeboxcore/addons/guerilla/guerillamgmt.py#L1274-L1287
|
239,194
|
JukeboxPipeline/jukebox-core
|
src/jukeboxcore/addons/guerilla/guerillamgmt.py
|
GuerillaMGMTWin.prj_add_dep
|
def prj_add_dep(self, *args, **kwargs):
"""Add more departments to the project.
:returns: None
:rtype: None
:raises: None
"""
if not self.cur_prj:
return
dialog = DepAdderDialog(project=self.cur_prj)
dialog.exec_()
deps = dialog.deps
for dep in deps:
depdata = djitemdata.DepartmentItemData(dep)
treemodel.TreeItem(depdata, self.prj_dep_model.root)
|
python
|
def prj_add_dep(self, *args, **kwargs):
"""Add more departments to the project.
:returns: None
:rtype: None
:raises: None
"""
if not self.cur_prj:
return
dialog = DepAdderDialog(project=self.cur_prj)
dialog.exec_()
deps = dialog.deps
for dep in deps:
depdata = djitemdata.DepartmentItemData(dep)
treemodel.TreeItem(depdata, self.prj_dep_model.root)
|
[
"def",
"prj_add_dep",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"not",
"self",
".",
"cur_prj",
":",
"return",
"dialog",
"=",
"DepAdderDialog",
"(",
"project",
"=",
"self",
".",
"cur_prj",
")",
"dialog",
".",
"exec_",
"(",
")",
"deps",
"=",
"dialog",
".",
"deps",
"for",
"dep",
"in",
"deps",
":",
"depdata",
"=",
"djitemdata",
".",
"DepartmentItemData",
"(",
"dep",
")",
"treemodel",
".",
"TreeItem",
"(",
"depdata",
",",
"self",
".",
"prj_dep_model",
".",
"root",
")"
] |
Add more departments to the project.
:returns: None
:rtype: None
:raises: None
|
[
"Add",
"more",
"departments",
"to",
"the",
"project",
"."
] |
bac2280ca49940355270e4b69400ce9976ab2e6f
|
https://github.com/JukeboxPipeline/jukebox-core/blob/bac2280ca49940355270e4b69400ce9976ab2e6f/src/jukeboxcore/addons/guerilla/guerillamgmt.py#L1289-L1303
|
239,195
|
JukeboxPipeline/jukebox-core
|
src/jukeboxcore/addons/guerilla/guerillamgmt.py
|
GuerillaMGMTWin.create_dep
|
def create_dep(self, projects):
"""Create and return a new dep
:param projects: the projects for the dep
:type projects: :class:`jukeboxcore.djadapter.models.Project`
:returns: The created dep or None
:rtype: None | :class:`jukeboxcore.djadapter.models.Dep`
:raises: None
"""
dialog = DepCreatorDialog(projects=projects, parent=self)
dialog.exec_()
dep = dialog.dep
return dep
|
python
|
def create_dep(self, projects):
"""Create and return a new dep
:param projects: the projects for the dep
:type projects: :class:`jukeboxcore.djadapter.models.Project`
:returns: The created dep or None
:rtype: None | :class:`jukeboxcore.djadapter.models.Dep`
:raises: None
"""
dialog = DepCreatorDialog(projects=projects, parent=self)
dialog.exec_()
dep = dialog.dep
return dep
|
[
"def",
"create_dep",
"(",
"self",
",",
"projects",
")",
":",
"dialog",
"=",
"DepCreatorDialog",
"(",
"projects",
"=",
"projects",
",",
"parent",
"=",
"self",
")",
"dialog",
".",
"exec_",
"(",
")",
"dep",
"=",
"dialog",
".",
"dep",
"return",
"dep"
] |
Create and return a new dep
:param projects: the projects for the dep
:type projects: :class:`jukeboxcore.djadapter.models.Project`
:returns: The created dep or None
:rtype: None | :class:`jukeboxcore.djadapter.models.Dep`
:raises: None
|
[
"Create",
"and",
"return",
"a",
"new",
"dep"
] |
bac2280ca49940355270e4b69400ce9976ab2e6f
|
https://github.com/JukeboxPipeline/jukebox-core/blob/bac2280ca49940355270e4b69400ce9976ab2e6f/src/jukeboxcore/addons/guerilla/guerillamgmt.py#L1319-L1331
|
239,196
|
JukeboxPipeline/jukebox-core
|
src/jukeboxcore/addons/guerilla/guerillamgmt.py
|
GuerillaMGMTWin.view_dep
|
def view_dep(self, dep):
"""View the given department on the department page
:param dep: the dep to view
:type dep: :class:`jukeboxcore.djadapter.models.Department`
:returns: None
:rtype: None
:raises: None
"""
log.debug('Viewing department %s', dep.name)
self.cur_dep = None
self.pages_tabw.setCurrentIndex(6)
self.dep_name_le.setText(dep.name)
self.dep_short_le.setText(dep.short)
self.dep_shot_rb.setChecked(not dep.assetflag)
self.dep_asset_rb.setChecked(dep.assetflag)
self.dep_ordervalue_sb.setValue(dep.ordervalue)
self.dep_desc_pte.setPlainText(dep.description)
rootdata = treemodel.ListItemData(['Name', 'Short', 'Path', 'Created', 'Semester', 'Status', 'Resolution', 'FPS', 'Scale'])
rootitem = treemodel.TreeItem(rootdata)
prjs = dep.projects.all()
for prj in prjs:
prjdata = djitemdata.ProjectItemData(prj)
treemodel.TreeItem(prjdata, rootitem)
self.dep_prj_model = treemodel.TreeModel(rootitem)
self.dep_prj_tablev.setModel(self.dep_prj_model)
self.cur_dep = dep
|
python
|
def view_dep(self, dep):
"""View the given department on the department page
:param dep: the dep to view
:type dep: :class:`jukeboxcore.djadapter.models.Department`
:returns: None
:rtype: None
:raises: None
"""
log.debug('Viewing department %s', dep.name)
self.cur_dep = None
self.pages_tabw.setCurrentIndex(6)
self.dep_name_le.setText(dep.name)
self.dep_short_le.setText(dep.short)
self.dep_shot_rb.setChecked(not dep.assetflag)
self.dep_asset_rb.setChecked(dep.assetflag)
self.dep_ordervalue_sb.setValue(dep.ordervalue)
self.dep_desc_pte.setPlainText(dep.description)
rootdata = treemodel.ListItemData(['Name', 'Short', 'Path', 'Created', 'Semester', 'Status', 'Resolution', 'FPS', 'Scale'])
rootitem = treemodel.TreeItem(rootdata)
prjs = dep.projects.all()
for prj in prjs:
prjdata = djitemdata.ProjectItemData(prj)
treemodel.TreeItem(prjdata, rootitem)
self.dep_prj_model = treemodel.TreeModel(rootitem)
self.dep_prj_tablev.setModel(self.dep_prj_model)
self.cur_dep = dep
|
[
"def",
"view_dep",
"(",
"self",
",",
"dep",
")",
":",
"log",
".",
"debug",
"(",
"'Viewing department %s'",
",",
"dep",
".",
"name",
")",
"self",
".",
"cur_dep",
"=",
"None",
"self",
".",
"pages_tabw",
".",
"setCurrentIndex",
"(",
"6",
")",
"self",
".",
"dep_name_le",
".",
"setText",
"(",
"dep",
".",
"name",
")",
"self",
".",
"dep_short_le",
".",
"setText",
"(",
"dep",
".",
"short",
")",
"self",
".",
"dep_shot_rb",
".",
"setChecked",
"(",
"not",
"dep",
".",
"assetflag",
")",
"self",
".",
"dep_asset_rb",
".",
"setChecked",
"(",
"dep",
".",
"assetflag",
")",
"self",
".",
"dep_ordervalue_sb",
".",
"setValue",
"(",
"dep",
".",
"ordervalue",
")",
"self",
".",
"dep_desc_pte",
".",
"setPlainText",
"(",
"dep",
".",
"description",
")",
"rootdata",
"=",
"treemodel",
".",
"ListItemData",
"(",
"[",
"'Name'",
",",
"'Short'",
",",
"'Path'",
",",
"'Created'",
",",
"'Semester'",
",",
"'Status'",
",",
"'Resolution'",
",",
"'FPS'",
",",
"'Scale'",
"]",
")",
"rootitem",
"=",
"treemodel",
".",
"TreeItem",
"(",
"rootdata",
")",
"prjs",
"=",
"dep",
".",
"projects",
".",
"all",
"(",
")",
"for",
"prj",
"in",
"prjs",
":",
"prjdata",
"=",
"djitemdata",
".",
"ProjectItemData",
"(",
"prj",
")",
"treemodel",
".",
"TreeItem",
"(",
"prjdata",
",",
"rootitem",
")",
"self",
".",
"dep_prj_model",
"=",
"treemodel",
".",
"TreeModel",
"(",
"rootitem",
")",
"self",
".",
"dep_prj_tablev",
".",
"setModel",
"(",
"self",
".",
"dep_prj_model",
")",
"self",
".",
"cur_dep",
"=",
"dep"
] |
View the given department on the department page
:param dep: the dep to view
:type dep: :class:`jukeboxcore.djadapter.models.Department`
:returns: None
:rtype: None
:raises: None
|
[
"View",
"the",
"given",
"department",
"on",
"the",
"department",
"page"
] |
bac2280ca49940355270e4b69400ce9976ab2e6f
|
https://github.com/JukeboxPipeline/jukebox-core/blob/bac2280ca49940355270e4b69400ce9976ab2e6f/src/jukeboxcore/addons/guerilla/guerillamgmt.py#L1333-L1361
|
239,197
|
JukeboxPipeline/jukebox-core
|
src/jukeboxcore/addons/guerilla/guerillamgmt.py
|
GuerillaMGMTWin.prj_view_user
|
def prj_view_user(self, *args, **kwargs):
"""View the, in the user table view selected, user.
:returns: None
:rtype: None
:raises: None
"""
if not self.cur_prj:
return
i = self.prj_user_tablev.currentIndex()
item = i.internalPointer()
if item:
user = item.internal_data()
self.view_user(user)
|
python
|
def prj_view_user(self, *args, **kwargs):
"""View the, in the user table view selected, user.
:returns: None
:rtype: None
:raises: None
"""
if not self.cur_prj:
return
i = self.prj_user_tablev.currentIndex()
item = i.internalPointer()
if item:
user = item.internal_data()
self.view_user(user)
|
[
"def",
"prj_view_user",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"not",
"self",
".",
"cur_prj",
":",
"return",
"i",
"=",
"self",
".",
"prj_user_tablev",
".",
"currentIndex",
"(",
")",
"item",
"=",
"i",
".",
"internalPointer",
"(",
")",
"if",
"item",
":",
"user",
"=",
"item",
".",
"internal_data",
"(",
")",
"self",
".",
"view_user",
"(",
"user",
")"
] |
View the, in the user table view selected, user.
:returns: None
:rtype: None
:raises: None
|
[
"View",
"the",
"in",
"the",
"user",
"table",
"view",
"selected",
"user",
"."
] |
bac2280ca49940355270e4b69400ce9976ab2e6f
|
https://github.com/JukeboxPipeline/jukebox-core/blob/bac2280ca49940355270e4b69400ce9976ab2e6f/src/jukeboxcore/addons/guerilla/guerillamgmt.py#L1363-L1376
|
239,198
|
JukeboxPipeline/jukebox-core
|
src/jukeboxcore/addons/guerilla/guerillamgmt.py
|
GuerillaMGMTWin.prj_add_user
|
def prj_add_user(self, *args, **kwargs):
"""Add more users to the project.
:returns: None
:rtype: None
:raises: None
"""
if not self.cur_prj:
return
dialog = UserAdderDialog(project=self.cur_prj)
dialog.exec_()
users = dialog.users
for user in users:
userdata = djitemdata.UserItemData(user)
treemodel.TreeItem(userdata, self.prj_user_model.root)
self.cur_prj.save()
|
python
|
def prj_add_user(self, *args, **kwargs):
"""Add more users to the project.
:returns: None
:rtype: None
:raises: None
"""
if not self.cur_prj:
return
dialog = UserAdderDialog(project=self.cur_prj)
dialog.exec_()
users = dialog.users
for user in users:
userdata = djitemdata.UserItemData(user)
treemodel.TreeItem(userdata, self.prj_user_model.root)
self.cur_prj.save()
|
[
"def",
"prj_add_user",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"not",
"self",
".",
"cur_prj",
":",
"return",
"dialog",
"=",
"UserAdderDialog",
"(",
"project",
"=",
"self",
".",
"cur_prj",
")",
"dialog",
".",
"exec_",
"(",
")",
"users",
"=",
"dialog",
".",
"users",
"for",
"user",
"in",
"users",
":",
"userdata",
"=",
"djitemdata",
".",
"UserItemData",
"(",
"user",
")",
"treemodel",
".",
"TreeItem",
"(",
"userdata",
",",
"self",
".",
"prj_user_model",
".",
"root",
")",
"self",
".",
"cur_prj",
".",
"save",
"(",
")"
] |
Add more users to the project.
:returns: None
:rtype: None
:raises: None
|
[
"Add",
"more",
"users",
"to",
"the",
"project",
"."
] |
bac2280ca49940355270e4b69400ce9976ab2e6f
|
https://github.com/JukeboxPipeline/jukebox-core/blob/bac2280ca49940355270e4b69400ce9976ab2e6f/src/jukeboxcore/addons/guerilla/guerillamgmt.py#L1378-L1393
|
239,199
|
JukeboxPipeline/jukebox-core
|
src/jukeboxcore/addons/guerilla/guerillamgmt.py
|
GuerillaMGMTWin.prj_remove_user
|
def prj_remove_user(self, *args, **kwargs):
"""Remove the, in the user table view selected, user.
:returns: None
:rtype: None
:raises: None
"""
if not self.cur_prj:
return
i = self.prj_user_tablev.currentIndex()
item = i.internalPointer()
if item:
user = item.internal_data()
log.debug("Removing user %s.", user.username)
item.set_parent(None)
self.cur_prj.users.remove(user)
|
python
|
def prj_remove_user(self, *args, **kwargs):
"""Remove the, in the user table view selected, user.
:returns: None
:rtype: None
:raises: None
"""
if not self.cur_prj:
return
i = self.prj_user_tablev.currentIndex()
item = i.internalPointer()
if item:
user = item.internal_data()
log.debug("Removing user %s.", user.username)
item.set_parent(None)
self.cur_prj.users.remove(user)
|
[
"def",
"prj_remove_user",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"not",
"self",
".",
"cur_prj",
":",
"return",
"i",
"=",
"self",
".",
"prj_user_tablev",
".",
"currentIndex",
"(",
")",
"item",
"=",
"i",
".",
"internalPointer",
"(",
")",
"if",
"item",
":",
"user",
"=",
"item",
".",
"internal_data",
"(",
")",
"log",
".",
"debug",
"(",
"\"Removing user %s.\"",
",",
"user",
".",
"username",
")",
"item",
".",
"set_parent",
"(",
"None",
")",
"self",
".",
"cur_prj",
".",
"users",
".",
"remove",
"(",
"user",
")"
] |
Remove the, in the user table view selected, user.
:returns: None
:rtype: None
:raises: None
|
[
"Remove",
"the",
"in",
"the",
"user",
"table",
"view",
"selected",
"user",
"."
] |
bac2280ca49940355270e4b69400ce9976ab2e6f
|
https://github.com/JukeboxPipeline/jukebox-core/blob/bac2280ca49940355270e4b69400ce9976ab2e6f/src/jukeboxcore/addons/guerilla/guerillamgmt.py#L1395-L1410
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.