Skip to content

Commit

Permalink
Merge pull request #47 from pygraphviz/html-xlabel
Browse files Browse the repository at this point in the history
Handle 'xlabel' attribute like 'label'
  • Loading branch information
hagberg committed Feb 23, 2015
2 parents d97a503 + 2521fe2 commit 5ca3f97
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
4 changes: 2 additions & 2 deletions pygraphviz/graphviz.i
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ int agsafeset(void *obj, char *name, char *value, char *def);
int len;
char *hs;

if (val[0] == '<' && strcmp(name, "label") == 0) {
if (val[0] == '<' && (strcmp(name, "label") == 0 || strcmp(name, "xlabel") == 0)) {
len = strlen(val);
if (val[len-1] == '>') {
hs = strdup(val+1);
Expand All @@ -227,7 +227,7 @@ int agsafeset(void *obj, char *name, char *value, char *def);
int len;
char *hs;

if (val[0] == '<' && strcmp(name, "label") == 0) {
if (val[0] == '<' && (strcmp(name, "label") == 0 || strcmp(name, "xlabel") == 0)) {
len = strlen(val);
if (val[len-1] == '>') {
hs = strdup(val+1);
Expand Down
9 changes: 4 additions & 5 deletions pygraphviz/graphviz.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,15 @@
from sys import version_info
if version_info >= (2,6,0):
def swig_import_helper():
from os.path import dirname, join
from os.path import dirname
import imp
import site
fp = None
try:
fp, pathname, description = imp.find_module('_graphviz', list(site._init_pathinfo()) +
[dirname(__file__), join(dirname(__file__),'pyvizgraph')])
fp, pathname, description = imp.find_module('_graphviz', [dirname(__file__)])
except ImportError:
import _graphviz
return _graphviz
if fp:
if fp is not None:
try:
_mod = imp.load_module('_graphviz', fp, pathname, description)
finally:
Expand Down
4 changes: 2 additions & 2 deletions pygraphviz/graphviz_wrap.c
Original file line number Diff line number Diff line change
Expand Up @@ -3291,7 +3291,7 @@ SWIG_FromCharPtr(const char *cptr)
int len;
char *hs;

if (val[0] == '<' && strcmp(name, "label") == 0) {
if (val[0] == '<' && (strcmp(name, "label") == 0 || strcmp(name, "xlabel") == 0)) {
len = strlen(val);
if (val[len-1] == '>') {
hs = strdup(val+1);
Expand All @@ -3309,7 +3309,7 @@ SWIG_FromCharPtr(const char *cptr)
int len;
char *hs;

if (val[0] == '<' && strcmp(name, "label") == 0) {
if (val[0] == '<' && (strcmp(name, "label") == 0 || strcmp(name, "xlabel") == 0)) {
len = strlen(val);
if (val[len-1] == '>') {
hs = strdup(val+1);
Expand Down

0 comments on commit 5ca3f97

Please sign in to comment.