-
Notifications
You must be signed in to change notification settings - Fork 181
#86 Repository location stripping #88
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
graysonarts
merged 4 commits into
tableau:development
from
graysonarts:repository-location-stripping
Oct 4, 2016
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
f8bf9c9
Fixing xfile's save_as functionality for non .t*x files
c1cd59b
Add the ability to clear repository location on the datasource for re…
bd3dda6
fixing a pep8 issue that was missed
49713a8
Adding None check for repository-location in case it doesn't exist
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -105,10 +105,10 @@ def save_into_archive(xml_tree, filename, new_filename=None): | |
|
||
def _save_file(container_file, xml_tree, new_filename=None): | ||
|
||
if container_file is None: | ||
container_file = new_filename | ||
if new_filename is None: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oops, thanks! |
||
new_filename = container_file | ||
|
||
if zipfile.is_zipfile(container_file): | ||
save_into_archive(xml_tree, container_file, new_filename) | ||
else: | ||
xml_tree.write(container_file, encoding="utf-8", xml_declaration=True) | ||
xml_tree.write(new_filename, encoding="utf-8", xml_declaration=True) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,93 +1,94 @@ | ||
<?xml version='1.0' encoding='utf-8' ?> | ||
<datasource formatted-name='postgres.1of3kl00aoax5d1a1ejma1397430' inline='true' source-platform='mac' version='9.3' xmlns:user='http://www.tableausoftware.com/xml/user'> | ||
<connection authentication='username-password' class='postgres' dbname='TestV1' odbc-native-protocol='yes' port='5432' server='postgres91.test.tsi.lan' username='test'> | ||
<relation name='xy' table='[public].[xy]' type='table' /> | ||
<metadata-records> | ||
<metadata-record class='column'> | ||
<remote-name>a</remote-name> | ||
<remote-type>130</remote-type> | ||
<local-name>[a]</local-name> | ||
<parent-name>[xy]</parent-name> | ||
<remote-alias>a</remote-alias> | ||
<ordinal>1</ordinal> | ||
<local-type>string</local-type> | ||
<aggregation>Count</aggregation> | ||
<width>255</width> | ||
<contains-null>true</contains-null> | ||
<attributes> | ||
<attribute datatype='string' name='DebugRemoteType'>"SQL_WVARCHAR"</attribute> | ||
<attribute datatype='string' name='DebugWireType'>"SQL_C_WCHAR"</attribute> | ||
<attribute datatype='string' name='TypeIsVarchar'>"true"</attribute> | ||
</attributes> | ||
</metadata-record> | ||
<metadata-record class='column'> | ||
<remote-name>Today's Date</remote-name> | ||
<remote-type>130</remote-type> | ||
<local-name>[Today's Date]</local-name> | ||
<parent-name>[xy]</parent-name> | ||
<remote-alias>a</remote-alias> | ||
<ordinal>1</ordinal> | ||
<local-type>string</local-type> | ||
<aggregation>Count</aggregation> | ||
<width>255</width> | ||
<contains-null>true</contains-null> | ||
<attributes> | ||
<attribute datatype='string' name='DebugRemoteType'>"SQL_WVARCHAR"</attribute> | ||
<attribute datatype='string' name='DebugWireType'>"SQL_C_WCHAR"</attribute> | ||
<attribute datatype='string' name='TypeIsVarchar'>"true"</attribute> | ||
</attributes> | ||
</metadata-record> | ||
<metadata-record class='column'> | ||
<remote-name>x</remote-name> | ||
<remote-type>3</remote-type> | ||
<local-name>[x]</local-name> | ||
<parent-name>[xy]</parent-name> | ||
<remote-alias>x</remote-alias> | ||
<ordinal>2</ordinal> | ||
<local-type>integer</local-type> | ||
<aggregation>Sum</aggregation> | ||
<precision>10</precision> | ||
<contains-null>true</contains-null> | ||
<attributes> | ||
<attribute datatype='string' name='DebugRemoteType'>"SQL_INTEGER"</attribute> | ||
<attribute datatype='string' name='DebugWireType'>"SQL_C_SLONG"</attribute> | ||
</attributes> | ||
</metadata-record> | ||
<metadata-record class='column'> | ||
<remote-name>y</remote-name> | ||
<remote-type>3</remote-type> | ||
<local-name>[y]</local-name> | ||
<parent-name>[xy]</parent-name> | ||
<remote-alias>y</remote-alias> | ||
<ordinal>3</ordinal> | ||
<local-type>integer</local-type> | ||
<aggregation>Sum</aggregation> | ||
<precision>10</precision> | ||
<contains-null>true</contains-null> | ||
<attributes> | ||
<attribute datatype='string' name='DebugRemoteType'>"SQL_INTEGER"</attribute> | ||
<attribute datatype='string' name='DebugWireType'>"SQL_C_SLONG"</attribute> | ||
</attributes> | ||
</metadata-record> | ||
</metadata-records> | ||
</connection> | ||
<aliases enabled='yes' /> | ||
<column datatype='integer' name='[Number of Records]' role='measure' type='quantitative' user:auto-column='numrec'> | ||
<calculation class='tableau' formula='1' /> | ||
</column> | ||
<column caption='A' datatype='string' name='[a]' role='dimension' type='nominal'> | ||
<desc> | ||
<formatted-text> | ||
<run bold='true' fontsize='96'>A thing</run> | ||
<run fontcolor='#686868'> Something will go here too, in a muted gray</run> | ||
</formatted-text> | ||
</desc> | ||
</column> | ||
<column caption='Today's Date' datatype='string' name='[Today's Date]' role='dimension' type='nominal' /> | ||
<column caption='X' datatype='integer' name='[x]' role='measure' type='ordinal' /> | ||
<column caption='Y' datatype='integer' name='[y]' role='measure' type='quantitative' /> | ||
<layout dim-ordering='alphabetic' dim-percentage='0.5' measure-ordering='alphabetic' measure-percentage='0.5' show-structure='true' /> | ||
<semantic-values> | ||
<semantic-value key='[Country].[Name]' value='"United States"' /> | ||
</semantic-values> | ||
</datasource> | ||
<?xml version='1.0' encoding='utf-8' ?> | ||
<datasource formatted-name='postgres.1of3kl00aoax5d1a1ejma1397430' inline='true' source-platform='mac' version='9.3' xmlns:user='http://www.tableausoftware.com/xml/user'> | ||
<repository-location /> | ||
<connection authentication='username-password' class='postgres' dbname='TestV1' odbc-native-protocol='yes' port='5432' server='postgres91.test.tsi.lan' username='test'> | ||
<relation name='xy' table='[public].[xy]' type='table' /> | ||
<metadata-records> | ||
<metadata-record class='column'> | ||
<remote-name>a</remote-name> | ||
<remote-type>130</remote-type> | ||
<local-name>[a]</local-name> | ||
<parent-name>[xy]</parent-name> | ||
<remote-alias>a</remote-alias> | ||
<ordinal>1</ordinal> | ||
<local-type>string</local-type> | ||
<aggregation>Count</aggregation> | ||
<width>255</width> | ||
<contains-null>true</contains-null> | ||
<attributes> | ||
<attribute datatype='string' name='DebugRemoteType'>"SQL_WVARCHAR"</attribute> | ||
<attribute datatype='string' name='DebugWireType'>"SQL_C_WCHAR"</attribute> | ||
<attribute datatype='string' name='TypeIsVarchar'>"true"</attribute> | ||
</attributes> | ||
</metadata-record> | ||
<metadata-record class='column'> | ||
<remote-name>Today's Date</remote-name> | ||
<remote-type>130</remote-type> | ||
<local-name>[Today's Date]</local-name> | ||
<parent-name>[xy]</parent-name> | ||
<remote-alias>a</remote-alias> | ||
<ordinal>1</ordinal> | ||
<local-type>string</local-type> | ||
<aggregation>Count</aggregation> | ||
<width>255</width> | ||
<contains-null>true</contains-null> | ||
<attributes> | ||
<attribute datatype='string' name='DebugRemoteType'>"SQL_WVARCHAR"</attribute> | ||
<attribute datatype='string' name='DebugWireType'>"SQL_C_WCHAR"</attribute> | ||
<attribute datatype='string' name='TypeIsVarchar'>"true"</attribute> | ||
</attributes> | ||
</metadata-record> | ||
<metadata-record class='column'> | ||
<remote-name>x</remote-name> | ||
<remote-type>3</remote-type> | ||
<local-name>[x]</local-name> | ||
<parent-name>[xy]</parent-name> | ||
<remote-alias>x</remote-alias> | ||
<ordinal>2</ordinal> | ||
<local-type>integer</local-type> | ||
<aggregation>Sum</aggregation> | ||
<precision>10</precision> | ||
<contains-null>true</contains-null> | ||
<attributes> | ||
<attribute datatype='string' name='DebugRemoteType'>"SQL_INTEGER"</attribute> | ||
<attribute datatype='string' name='DebugWireType'>"SQL_C_SLONG"</attribute> | ||
</attributes> | ||
</metadata-record> | ||
<metadata-record class='column'> | ||
<remote-name>y</remote-name> | ||
<remote-type>3</remote-type> | ||
<local-name>[y]</local-name> | ||
<parent-name>[xy]</parent-name> | ||
<remote-alias>y</remote-alias> | ||
<ordinal>3</ordinal> | ||
<local-type>integer</local-type> | ||
<aggregation>Sum</aggregation> | ||
<precision>10</precision> | ||
<contains-null>true</contains-null> | ||
<attributes> | ||
<attribute datatype='string' name='DebugRemoteType'>"SQL_INTEGER"</attribute> | ||
<attribute datatype='string' name='DebugWireType'>"SQL_C_SLONG"</attribute> | ||
</attributes> | ||
</metadata-record> | ||
</metadata-records> | ||
</connection> | ||
<aliases enabled='yes' /> | ||
<column datatype='integer' name='[Number of Records]' role='measure' type='quantitative' user:auto-column='numrec'> | ||
<calculation class='tableau' formula='1' /> | ||
</column> | ||
<column caption='A' datatype='string' name='[a]' role='dimension' type='nominal'> | ||
<desc> | ||
<formatted-text> | ||
<run bold='true' fontsize='96'>A thing</run> | ||
<run fontcolor='#686868'> Something will go here too, in a muted gray</run> | ||
</formatted-text> | ||
</desc> | ||
</column> | ||
<column caption='Today's Date' datatype='string' name='[Today's Date]' role='dimension' type='nominal' /> | ||
<column caption='X' datatype='integer' name='[x]' role='measure' type='ordinal' /> | ||
<column caption='Y' datatype='integer' name='[y]' role='measure' type='quantitative' /> | ||
<layout dim-ordering='alphabetic' dim-percentage='0.5' measure-ordering='alphabetic' measure-percentage='0.5' show-structure='true' /> | ||
<semantic-values> | ||
<semantic-value key='[Country].[Name]' value='"United States"' /> | ||
</semantic-values> | ||
</datasource> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Intentional that it's
./
here but.//
in the test?